12345678910111213141516171819202122232425262728293031 |
- const APP = getApp();
- Page({
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.login();
- },
- /**
- * 登录
- */
- login() {
- wx.login({
- success: res => {
- const params = {
- code: res.code
- }
- //登录
- APP.Post(APP.Url.login, params).then(res => {
- APP.globalData.openId = res.data.userId;
- APP.globalData.openNum = res.data.openNum;
- wx.switchTab({
- url: '/pages/index/index',
- })
- })
- }
- })
- }
- })
|