Commit 997abd2b by liimin

调整登录逻辑

1 parent 7f977be9
...@@ -274,22 +274,22 @@ export default { ...@@ -274,22 +274,22 @@ export default {
//如果是多商户,需要重新登录 并获取菜单信息 //如果是多商户,需要重新登录 并获取菜单信息
let merchant = this.chooseMerchant let merchant = this.chooseMerchant
if (this.isHasMutilMerchants) { if (this.isHasMutilMerchants) {
merchant = await this.reLoginAfterChooseMerchantSucc() merchant = await this.reLoginAfterChooseMerchantSuccess(merchant.merchantId)
} }
this._permission(merchant) this._permission(merchant)
}, },
/** /**
* 选择商户成功后重新登录 * 选择商户成功后重新登录
*/ */
async reLoginAfterChooseMerchantSucc() { async reLoginAfterChooseMerchantSuccess(merchantId) {
const { response, loginSource } = this.$config const { response, loginSource } = this.$config
const { userName: loginAccount, loginToken } = this.loginForm const { userName: loginAccount, loginToken } = this.loginForm
const { code, message, data: merchant } = await api.app.choose({ merchantId: this.chooseMerchant.merchantId, loginAccount, loginToken, loginSource }) const { code, message, data: merchant } = await api.app.choose({ merchantId, loginAccount, loginToken, loginSource })
if (code !== response.code_success_value) { if (code === response.code_success_value) {
this.error(message) return merchant
return null
} }
return merchant this.error(message)
return null
}, },
storeConfig() { storeConfig() {
utils.storage.setSession(constants.SCRM_BASE_CONFIG, this.$config) utils.storage.setSession(constants.SCRM_BASE_CONFIG, this.$config)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!