|
@@ -186,20 +186,29 @@
|
|
|
if (system.uniPlatform == "mp-weixin") {
|
|
|
uni.login({
|
|
|
provider: 'weixin',
|
|
|
- success: async function(res) {
|
|
|
- const aee = await that.$api(`/wechat/api/login/app`, 'GET', {
|
|
|
- config: that.$config.wx_projectkey,
|
|
|
- js_code: res.code
|
|
|
- })
|
|
|
- if (aee.errcode == '0') {
|
|
|
- that.$set(that, `openid`, aee.data.openid);
|
|
|
- }
|
|
|
+ success: function(res) {
|
|
|
+ if (res && res.code) that.searchOpenids(res.code)
|
|
|
+ },
|
|
|
+ fail: function(err) {
|
|
|
+ console.log('2');
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
} else if (system.uniPlatform == "app") {
|
|
|
console.log('app');
|
|
|
}
|
|
|
},
|
|
|
+ async searchOpenids(code) {
|
|
|
+ const that = this;
|
|
|
+ const aee = await that.$api(`/wechat/api/login/app`, 'GET', {
|
|
|
+ config: that.$config.wx_projectkey,
|
|
|
+ js_code: code
|
|
|
+ })
|
|
|
+ if (aee.errcode == '0') {
|
|
|
+ console.log(aee);
|
|
|
+ that.$set(that, `openid`, aee.data.openid);
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
// 选择登录类型
|
|
|
typeChange(e) {
|