fix(miniapp): persist session token for WeChat login

Return sessionToken from login endpoints and store it client-side because
wx.request cannot rely on Set-Cookie. Also fix multi-cookie parsing,
start on login page, and guard chat rendering fields.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-11 13:05:44 +08:00
parent 3163445a9d
commit 57a60d41d7
7 changed files with 101 additions and 16 deletions
+1
View File
@@ -16,6 +16,7 @@ function createUuid() {
const defaults = {
API_BASE_URL: LOCAL_DEV ? 'http://127.0.0.1:8081' : 'https://m.tkmind.cn',
MINIAPP_LOGIN_PATH: '/auth/wechat-miniapp/login',
SESSION_COOKIE_NAME: 'tkmind_user_session',
SELECTED_SESSION_KEY: 'tkmind_selected_session_id',
AGENT_RUN_POLL_MS: 1200,
AGENT_RUN_MAX_POLLS: 120,