ll
liukangdong
2024-12-31 423155b8134694c2f2e68f6d3f5239ba0541b0cf
h5/pages/login/login.vue
@@ -45,6 +45,7 @@
         }
      },
      onLoad(option) {
         console.log('onLoad');
         if(option.ywid){
            uni.setStorageSync('ywinfo', {
               type: option.type,
@@ -57,9 +58,14 @@
         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('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){
             if(ywinfo.ywid && (ywinfo.type || ywinfo.type == 0)){
                this.userAuth(ywinfo.type)
             }
         } else {
@@ -126,27 +132,25 @@
                        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')
                     }
                  }
               })
            }