修复注册问题

This commit is contained in:
海龙 2025-08-29 05:29:12 +08:00
parent 4bd097691c
commit e2d16d0f10

View File

@ -26,7 +26,9 @@ export const loginUser = async (email: string, password: string) => {
});
const data = await response.json();
console.log('data', data)
if(!data.success){
throw new Error(data.message)
}
// 保存token到本地存储
setToken(data.token);
@ -376,7 +378,10 @@ export const registerUser = async ({
});
const data = await response.json();
console.log('data', data)
if(!data.success){
throw new Error(data.message)
}
return data as {
success: boolean;
};