fix(request): 接口响应字段由 data 统一为 result 并调整成功码判断

ApiResponse 业务数据字段由 data 改为 result,成功码由字符串 '00000' 改为数字 200,
登录与补充资料页面同步改为读取 res.result。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
17792275749
2026-08-20 11:19:03 +08:00
co-authored by Claude Sonnet 4.6
parent cdef8e6513
commit e5f76fc0a9
5 changed files with 24 additions and 28 deletions
+15 -19
View File
@@ -21,24 +21,20 @@ Page({
this.setData({ loading: true })
// 获取微信临时 code → 调用 OpenID 登录接口
app.getWxLoginCode()
.then((code) => checkOpenIdLogin(code))
.then((res) => {
const { token, user } = res.data
// 持久化登录凭证和用户信息
wx.setStorageSync('token', token)
if (user) {
wx.setStorageSync('userInfo', user)
wx.reLaunch({ url: '/pages/home/home' })
} else {
wx.reLaunch({ url: '/pages/supplementPersonal/supplementPersonal' })
}
})
.catch((err) => {
wx.showToast({ title: err.msg || '登录失败,请重试', icon: 'none' })
})
.finally(() => {
this.setData({ loading: false })
})
app.getWxLoginCode().then((code) => checkOpenIdLogin(code)).then((res) => {
const { token, user } = res.result
// 持久化登录凭证和用户信息
wx.setStorageSync('token', token)
if (user) {
wx.setStorageSync('userInfo', user)
wx.reLaunch({ url: '/pages/home/home' })
} else {
wx.reLaunch({ url: '/pages/supplementPersonal/supplementPersonal' })
}
}).catch((err) => {
wx.showToast({ title: err.msg || '登录失败,请重试', icon: 'none' })
}).finally(() => {
this.setData({ loading: false })
})
},
})