Commit cfa4a516 authored by 毛线's avatar 毛线

退出游戏逻辑

parent 5dd339c6
......@@ -144,12 +144,17 @@ export default {
network() {
return {
quitAccount: () => {
const { redirectUrl } = this.$route.query
console.log('退出登录接口')
this.$request({
url: '/api/player/logout',
method: 'post',
}).then(() => {
if (redirectUrl) {
redirectBDUrl(this.$route.query.redirectUrl)
} else {
this.$router.replace({ path: '/login' })
}
})
},
}
......
......@@ -35,10 +35,13 @@ export default {
params,
}).then(({ data }) => {
console.log('登录成功')
const { deviceId, imToken, redirectUrl, token } = data
const { imToken, redirectUrl, token } = data
const query = {
redirectUrl,
}
setUserData({ token, openImToken: imToken })
this.SetImToken(imToken)
this.$router.replace({ path: '/loading', })
this.$router.replace({ path: '/loading', query, })
})
},
}
......
......@@ -136,7 +136,10 @@ export default {
}
this.$router.replace({ path: `/game`, query })
} else {
this.$router.replace('/device')
const query = {
redirectUrl,
}
this.$router.replace({ path: `/device`, query })
}
}).catch(() => {
this.$router.replace('/login')
......
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