feat: 前端认证
This commit is contained in:
17
web/src/api/auth.ts
Normal file
17
web/src/api/auth.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import apiClient from './index';
|
||||
|
||||
export interface LoginRequest {
|
||||
auth_key: string;
|
||||
}
|
||||
|
||||
export interface LoginResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export const login = async (authKey: string): Promise<LoginResponse> => {
|
||||
const response = await apiClient.post<LoginResponse>('/auth/login', {
|
||||
auth_key: authKey
|
||||
});
|
||||
return response.data;
|
||||
};
|
Reference in New Issue
Block a user