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.
|
|
|
// app.js
|
|
|
|
import {
|
|
|
|
host,
|
|
|
|
cdn,
|
|
|
|
upload
|
|
|
|
} from "./utils/config"
|
|
|
|
import {
|
|
|
|
http
|
|
|
|
} from './utils/util'
|
|
|
|
App({
|
|
|
|
onLaunch() {
|
|
|
|
// 展示本地存储能力
|
|
|
|
const logs = wx.getStorageSync('logs') || []
|
|
|
|
logs.unshift(Date.now())
|
|
|
|
wx.setStorageSync('logs', logs)
|
|
|
|
|
|
|
|
// 登录
|
|
|
|
// 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
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
},
|
|
|
|
globalData: {
|
|
|
|
userInfo: null,
|
|
|
|
host,
|
|
|
|
cdn,
|
|
|
|
upload
|
|
|
|
}
|
|
|
|
})
|