Browse Source

地址拆解,注意正式环境中地址前缀的变化

master
453530270@qq.com 2 years ago
parent
commit
5ad92eff67
  1. 14
      api/login/index.js
  2. 2
      config.js
  3. 4
      pages/login/components/main.vue

14
api/login/index.js

@ -1,8 +1,11 @@
import request from '@/utils/request' import request from '@/utils/request'
// 前缀
const prefix ="dev-api/"
// api地址 // api地址
const api = { const api = {
login: 'user/v1/userLogin', login: prefix+'user/v1/userLogin',
loginMpWx: 'passport/loginMpWx', loginMpWx: 'passport/loginMpWx',
loginMpWxMobile: 'passport/loginMpWxMobile', loginMpWxMobile: 'passport/loginMpWxMobile',
} }
@ -12,12 +15,3 @@ export function login(data) {
return request.post(api.login, data) return request.post(api.login, data)
} }
// 微信小程序快捷登录(获取微信用户基本信息)
export function loginMpWx(data, option) {
return request.post(api.loginMpWx, data, option)
}
// 微信小程序快捷登录(授权手机号)
export function loginMpWxMobile(data, option) {
return request.post(api.loginMpWxMobile, data, option)
}

2
config.js

@ -6,7 +6,7 @@ module.exports = {
// 必填: 后端api地址, 斜杠/结尾, 参照下面格式 // 必填: 后端api地址, 斜杠/结尾, 参照下面格式
// 例如: https://www.你的域名.com/index.php?s=/api/ // 例如: https://www.你的域名.com/index.php?s=/api/
//apiUrl: "http://192.168.66.16:8089/index.php?s=/api/", //apiUrl: "http://192.168.66.16:8089/index.php?s=/api/",
apiUrl: "http://58.30.231.137:8022/AgencyAddress/", apiUrl: "http://58.30.231.137:8022/",
/** /**
* 是否启用商城设置缓存 * 是否启用商城设置缓存

4
pages/login/components/main.vue

@ -20,7 +20,7 @@
<!-- 选择机构个人 --> <!-- 选择机构个人 -->
<radio-group @change="radioChange"> <radio-group @change="radioChange">
<view class="form-item"> <view class="form-item">
<radio class="radio" color="#fa2209" value="机构" :checked="utchk1"/> 机构 <radio class="radio" color="#fa2209" value="企业" :checked="utchk1"/> 机构
</view> </view>
<view class="form-item"> <view class="form-item">
@ -102,7 +102,7 @@
// //
radioChange(evt) { radioChange(evt) {
this.userType = evt.detail.value this.userType = evt.detail.value
if(this.userType=="机构"){ if(this.userType=="企业"){
this.utchk2=false this.utchk2=false
this.utchk1=true; this.utchk1=true;
}else{ }else{

Loading…
Cancel
Save