|
@@ -60,23 +60,19 @@ export default {
|
|
|
that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
|
|
that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
|
|
|
})
|
|
})
|
|
|
that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
|
|
that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
|
|
|
-
|
|
|
|
|
getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
|
|
getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
|
|
|
-
|
|
|
|
|
that.setUserShopAll()
|
|
that.setUserShopAll()
|
|
|
- that.init()
|
|
|
|
|
-
|
|
|
|
|
// #ifdef APP-PLUS
|
|
// #ifdef APP-PLUS
|
|
|
//保存安卓的clientId
|
|
//保存安卓的clientId
|
|
|
let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
|
|
let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
|
|
|
const clientInfo = plus.push.getClientInfo()
|
|
const clientInfo = plus.push.getClientInfo()
|
|
|
let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
|
|
let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
|
|
|
if(hasClientId == '' || hasClientId != currentClientId){
|
|
if(hasClientId == '' || hasClientId != currentClientId){
|
|
|
- replaceClientId({id:currentClientId}).then(res=>{ })
|
|
|
|
|
|
|
+ replaceClientId({id:currentClientId})
|
|
|
}
|
|
}
|
|
|
// #endif
|
|
// #endif
|
|
|
|
|
+ uni.navigateBack()
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
fail(res){
|
|
fail(res){
|
|
@@ -93,8 +89,8 @@ export default {
|
|
|
},
|
|
},
|
|
|
fail(res){
|
|
fail(res){
|
|
|
// 预登录失败
|
|
// 预登录失败
|
|
|
- //如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭,
|
|
|
|
|
- //都有可能造成预登录校验失败。
|
|
|
|
|
|
|
+ //如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭
|
|
|
|
|
+ //都有可能造成预登录校验失败
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
@@ -103,9 +99,8 @@ export default {
|
|
|
uni.showLoading({mask:true})
|
|
uni.showLoading({mask:true})
|
|
|
//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
|
|
//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
|
|
|
appLogin({mobile,password}).then(subRes=>{
|
|
appLogin({mobile,password}).then(subRes=>{
|
|
|
-
|
|
|
|
|
|
|
+ uni.hideLoading()
|
|
|
if(subRes.code == 1){
|
|
if(subRes.code == 1){
|
|
|
-
|
|
|
|
|
if (that.$util.isEmpty(subRes)) {
|
|
if (that.$util.isEmpty(subRes)) {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
@@ -119,21 +114,18 @@ export default {
|
|
|
that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
|
|
that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
|
|
|
})
|
|
})
|
|
|
that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
|
|
that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
|
|
|
-
|
|
|
|
|
getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
|
|
getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
|
|
|
-
|
|
|
|
|
that.setUserShopAll()
|
|
that.setUserShopAll()
|
|
|
- that.init()
|
|
|
|
|
- uni.hideLoading()
|
|
|
|
|
// #ifdef APP-PLUS
|
|
// #ifdef APP-PLUS
|
|
|
//保存安卓的clientId
|
|
//保存安卓的clientId
|
|
|
let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
|
|
let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
|
|
|
const clientInfo = plus.push.getClientInfo()
|
|
const clientInfo = plus.push.getClientInfo()
|
|
|
let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
|
|
let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
|
|
|
if(hasClientId == '' || hasClientId != currentClientId){
|
|
if(hasClientId == '' || hasClientId != currentClientId){
|
|
|
- replaceClientId({id:currentClientId}).then(res=>{ })
|
|
|
|
|
|
|
+ replaceClientId({id:currentClientId})
|
|
|
}
|
|
}
|
|
|
// #endif
|
|
// #endif
|
|
|
|
|
+ uni.navigateBack()
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|