chore: remove legacy token aliases and login optional chaining
This commit is contained in:
+1
-24
@@ -44,11 +44,6 @@
|
||||
--glass-line: rgba(255, 255, 255, 0.55);
|
||||
--shadow-card: 0 8rpx 24rpx rgba(46, 38, 34, 0.08);
|
||||
--shadow-elevated: 0 12rpx 40rpx rgba(46, 38, 34, 0.12);
|
||||
--line-card: 1rpx solid var(--border);
|
||||
--line-star: var(--border);
|
||||
--accent-pink: var(--accent-primary);
|
||||
--accent-blue: var(--accent-secondary);
|
||||
--btn-gradient: var(--accent-primary);
|
||||
}
|
||||
|
||||
.theme-dark {
|
||||
@@ -76,11 +71,6 @@
|
||||
--glass-line: rgba(255, 255, 255, 0.14);
|
||||
--shadow-card: 0 8rpx 24rpx rgba(0, 0, 0, 0.32);
|
||||
--shadow-elevated: 0 12rpx 40rpx rgba(0, 0, 0, 0.48);
|
||||
--line-card: 1rpx solid var(--border);
|
||||
--line-star: var(--border);
|
||||
--accent-pink: var(--accent-primary);
|
||||
--accent-blue: var(--accent-secondary);
|
||||
--btn-gradient: var(--accent-primary);
|
||||
}
|
||||
|
||||
/* page 基础字体 */
|
||||
@@ -99,11 +89,6 @@ page {
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
/* 为兼容旧页面中的卡片类名,保留过渡别名 */
|
||||
.dashed-card {
|
||||
@extend .surface-card;
|
||||
}
|
||||
|
||||
/* === 常用工具类 === */
|
||||
.container { padding: 24px; }
|
||||
|
||||
@@ -144,14 +129,6 @@ page {
|
||||
border-radius: 999rpx;
|
||||
}
|
||||
|
||||
.btn-gradient {
|
||||
@extend .btn-primary;
|
||||
}
|
||||
|
||||
.btn-outline {
|
||||
@extend .btn-secondary;
|
||||
}
|
||||
|
||||
/* 固定底部操作栏 */
|
||||
.action-bar {
|
||||
position: fixed;
|
||||
@@ -279,7 +256,7 @@ page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--bg-card);
|
||||
border-top: var(--line-card);
|
||||
border-top: 1rpx solid var(--border);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,14 +51,14 @@ export default function LoginModal({ visible, onClose, onLogin }: { visible: boo
|
||||
console.log('[LoginModal] wx.login 成功,code=', wxLogin.code)
|
||||
const result = await login(wxLogin.code)
|
||||
console.log('[LoginModal] 后端 /auth/login 返回:', JSON.stringify(result))
|
||||
if (!result?.accessToken) {
|
||||
if (!(result && result.accessToken)) {
|
||||
fail('登录失败,未拿到 token')
|
||||
return
|
||||
}
|
||||
let openid = ''
|
||||
try {
|
||||
const me = await getMe()
|
||||
openid = me?.openid || ''
|
||||
openid = me && me.openid ? me.openid : ''
|
||||
console.log('[LoginModal] getMe 返回:', JSON.stringify(me))
|
||||
} catch {
|
||||
openid = ''
|
||||
@@ -70,7 +70,7 @@ export default function LoginModal({ visible, onClose, onLogin }: { visible: boo
|
||||
finish(result.accessToken, openid)
|
||||
} catch (e) {
|
||||
console.error('[LoginModal] 登录流程出错:', e)
|
||||
fail((e as Error)?.message || '后端连接失败,请检查网络')
|
||||
fail((e as Error) && (e as Error).message ? (e as Error).message : '后端连接失败,请检查网络')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
.status-tabs {
|
||||
margin: 20px 0;
|
||||
background: var(--bg-card);
|
||||
border: var(--line-card);
|
||||
border: 1rpx solid var(--border);
|
||||
border-radius: 16px;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
height: 60px;
|
||||
border-radius: 12px;
|
||||
background: var(--bg-input);
|
||||
border: var(--line-card);
|
||||
border: 1rpx solid var(--border);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
/* 5状态快捷入口 - 2+3布局 */
|
||||
.status-grid {
|
||||
background: var(--bg-card);
|
||||
border: var(--line-card);
|
||||
border: 1rpx solid var(--border);
|
||||
border-radius: 20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user