Authored by 李奇

登录传递小程序类型

... ... @@ -256,7 +256,7 @@ App({
this.setSessionKey('');
},
getMiniappType() {
return config.mini_app_type;
return wx.getExtConfigSync().miniappType;
},
getUnionType() {
return config.unionType;
... ...
... ... @@ -130,7 +130,7 @@ function wechatAuthLogin() { // showMsg: 是否显示拒绝授权提示
return wx.login()
.then(res => {
if (res.code) {
return accountModel.wechatMiniAppLogin(app.getAppId(), res.code);
return accountModel.wechatMiniAppLogin(res.code);
}
})
.then(data => {
... ...
... ... @@ -5,6 +5,7 @@
"ext": {
"name": "wechat",
"extAppid": "wxe8bfc9b404772199",
"miniappType": "5",
"attr": {
"host": "open.weixin.qq.com",
"users": [
... ...
... ... @@ -43,13 +43,15 @@ export default {
* @param code
* @returns {*}
*/
wechatMiniAppLogin(appId, code) {
wechatMiniAppLogin(code) {
const app = getApp();
return api.get({
url: '/wechat/',
data: {
method: 'wechat.smallProgram.onLogin',
jsCode: code,
appId
miniapp_type: app.getMiniappType()
}
});
},
... ...