36 lines
712 B
JavaScript

import { httpRequest, cloud } from './utils/httpRequest';
import { storageUid } from './utils/utils'
import { getUserInfo, getSystemInfoSync } from './utils/obtainInfo'
App({
cloud,
httpRequest,
globalData: {
userInfo: {},
systemInfo: {}
},
onLaunch(options) {
// 第一次打开
// options.query == {number:1}
console.info('App onLaunch');
},
onShow(options) {
// 从后台被 scheme 重新打开
// options.query == {number:1}
this.testLogin();
},
async testLogin() {
const paramenter = {
path: '/reg',
method: 'POST',
}
const res = await httpRequest(paramenter)
if (res.status == 1) {
storageUid(res.data.uid);
getUserInfo();
getSystemInfoSync();
}
},
});