ll
liukangdong
2025-01-03 e59c3451f495c0f203a129ee927545a11d8b89c4
h5/pages/login/login.vue
@@ -43,31 +43,31 @@
         return {
            code: ''
         }
      },
      onLoad(option) {
         console.log('onLoad');
         if(option.ywid){
            uni.setStorageSync('ywinfo', {
               type: option.type,
               yw: option.yw,
               ywid: option.ywid
            })
         }
      },
      onLoad(option) {
         console.log('onLoad');
         if (option.ywid) {
            uni.setStorageSync('ywinfo', {
               type: option.type,
               yw: option.yw,
               ywid: option.ywid
            })
         }
      },
      onShow() {
         var that = this
         let url = 'https://atwl.ahzyssl.com/zhyq_h5/#/'
         let code = ''
         if (window.location.href.indexOf('code=') !== -1 || this.code) {
            // if(window.location.href.indexOf('wdata') !== -1){
            //    uni.redirectTo({
            //       url: '/pages/wdata/home?code=' +
            //    })
         if (window.location.href.indexOf('code=') !== -1 || this.code) {
            // if(window.location.href.indexOf('wdata') !== -1){
            //    uni.redirectTo({
            //       url: '/pages/wdata/home?code=' +
            //    })
            // }
            const ywinfo = uni.getStorageSync('ywinfo') || {}
             if(ywinfo.ywid && (ywinfo.type || ywinfo.type == 0)){
                this.userAuth(ywinfo.type)
             }
            const ywinfo = uni.getStorageSync('ywinfo') || {}
            if (ywinfo.ywid && (ywinfo.type || ywinfo.type == 0)) {
               this.userAuth(ywinfo.type)
            }
         } else {
            // let url = window.location.href
            const appID = 'wx173e6caf5abc718a'
@@ -132,24 +132,28 @@
                        that.$store.commit('setMember', res.data.member)
                     }
                     let flag = res.data.member && res.data.member.id
                     if (source == 0) {
                        if (res.data.token) {
                           that.$store.commit('setToken', res.data.token)
                           getUserInfo().then(ress => {
                              that.$store.commit('setDriverInfo', ress.data)
                           })
                     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')
                        setTimeout(() => {
                           that.driverLogin(flag)
                        }, 200)
                     } else if (source == 2) {
                        if (res.data.token) {
                           that.$store.commit('setToken', res.data.token)
                           getUserInfo().then(ress => {
                              that.$store.commit('setUserInfo', ress.data)
                           })
                        }
                        setTimeout(() => {
                           that.staffLogin(flag)
                        }, 200)
                     } else {
                        this.jump('/pages/index/index')
                     }
                  }
               })