From 0becab45282781f281ad5aa04202b83039ab275e Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期五, 14 四月 2023 17:42:08 +0800 Subject: [PATCH] 增加发运统计页面,修改websocket,增加消息推送 --- pages/login/login.vue | 27 ++++++++++++++------------- 1 files changed, 14 insertions(+), 13 deletions(-) diff --git a/pages/login/login.vue b/pages/login/login.vue index d87737f..c362e72 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -61,6 +61,7 @@ uni.login({ success: res => { if (res.code) { + uni.setStorageSync('code', res.code); this.apiLogin(res.code); } else { uni.showToast({ @@ -80,20 +81,20 @@ uni.showLoading({ title: '鍔犺浇涓�...' }); - wx.request({ - url: `https://api.weixin.qq.com/sns/jscode2session?appid=wx4a62fc1684c429a9&secret=ee90afe376cdcec2fdd947c0a4db961a&js_code=${code}&grant_type=authorization_code`, - success(res) { - uni.setStorageSync('openid', res.data.openid); - uni.showToast({ - title: '鎴愬姛鑾峰彇娴嬭瘯openid', - icon: 'none' - }); - } - }); + // wx.request({ + // url: `https://api.weixin.qq.com/sns/jscode2session?appid=wx4a62fc1684c429a9&secret=ee90afe376cdcec2fdd947c0a4db961a&js_code=${code}&grant_type=authorization_code`, + // success(res) { + // uni.setStorageSync('openid', res.data.openid); + // uni.showToast({ + // title: '鎴愬姛鑾峰彇娴嬭瘯openid', + // icon: 'none' + // }); + // } + // }); this.$nextTick(() => { - apiLoginWx({ code: uni.getStorageSync('openid') }).then(res => { + apiLoginWx({ code: code }).then(res => { if (res.code != 1) { - this.$u.toast('鎭枩鎮紝鐧诲綍鎴愬姛锛�'); + this.$u.toast('鐧诲綍鎴愬姛'); // 鐧婚檰鎴愬姛锛屽瓨鍌ㄧ浉鍏充俊鎭� setToken(res.access_token); setRefreshToken(res.refresh_token); @@ -119,7 +120,7 @@ }, bindWxConfirm() { uni.navigateTo({ - url: `/pages/login/wxLogin?code=${uni.getStorageSync('openid')}` + url: `/pages/login/wxLogin?code=${uni.getStorageSync('code')}` }); this.bindWxModelShow = false; }, -- Gitblit v1.9.1