37 lines
1014 B
JavaScript
37 lines
1014 B
JavaScript
|
// app.js
|
|||
|
|
|||
|
|
|||
|
App({
|
|||
|
onLaunch() {
|
|||
|
// 展示本地存储能力
|
|||
|
const logs = wx.getStorageSync('logs') || []
|
|||
|
logs.unshift(Date.now())
|
|||
|
wx.setStorageSync('logs', logs)
|
|||
|
// 定义全局配置信息
|
|||
|
this.globalData = {
|
|||
|
httpsUrl: 'https://www.gdsfs.top', // 请填写有效的 URL,不包含端口号
|
|||
|
db: 'YS2025', // 请填写数据库名称
|
|||
|
username: '441785369@qq.com',
|
|||
|
password: 'Sj89061189'
|
|||
|
};
|
|||
|
const conf = wx.getStorageSync('conf') || {};
|
|||
|
conf.httpsUrl = this.globalData.httpsUrl;
|
|||
|
conf.db = this.globalData.db;
|
|||
|
conf.username = this.globalData.username;
|
|||
|
// conf.password = this.globalData.password;
|
|||
|
wx.setStorageSync('conf', conf)
|
|||
|
// 登录
|
|||
|
wx.login({
|
|||
|
success: res => {
|
|||
|
// 发送 res.code 到后台换取 openId, sessionKey, unionId
|
|||
|
}
|
|||
|
})
|
|||
|
},
|
|||
|
globalData: {
|
|||
|
userInfo: null,
|
|||
|
httpsUrl: '',
|
|||
|
db: '',
|
|||
|
username: ''
|
|||
|
}
|
|||
|
})
|
|||
|
|