zhangxiaoxu123456
2021-12-20 301289e539c417995f95f5cb91fd1f6043bb7cfd
pages/login/login.vue
@@ -70,7 +70,6 @@
            this.showPassword = !this.showPassword
         },
         appLoginWx(ref) {
            // this.$u.toast('Hello uView!');
            this.$refs.valiFormData.validate(valid => {
               if(valid) {
                  console.log(' this.valiFormData.loginName----',this)
@@ -83,85 +82,8 @@
                           });
                        }
                  })
                  // uni.request({
                  //    header: {
                  //        'content-type': 'application/x-www-form-urlencoded' //自定义请求头信息
                  //    },
                  //    // url: 'http://39.96.92.240:8099/user/login',
                  //    url: 'https://hesuancj.cn:8889/user/login',
                  //    method: 'post',
                  //    data: {
                  //        loginName: this.valiFormData.loginName,
                  //       password:this.valiFormData.password,
                  //       openid:this.valiFormData.openid
                  //    },
                  // }).then(data => {
                  //    var [error, res ] = data;
                  //    console.log(res,'............')
                  //    console.log(' this----',this.valiFormData)
                  //    this.$u.toast(res.data.message);
                  //    if(res.data.success) {
                  //       this.setStore("userInfo",res.data.obj)
                  //       uni.switchTab({
                  //           url: '/pages/learn/learn'
                  //       });
                  //    }
                     // this.$refs.uToast.show({
                     //    title: res.message,
                     //    type: res.success,
                     //    url: '/pages/learn/learn'
                     // })
                  // })
               }
            })
            // uni.getProvider({
            //    service: 'oauth',
            //    success: function(res) {
            //       if (~res.provider.indexOf('weixin')) {
            //          uni.login({
            //             provider: 'weixin',
            //             success: (res2) => {
            //                uni.getUserInfo({
            //                   provider: 'weixin',
            //                   success: (info) => { //这里请求接口
            //                      console.log(res2);
            //                      console.log(info);
            //                      uni.request({
            //                              url: 'http://39.96.92.240:8099/wx/login'
            //                          })
            //                          .then(data => {//data为一个数组,数组第一项为错误信息,第二项为返回数据
            //                              var [error, res]  = data;
            //                              console.log(res.data);
            //                          })
            //                   },
            //                   fail: () => {
            //                      uni.showToast({
            //                         title: "微信登录授权失败",
            //                         icon: "none"
            //                      });
            //                   }
            //                })
            //             },
            //             fail: () => {
            //                uni.showToast({
            //                   title: "微信登录授权失败",
            //                   icon: "none"
            //                });
            //             }
            //          })
            //       } else {
            //          uni.showToast({
            //             title: '请先安装微信或升级版本',
            //             icon: "none"
            //          });
            //       }
            //    }
            // });
         }
      }
   }