Commit 396df4f2 authored by peco's avatar peco

fix : 登录判断返回状态

parent 553e7aed
...@@ -85,21 +85,24 @@ export default { ...@@ -85,21 +85,24 @@ export default {
} }
} }
let res = await info.url let res = await info.url
this.$u.vuex('vuex_token', `${res.token_type} ${res.access_token}`) const { Status, Result } = res.data
this.$u.toast(info.msg) if (Status === 'true') {
this.$u.vuex('vuex_token', `${res.token_type} ${res.access_token}`)
this.removeUserStorage() this.$u.toast(info.msg)
this.saveUserStorage(res.data.Result) this.removeUserStorage()
this.saveUserStorage(res.data.Result)
// 登录成功后返回来源页面 // 登录成功后返回来源页面
let timer = setTimeout(() => { let timer = setTimeout(() => {
const backUrl = uni.getStorageSync('back_url') || '/pages/index/index' const backUrl = uni.getStorageSync('back_url') || '/pages/index/index'
this.$u.route({ this.$u.route({
type: 'reLaunch', type: 'reLaunch',
url: backUrl url: backUrl
}) })
clearTimeout(timer) clearTimeout(timer)
}, 500) }, 500)
} else {
this.$u.toast(res.data.Msg)
}
} else { } else {
console.log('验证失败'); console.log('验证失败');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment