Commit 6d58f127 by 陆志强

feat: 修复登录问题

parent 72058079
......@@ -53,12 +53,22 @@ export default {
mounted() {
this.initLoginCenter()
Bus.$on('showLogin', this.toggleLogin)
const { uin } = this.$route.query
const { id } = this.$route.params
this.$store.dispatch('users/getUerInfo', { uin })
setTimeout(() => {
this.$store.dispatch('users/postInfo', { id })
}, 1000)
},
destroyed() {
Bus.$off('showLogin')
},
methods: {
...mapActions({ jumpToLogin: 'users/jumpToLogin' }),
...mapActions({
jumpToLogin: 'users/jumpToLogin',
postInfo: 'users/postInfo',
getUerInfo: 'users/getUerInfo',
}),
// 云平台登录模块初始化
initLoginCenter() {
if (!window.LoginCenter) return
......
......@@ -48,12 +48,22 @@ export default {
mounted() {
this.initLoginCenter()
Bus.$on('showLogin', this.toggleLogin)
const { uin } = this.$route.query
const { id } = this.$route.params
this.$store.dispatch('users/getUerInfo', { uin })
setTimeout(() => {
this.$store.dispatch('users/postInfo', { id })
}, 1000)
},
destroyed() {
Bus.$off('showLogin')
},
methods: {
...mapActions({ jumpToLogin: 'users/jumpToLogin' }),
...mapActions({
jumpToLogin: 'users/jumpToLogin',
postInfo: 'users/postInfo',
getUerInfo: 'users/getUerInfo',
}),
// 云平台登录模块初始化
initLoginCenter() {
if (!window.LoginCenter) return
......
......@@ -8,7 +8,6 @@ import '@/plugins/gtag'
import '@/filters'
import '@/plugins/vueClipboard'
import '@/plugins/dmsService'
import '@/plugins/pvStatisticalService'
import '@/plugins/deviceId'
import '@/plugins/hlsInstance'
......
/* eslint-disable no-invalid-this */
import Cookie from 'js-cookie'
import action from '../pvStatisticalService'
export default async function({token, onFinished} = {token: ''}) {
const { uin } = this.$route.query
const { id } = this.$route.params
token && Cookie.set('token', token, { expires: 10 });
await action()
this.$store.dispatch('users/getUerInfo', { uin })
setTimeout(() => {
this.$store.dispatch('users/postInfo', { id })
}, 1000)
onFinished && onFinished()
return this
}
......@@ -123,7 +123,7 @@ export const actions = {
} else {
Toast.fail(errorMessage)
if (errorCode === 9) {
this.app.context.error({ statusCode: 404, message: 'This page could not be found' })
this.$router.push('error')
}
}
})
......
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 sign in to comment