1234567891011121314151617181920212223242526272829303132 |
- //app.js
- import utils from './utils/util.js'
- import constant from './constant'
-
- App({
- onLaunch: function () {
- // 登录
- wx.login({
- success: res => {
- const { appid, secret, baseURL } = this.globalData;
- utils.$httpServer({
- url: '/wechat/mini/login?code='+res.code,
- method: 'POST'
- }).then(data => {
- this.globalData.appConfig = data.result
- }).catch(error => {
- wx.showToast({
- title: '签到失败',
- duration: 1000,
- mask: true
- })
- })
- }
- })
- },
- globalData: {
- userInfo: null,
- appConfig: null,
- fieldId: '',
- ...constant
- }
- })
|