finai/miniapp/app.js

18 lines
499 B
JavaScript

App({
onLaunch() {
const token = wx.getStorageSync('token')
const user = wx.getStorageSync('user')
if (token) {
this.globalData.token = token
this.globalData.user = user || null
}
},
globalData: {
// 后端 API 基址:开发环境需要在开发者工具「详情 - 本地设置」中勾选
// 「不校验合法域名、web-view (业务域名)、TLS 版本以及 HTTPS 证书」
apiBase: 'http://localhost:8000',
token: '',
user: null
}
})