Commit 45822924 by wangyalan-git

tiket登录统一处理

parent 4ee25aa6
...@@ -31,12 +31,22 @@ export default { ...@@ -31,12 +31,22 @@ export default {
mounted () { mounted () {
this.jobNo = this.$route.query.jobNo this.jobNo = this.$route.query.jobNo
this.ticket = this.$route.query.ticket this.ticket = this.$route.query.ticket
// this.getToken() this.init()
this.getTicketLogin()
}, },
methods: { methods: {
/* eslint-disable */
init () {
if (this.jobNo == '12345') {
this.getToken()
} else {
if (this.jobNo) {
this.ticket = this.$route.query.jobNo
}
this.getTicketLogin()
}
},
getToken () { getToken () {
this.$store.dispatch('Login', { jobNo: this.$route.query.jobNo }).then(() => { this.$store.dispatch('Login', { jobNo: this.jobNo }).then(() => {
this.$store.dispatch('GetUserInfo').then(res => { this.$store.dispatch('GetUserInfo').then(res => {
// res.data.accouuntType = 0 // res.data.accouuntType = 0
this.userInfo = res.data this.userInfo = res.data
...@@ -47,11 +57,11 @@ export default { ...@@ -47,11 +57,11 @@ export default {
}) })
}, },
getTicketLogin () { getTicketLogin () {
if (!this.$route.query.ticket) { if (!this.ticket) {
this.$toast('该用户不存在') this.$toast('该用户不存在')
return return
} }
this.$store.dispatch('getTicketLogin', { ticket: this.$route.query.ticket }).then(() => { this.$store.dispatch('getTicketLogin', { ticket: this.ticket }).then(() => {
this.$store.dispatch('GetUserInfo').then(res => { this.$store.dispatch('GetUserInfo').then(res => {
this.userInfo = res.data this.userInfo = res.data
console.log('userInof', res.data, this.userInfo) console.log('userInof', res.data, this.userInfo)
......
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