mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
perf: Login api entrypt password
This commit is contained in:
@@ -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'),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user