|
|
@@ -222,12 +222,14 @@ export default {
|
|
|
//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
|
|
|
if(subRes.code == 1){
|
|
|
if (that.$util.isEmpty(subRes)) {
|
|
|
+ uni.showToast({title:'subRes is empty', duration: 3000, icon:'none'})
|
|
|
return false
|
|
|
}
|
|
|
uni.setStorageSync('token', subRes.data.token)
|
|
|
uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
|
|
|
getDictionaries({ token: subRes.data.token }).then(res => {
|
|
|
if (that.$util.isEmpty(res)) {
|
|
|
+ uni.showToast({title:'getDictionaries get empty', duration: 3000, icon:'none'})
|
|
|
return false
|
|
|
}
|
|
|
that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
|
|
|
@@ -251,13 +253,11 @@ export default {
|
|
|
},
|
|
|
fail(res){
|
|
|
console.log(res)
|
|
|
+ uni.showToast({title:'univerify fail: ' + JSON.stringify(res), duration: 3000, icon:'none'})
|
|
|
// 登录失败
|
|
|
//关闭一键登录弹出窗口
|
|
|
uni.closeAuthView()
|
|
|
//uni.hideLoading()
|
|
|
- setTimeout(function(){
|
|
|
- //uni.showToast({ title: '登录失败,请打开流量,关闭wifi,再登录', duration: 3000, icon:'none' })
|
|
|
- },1000)
|
|
|
},
|
|
|
complete: (res) => {
|
|
|
console.log(res)
|
|
|
@@ -268,12 +268,14 @@ export default {
|
|
|
},
|
|
|
fail(res){
|
|
|
console.log(res)
|
|
|
+
|
|
|
// 预登录失败
|
|
|
- //如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭
|
|
|
- //都有可能造成预登录校验失败
|
|
|
+ //如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭,都有可能造成预登录校验失败
|
|
|
if (res.code == 30005) {
|
|
|
//that.$msg('登录失败,请打开流量,再登录')
|
|
|
uni.showToast({title: '登录失败,请打开流量,或安装上手机卡', duration: 3000, icon:'none'})
|
|
|
+ } else {
|
|
|
+ uni.showToast({title: 'preLogin fail: ' + JSON.stringify(res), duration: 3000, icon:'none'})
|
|
|
}
|
|
|
}
|
|
|
})
|