改用一般 Router 並支援 LINE 無綁定自動建帳號
根本原因: 1. Hash router 網址帶 /#/ 不美觀且與一般網站行為不一致。 2. register.line_login 收到 status 12(LINE 帳號無綁定)時直接中止, 新 token 無法登入。 影響: 網址改為一般路徑(自動偵測部署子路徑,不需放網站根目錄);靜態主機在 /lobby 重新整理由殘根導回入口頁。無綁定帳號時自動 account.create 取得 [id, pw] 後直接 account.login,登入面板顯示建立進度。 修法: - index.tsx:createHashRouter 改 createBrowserRouter,getBasename() 依 location.pathname 推導子路徑並去除已知路由字尾 - build-templates/lobby/index.html:靜態主機 SPA 殘根,重整時導回 ../ - Login.tsx:status 12 時走 createAccountAndLogin()(account.create 回傳 格式為 [id, pw] 陣列) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-Hant">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<!-- 靜態主機沒有 SPA rewrite:在 /lobby 重新整理時由此殘根導回應用程式入口(重整後本就需重新登入) -->
|
||||
<script>location.replace("../");</script>
|
||||
</head>
|
||||
|
||||
<body></body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user