diff --git a/pages/auth/auth.js b/pages/auth/auth.js index a537752..412522c 100644 --- a/pages/auth/auth.js +++ b/pages/auth/auth.js @@ -14,32 +14,32 @@ Page({ /** * 生命周期函数--监听页面加载 */ - // onLoad: function (options) { - // let that = this - // if (options.mode == "yunschool") { - // wx.login({ - // success(res1) { - // if (res1.code) { - // setTimeout(() => { - // that.setData({ - // url: "https://ucpay.ncut.edu.cn/open/user/oauth/index?redirect=" + Requests.baseUrl + "/auth&appid=31b1e992583074382&state=" + res1.code, - // show: 1 - // }) - // }, 2000) - // } else { - // console.log('登录失败!' + res1.errMsg) - // } - // } - // }) - // } else if (options.mode == "wechat") { - // if (Requests.token == null) { - // Requests.refreshToken(() => {}) - // } - // that.setData({ - // show: 2 - // }) - // } - // }, + onLoad: function (options) { + let that = this + if (options.mode == "yunschool") { + wx.login({ + success(res1) { + if (res1.code) { + setTimeout(() => { + that.setData({ + url: "https://ucpay.ncut.edu.cn/open/user/oauth/index?redirect=" + Requests.baseUrl + "/auth&appid=31b1e992583074382&state=" + res1.code, + show: 1 + }) + }, 2000) + } else { + console.log('登录失败!' + res1.errMsg) + } + } + }) + } else if (options.mode == "wechat") { + if (Requests.token == null) { + Requests.refreshToken(() => {}) + } + that.setData({ + show: 2 + }) + } + }, tapButton: function (e) { Requests.put({