feat: 7.2
This commit is contained in:
@@ -236,8 +236,8 @@ export const useAppStore = defineStore("app", () => {
|
||||
return Math.round((done / keys.length) * 100);
|
||||
});
|
||||
|
||||
/** 手機門號登入;後端未完成時走模擬資料,完成後設 VITE_USE_MOCK=false 改打真實 API */
|
||||
async function login(phone: string) {
|
||||
/** 手機門號登入;密碼欄位將由登入頁在第 7.3 項補上。 */
|
||||
async function login(phone: string, password = "") {
|
||||
if (USE_MOCK) {
|
||||
isLoggedIn.value = true;
|
||||
userID.value = "MOCK-USER";
|
||||
@@ -245,7 +245,11 @@ export const useAppStore = defineStore("app", () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const response = await apiLogin(phone);
|
||||
if (!password) {
|
||||
throw new Error("請輸入登入密碼");
|
||||
}
|
||||
|
||||
const response = await apiLogin({ phone, password });
|
||||
|
||||
isLoggedIn.value = true;
|
||||
userID.value = response.userID;
|
||||
|
||||
Reference in New Issue
Block a user