refactor: migrate to Tencent Cloud backend

这个提交包含在:
Guoguo
2026-04-28 22:56:47 +08:00
父节点 267c75718b
当前提交 444c91c0b0
修改 102 个文件,包含 17927 行新增1997 行删除
+15 -14
查看文件
@@ -12,14 +12,6 @@ App({
onLaunch: function () {
var sysInfo = wx.getSystemInfoSync()
this.globalData.statusBarHeight = sysInfo.statusBarHeight || 44
if (!wx.cloud) {
console.error('请使用 2.2.3 或以上的基础库以使用云能力')
return
}
wx.cloud.init({
traceUser: true
})
this.checkLogin()
},
@@ -43,12 +35,21 @@ App({
},
doLogin: function () {
return http.post('/api/v1/auth/login', {}).then(function (data) {
wx.setStorageSync('token', data.token)
var app = getApp()
app.globalData.userInfo = data.user_info
app.globalData.userId = data.user_id
return data
return new Promise(function (resolve, reject) {
wx.login({
success: function (res) {
http.post('/api/v1/auth/login', { code: res.code }).then(function (data) {
wx.setStorageSync('token', data.token)
var app = getApp()
app.globalData.userInfo = data.user_info
app.globalData.userId = data.user_id
resolve(data)
}).catch(reject)
},
fail: function (err) {
reject({ code: 2002, message: err.errMsg || '微信登录失败' })
}
})
})
}
})