Authored by QC-L

更新为 UFO APPID,修复登录弹出展示 review by 黄敬囿

... ... @@ -3,7 +3,8 @@ export default {
domains: {
// production
api: 'http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway',
yohoApi: 'http://api-test3.dev.yohocorp.com'
yohoApi: 'http://api-test3.dev.yohocorp.com',
yohoLogin: 'http://java-yoho-wechat.test3.ingress.dev.yohocorp.com'
},
apiParams: {
client_type: 'miniapp',
... ... @@ -16,15 +17,16 @@ export default {
},
unionType: '', // 渠道号
// MINI_APP_DOMAIN: 'miniapp.yohobuy.com',
appid: 'wx193403dfd8cf74a1',
appid: 'wxc677c88385762287',
business_line: 'miniapp', // 业务线
mini_app_type: '62',
mini_app_type: '63',
},
production: {
domains: {
// production
api: 'https://2.yohobuy.com',
yohoApi: 'https://api.yoho.cn'
yohoApi: 'https://api.yoho.cn',
yohoLogin: 'https://api.yoho.cn'
},
apiParams: {
client_type: 'miniapp',
... ... @@ -37,8 +39,8 @@ export default {
},
unionType: '', // 渠道号
// MINI_APP_DOMAIN: 'miniapp.yohobuy.com',
appid: 'wx193403dfd8cf74a1',
appid: 'wxc677c88385762287',
business_line: 'yohobuy', // 业务线
mini_app_type: '62',
mini_app_type: '63',
}
}[process.env.NODE_ENV];
... ...
... ... @@ -77,7 +77,7 @@ export const decodeUnionId = (srd_session, result) => {
union_id = globalData.union_id;
}
if (!union_id) {
throw new Error('union_id is null');
throw new Error('授权失败,请使用手机号登录');
}
// 网络上传头像,union_id,昵称
login.sendWeChatUserDataWithUnionId(data.union_id, nickName, avatarUrl).catch(error => {
... ...
const { GET, POST } = require('../request/request');
import config from '../../config.js'
const WECHAT_SMALLPROGRAM_ONLOGIN = 'wechat.smallProgram.onLogin';
const WECHAT_SMALLPROGRAM_DECODEUSERINFO = 'wechat.smallProgram.decodeUserInfo';
export default class BaseService {
constructor(url) {
this.url = config.domains.api;
... ... @@ -18,10 +21,19 @@ export default class BaseService {
this.url = config.domains.api;
return this;
}
loginApi() {
this.url = config.domains.yohoLogin
return this;
}
async GET(params, options) {
let url = this.url;
if (params.method === WECHAT_SMALLPROGRAM_ONLOGIN || params.method === WECHAT_SMALLPROGRAM_DECODEUSERINFO) {
url = config.domains.yohoLogin;
}
return await GET({
url: this.url,
url: url,
path: options && options.path ? options.path: '',
params: params,
complete: options && options.complete ? options.complete: null
... ...