This commit is contained in:
Sakurasan
2025-04-17 23:09:57 +08:00
parent 20c3cda4a7
commit fca67cae40
15 changed files with 579 additions and 82 deletions

View File

@@ -20,7 +20,7 @@ export const useWebAuthStore = defineStore("webauth", () => {
try {
// 1. 从后端获取注册选项 (Creation Options)
const res = await request.get("/profile/passkey");
console.log("begin:", res.data.data.publicKey);
// console.log("begin:", res.data.data.publicKey);
const options = res.data.data.publicKey;
// 调用 Web Authentication API 进行注册
@@ -44,7 +44,7 @@ export const useWebAuthStore = defineStore("webauth", () => {
// 3. 将注册结果 (Attestation) 发送到后端进行验证和保存
const res2 = await request.post("/profile/passkey", attestation);
console.log("end:", res2);
// console.log("end:", res2);
return res2;
} catch (err) {
error.value =err.response?.data?.error || "添加 Passkey 失败,请稍后重试。";