12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- App({
- onLaunch() {
-
- const logs = wx.getStorageSync('logs') || []
- logs.unshift(Date.now())
- wx.setStorageSync('logs', logs)
-
- wx.login({
- success: res => {
- const { code: js_code } = res
-
- wx.request({
- url: `${this.globalData.publicUrl}/api/st/system/weixin/appAuth?js_code=` + js_code,
- method: "get",
- header: {
- 'x-tenant': this.globalData.tenant
- },
- success: res => {
- const { errcode, data } = res.data
- if (errcode === 0) {
- this.globalData.wxInfo = data;
- wx.setStorage({ key: "userInfo", data: null })
- }
- },
- error: err => {
- wx.showToast({
- title: err.msg,
- icon: 'error'
- })
- }
- })
- }
- })
-
- wx.getSystemInfo({
- success: (res) => {
- this.globalData.height = res.statusBarHeight
- this.globalData.windowHeight = res.windowHeight
- }
- })
- },
- globalData: {
-
- userInfo: {},
-
- wxInfo: {},
-
- height: 0,
-
- windowHeight: 0,
-
- publicUrl: 'http://192.168.1.19:9901',
-
- fileUrl: "http://broadcast.waityou24.cn",
-
- tenant: "test"
- }
- })
|