You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.1 KiB

3 years ago
// app.js
3 years ago
import {
host,
cdn,
upload
} from "./utils/config"
import {
http
} from './utils/util'
3 years ago
App({
onLaunch() {
// 展示本地存储能力
const logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
3 years ago
// wx.login({
// success: res => {
// http("/user/login", "post", {
// code: res.code
// }).then(res => {
// if (res.msg === "未注册!") {
// // this.getUserProfile()
// wx.showToast({
// title: '您尚未注册,请点击个人头像位置以注册登录',
// icon: 'none',
// duration: 2000
// })
// } else {
// getApp().globalData.token = res.data.token
// wx.setStorage({
// key: 'user',
// data: res.data.user
// })
// wx.setStorage({
// key: 'token',
// data: res.data.token
// })
// }
// })
// }
// })
3 years ago
},
globalData: {
3 years ago
userInfo: null,
3 years ago
host,
3 years ago
cdn,
upload
3 years ago
}
3 years ago
})