合并更改
This commit is contained in:
commit
81f122c9fc
3
App.vue
3
App.vue
|
|
@ -19,7 +19,7 @@
|
||||||
// console.log('App Hide');
|
// console.log('App Hide');
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
userlogin() {
|
async userlogin() {
|
||||||
uni.login({
|
uni.login({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
success: (data) => {
|
success: (data) => {
|
||||||
|
|
@ -42,6 +42,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -103,19 +103,19 @@ async function request(options) {
|
||||||
// #endif
|
// #endif
|
||||||
if (res.code != 0) {
|
if (res.code != 0) {
|
||||||
if (res.code == -4) {
|
if (res.code == -4) {
|
||||||
// uni.showToast({
|
uni.showToast({
|
||||||
// title: res.message || res.msg,
|
title: res.message || res.msg,
|
||||||
// icon: "none",
|
icon: "none"
|
||||||
// success: () => {
|
// success: () => {
|
||||||
// setTimeout(res => {
|
// setTimeout(res => {
|
||||||
// uni.cache.set('token', '');
|
// uni.cache.set('token', '');
|
||||||
// uni.redirectTo({
|
// uni.redirectTo({
|
||||||
// url: '/pages/login/login'
|
// url: '/pages/login/login'
|
||||||
// });
|
// });
|
||||||
// }, 1000)
|
// }, 1000)
|
||||||
|
|
||||||
// }
|
// }
|
||||||
// })
|
})
|
||||||
} else if (res.code == 482) {
|
} else if (res.code == 482) {
|
||||||
let nowTime = new Date() / 1000 | 0
|
let nowTime = new Date() / 1000 | 0
|
||||||
let offset = parseInt(res.data.message) - parseInt(nowTime);
|
let offset = parseInt(res.data.message) - parseInt(nowTime);
|
||||||
|
|
|
||||||
|
|
@ -322,8 +322,37 @@
|
||||||
this.fixedtrue = true
|
this.fixedtrue = true
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
uni.$on('message', this.getMessage)
|
if (!uni.cache.get('token')) {
|
||||||
this.productqueryShopIdByTableCode() //获取shop User id
|
uni.login({
|
||||||
|
provider: 'weixin',
|
||||||
|
success: async (data) => {
|
||||||
|
try {
|
||||||
|
uni.getUserInfo({
|
||||||
|
provider: 'weixin',
|
||||||
|
success: async (infoRes) => {
|
||||||
|
uni.cache.set('weixincode', data.code);
|
||||||
|
let res = await this.api.userwxlogin({
|
||||||
|
code: uni.cache.get('weixincode'), //临时登录凭证
|
||||||
|
rawData: infoRes.rawData
|
||||||
|
})
|
||||||
|
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);
|
||||||
|
uni.$on('message', this.getMessage)
|
||||||
|
this.productqueryShopIdByTableCode() //获取shop User id
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {}
|
||||||
|
});
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.$on('message', this.getMessage)
|
||||||
|
this.productqueryShopIdByTableCode() //获取shop User id
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onEnd() { //回调弹幕
|
onEnd() { //回调弹幕
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue