123456789101112131415161718192021222324252627282930313233343536 |
- App({
- onLaunch() {
-
- const logs = wx.getStorageSync('logs') || []
- logs.unshift(Date.now())
- wx.setStorageSync('logs', logs)
-
- wx.login({
- success: res => {
-
- console.log(res)
- wx.request( {
- url: this.globalData.url + "/v1/user/open.id/set",
- header: {
- "Content-Type": "application/json"
- },
- method: "POST",
- data: { code: res.code },
- complete: function( res ) {
- if (res.data.code == 200){
- wx.setStorageSync('openId', res.data.data.openid)
- }
-
- }
- })
- }
- })
- },
- globalData: {
- userInfo: null,
-
- url:"http://www.tao1024.com:8081"
- }
- })
|