:pref: 首屏优化

This commit is contained in:
zdl
2025-11-26 11:30:12 +08:00
parent 105a0b02ea
commit 7a2c73f3ca
6 changed files with 42 additions and 223 deletions

View File

@@ -12,7 +12,8 @@ import {
} from '../data/users';
// 模拟网络延迟(毫秒)
const NETWORK_DELAY = 500;
// ⚡ 开发环境使用较短延迟,加快首屏加载速度
const NETWORK_DELAY = 50;
export const authHandlers = [
// ==================== 手机验证码登录 ====================
@@ -356,7 +357,7 @@ export const authHandlers = [
// 7. 检查 SessionAuthContext 使用的正确端点)
http.get('/api/auth/session', async () => {
await delay(300);
await delay(NETWORK_DELAY); // ⚡ 使用统一延迟配置
// 获取当前登录用户
const currentUser = getCurrentUser();
@@ -380,7 +381,7 @@ export const authHandlers = [
// 8. 检查 Session旧端点保留兼容
http.get('/api/auth/check-session', async () => {
await delay(300);
await delay(NETWORK_DELAY); // ⚡ 使用统一延迟配置
// 获取当前登录用户
const currentUser = getCurrentUser();