This commit is contained in:
2025-09-08 16:36:29 +08:00
parent a3d70597f1
commit 170bb5ff1a

19
frontend/src/api/login.ts Normal file
View File

@@ -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'),
}