forked from 77media/video-flow
修复注册问题
This commit is contained in:
parent
4bd097691c
commit
e2d16d0f10
@ -26,7 +26,9 @@ export const loginUser = async (email: string, password: string) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
console.log('data', data)
|
if(!data.success){
|
||||||
|
throw new Error(data.message)
|
||||||
|
}
|
||||||
// 保存token到本地存储
|
// 保存token到本地存储
|
||||||
setToken(data.token);
|
setToken(data.token);
|
||||||
|
|
||||||
@ -376,7 +378,10 @@ export const registerUser = async ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
console.log('data', data)
|
||||||
|
if(!data.success){
|
||||||
|
throw new Error(data.message)
|
||||||
|
}
|
||||||
return data as {
|
return data as {
|
||||||
success: boolean;
|
success: boolean;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user