feat: 样式修改

This commit is contained in:
Blizzard
2026-02-10 17:22:53 +08:00
parent 6f88bc656b
commit e97fd30fa3
28 changed files with 2097 additions and 903 deletions
+14 -4
View File
@@ -8,13 +8,23 @@ App({
// Send res.code to backend to swap for openId, sessionKey, unionId
if (res.code) {
request.get('/auth/miniLogin', { code: res.code }).then(data => {
// Assuming the token is in data.token or data itself
const token = data.token || data;
// Response structure based on user input: { user: {...}, token: "...", expiresAt: ... }
// Note: request.js might return data.user directly if it unwraps 'data'
// But looking at previous request.js usage, it seems to return the 'data' field of the response.
// Let's handle both cases safely.
const token = data.token;
const user = data.user;
if (token && typeof token === 'string') {
wx.setStorageSync('token', token);
console.log('Login successful, token stored');
if (user) {
wx.setStorageSync('userInfo', user);
this.globalData.userInfo = user;
}
console.log('Login successful, user info stored');
} else {
console.warn('Login response did not contain a valid token string', data);
console.warn('Login response did not contain a valid token', data);
}
}).catch(err => {
console.error('Login failed', err);