socket
This commit is contained in:
@@ -274,26 +274,35 @@
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
let res = await this.api.loginapplogin({
|
||||
username: this.form.loginName,
|
||||
password: this.form.password,
|
||||
code: this.form.code
|
||||
});
|
||||
console.log(res);
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('token', res.data.token);
|
||||
uni.cache.set('miniAppOpenId', res.data.userInfo
|
||||
.miniAppOpenId)
|
||||
uni.cache.set('userInfo', res.data.userInfo);
|
||||
if (uni.cache.get('types') == 'types') {
|
||||
uni.reLaunch({
|
||||
url: '/pages/order_food/order_food'
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
let res = await this.api.loginapplogin({
|
||||
username: this.form.loginName,
|
||||
password: this.form.password,
|
||||
code: this.form.code,
|
||||
opencode: data.code
|
||||
});
|
||||
} else {
|
||||
uni.pro.switchTab('index/index')
|
||||
}
|
||||
console.log(res);
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('token', res.data.token);
|
||||
uni.cache.set('miniAppOpenId', res.data.userInfo
|
||||
.miniAppOpenId)
|
||||
uni.cache.set('userInfo', res.data.userInfo);
|
||||
if (uni.cache.get('types') == 'types') {
|
||||
uni.reLaunch({
|
||||
url: '/pages/order_food/order_food'
|
||||
});
|
||||
} else {
|
||||
uni.pro.switchTab('index/index')
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
// async getPhoneNumber(res) { // 获取手机号
|
||||
|
||||
Reference in New Issue
Block a user