This commit is contained in:
魏啾
2024-06-28 11:29:09 +08:00
parent 49e5ed4b5c
commit 736ff85457
5 changed files with 113 additions and 42 deletions

View File

@@ -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) { // 获取手机号