完成顶部导航条
> 添加左侧logo
> 添加右侧用户信息展示
> 修复一些登录注册的跳转问题
> 修复axios拦截器错误的头设置
> 修复authApi错误的接口路径
> 组织api文件结构
Change-Id: Ifaec7e9a78ad6862ce7d0ce76be5181185186edd
diff --git a/src/api/Auth/AuthApi.ts b/src/api/Auth/AuthApi.ts
new file mode 100644
index 0000000..9eae3fb
--- /dev/null
+++ b/src/api/Auth/AuthApi.ts
@@ -0,0 +1,45 @@
+import axios, { type AxiosResponse } from 'axios';
+import type { RejisterRequest , ResetPasswordRequest} from './type';
+import type{ LoginRequest } from './type';
+import type { CommonResponse } from '../type';
+
+class AuthAPI {
+
+ static sendVerificationCode(email: string): Promise<AxiosResponse<CommonResponse>> {
+ return axios.post('/api/auth/sendVerification', { email });
+ }
+
+ static register(request: RejisterRequest): Promise<AxiosResponse<CommonResponse>> {
+ return axios.post('/api/auth/register', request);
+ }
+
+ static sendResetCode(email: string):Promise<AxiosResponse<CommonResponse>> {
+ return axios.post('/api/auth/sendResetCode', { email });
+ }
+
+ static resetPassword( request: ResetPasswordRequest ):Promise<AxiosResponse<CommonResponse>> {
+ return axios.post('/api/auth/resetPassword', request);
+ }
+
+
+ static refreshToken(oldToken : string): Promise<AxiosResponse<CommonResponse<string>>> {
+ return axios.post(
+ '/api/auth/refreshToken',
+ {}, // 请求体空
+ {
+ headers: {
+ token: oldToken,
+ },
+ }
+ );
+ }
+
+
+ static login(loginRequest: LoginRequest): Promise<AxiosResponse<CommonResponse<string>>> {
+ return axios.post('/api/auth/login', loginRequest);
+ }
+
+}
+
+export default AuthAPI;
+