| | |
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | code: ''
|
| | | code: 'qwe'
|
| | | }
|
| | | }, |
| | | onLoad(option) { |
| | |
| | | let code = ''
|
| | | if (window.location.href.indexOf('code=') !== -1 || this.code) {
|
| | | const ywinfo = uni.getStorageSync('ywinfo') || {} |
| | | if(ywinfo.ywid){ |
| | | if(ywinfo.ywid && (ywinfo.type || ywinfo.type == 0)){ |
| | | this.userAuth(ywinfo.type) |
| | | }
|
| | | } else {
|
| | |
| | | that.$store.commit('setMember', res.data.member)
|
| | | }
|
| | | let flag = res.data.member && res.data.member.id
|
| | | setTimeout(() => {
|
| | | if (source == 0) {
|
| | | if (res.data.token) {
|
| | | that.$store.commit('setToken', res.data.token)
|
| | | getUserInfo().then(ress => {
|
| | | that.$store.commit('setDriverInfo', ress.data)
|
| | | })
|
| | | }
|
| | | this.driverLogin(flag)
|
| | | } else if (source == 2) {
|
| | | if (res.data.token) {
|
| | | that.$store.commit('setToken', res.data.token)
|
| | | getUserInfo().then(ress => {
|
| | | that.$store.commit('setUserInfo', ress.data)
|
| | | })
|
| | | }
|
| | | this.staffLogin(flag)
|
| | | } else {
|
| | | this.jump('/pages/index/index')
|
| | | }
|
| | | }, 300)
|
| | | if (source == 0) { |
| | | if (res.data.token) { |
| | | that.$store.commit('setToken', res.data.token) |
| | | getUserInfo().then(ress => { |
| | | that.$store.commit('setDriverInfo', ress.data) |
| | | }) |
| | | } |
| | | this.driverLogin(flag) |
| | | } else if (source == 2) { |
| | | if (res.data.token) { |
| | | that.$store.commit('setToken', res.data.token) |
| | | getUserInfo().then(ress => { |
| | | that.$store.commit('setUserInfo', ress.data) |
| | | }) |
| | | } |
| | | this.staffLogin(flag) |
| | | } else { |
| | | this.jump('/pages/index/index') |
| | | }
|
| | | }
|
| | | })
|
| | | }
|