fix(auth): 5 BUG 修复 — refresh token 持久化 + 密码验证 + 浏览器兼容
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
BUG-1 (P1): LoginPage 注册密码验证从 6 位改为 8 位,与后端一致 BUG-2 (P0): refresh token 持久化到 OS keyring + restoreSession 三级恢复 (access token → refresh token → cookie auth) + saveSaaSSession 改为 await BUG-3 (P0): Tauri 聊天路由降级问题,根因同 BUG-2(会话恢复失败) BUG-4 (P1): App.tsx 跳过 Onboarding 改用 agentStore(兼容所有 client), Workspace.tsx Tauri invoke 改为动态 import 避免浏览器崩溃 BUG-5: tauri.conf.json createUpdaterArtifacts 改为 boolean true
This commit is contained in:
@@ -404,32 +404,33 @@ function App() {
|
||||
onClose={async () => {
|
||||
// Skip onboarding but still create a default agent with default personality
|
||||
try {
|
||||
const { getGatewayClient } = await import('./lib/gateway-client');
|
||||
const client = getGatewayClient();
|
||||
if (client) {
|
||||
// Create default agent with versatile assistant personality
|
||||
const defaultAgent = await client.createClone({
|
||||
name: '全能助手',
|
||||
role: '全能型 AI 助手',
|
||||
nickname: '小龙',
|
||||
emoji: '🦞',
|
||||
personality: 'friendly',
|
||||
scenarios: ['coding', 'writing', 'research', 'product', 'data'],
|
||||
userName: 'User',
|
||||
userRole: 'user',
|
||||
communicationStyle: '亲切、耐心、善解人意,用易懂的语言解释复杂概念',
|
||||
});
|
||||
// Use agentStore (which uses the correct client from connectionStore)
|
||||
// instead of directly importing getGatewayClient
|
||||
const { useAgentStore } = await import('./store/agentStore');
|
||||
const agentStore = useAgentStore.getState();
|
||||
|
||||
if (defaultAgent?.clone) {
|
||||
setCurrentAgent({
|
||||
id: defaultAgent.clone.id,
|
||||
name: defaultAgent.clone.name,
|
||||
icon: defaultAgent.clone.emoji || '🦞',
|
||||
color: 'bg-gradient-to-br from-orange-500 to-red-500',
|
||||
lastMessage: defaultAgent.clone.role || '全能型 AI 助手',
|
||||
time: '',
|
||||
});
|
||||
}
|
||||
// Create default agent with versatile assistant personality
|
||||
const result = await agentStore.createClone({
|
||||
name: '全能助手',
|
||||
role: '全能型 AI 助手',
|
||||
nickname: '小龙',
|
||||
emoji: '🦞',
|
||||
personality: 'friendly',
|
||||
scenarios: ['coding', 'writing', 'research', 'product', 'data'],
|
||||
userName: 'User',
|
||||
userRole: 'user',
|
||||
communicationStyle: '亲切、耐心、善解人意,用易懂的语言解释复杂概念',
|
||||
});
|
||||
|
||||
if (result) {
|
||||
setCurrentAgent({
|
||||
id: result.id,
|
||||
name: result.name,
|
||||
icon: result.emoji || '🦞',
|
||||
color: 'bg-gradient-to-br from-orange-500 to-red-500',
|
||||
lastMessage: result.role || '全能型 AI 助手',
|
||||
time: '',
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
log.warn('Failed to create default agent on skip:', err);
|
||||
|
||||
Reference in New Issue
Block a user