perf: Login api entrypt password

This commit is contained in:
fit2cloud-chenyw
2025-07-29 16:09:57 +08:00
parent a3e3647433
commit b116e37299
9 changed files with 30 additions and 17 deletions
+9 -5
View File
@@ -1,15 +1,19 @@
import { request } from '@/utils/request'
export const AuthApi = {
login: (credentials: { username: string; password: string }) =>
request.post<{
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', credentials, {
}>('/login/access-token', entryCredentials, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
}),
})
},
logout: () => request.post('/auth/logout'),
info: () => request.get('/user/info'),
}