diff --git a/frontend/src/api/login.ts b/frontend/src/api/login.ts new file mode 100644 index 0000000..efe894e --- /dev/null +++ b/frontend/src/api/login.ts @@ -0,0 +1,19 @@ +import { request } from '@/utils/request' +export const AuthApi = { + login: (credentials: { username: string; password: string }) => { + const entryCredentials = { + username: LicenseGenerator.sqlbotEncrypt(credentials.username), + password: LicenseGenerator.sqlbotEncrypt(credentials.password), + } + return request.post<{ + data: any + token: string + }>('/login/access-token', entryCredentials, { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + }) + }, + logout: () => request.post('/auth/logout'), + info: () => request.get('/user/info'), +}