chore: initialize GSREA website project
This commit is contained in:
commit
d3c5461de5
1842 files changed
+246140
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import request from '@/utils/http'
|
||||
import type { AdminCaptcha, AdminLoginResult } from '@/types/admin'
|
||||
|
||||
export interface LoginBody {
|
||||
username: string
|
||||
password: string
|
||||
captchaId: string
|
||||
captchaCode: string
|
||||
}
|
||||
|
||||
export function fetchCaptcha() {
|
||||
return request.get<AdminCaptcha>({
|
||||
url: '/api/admin/auth/captcha'
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchLogin(data: LoginBody) {
|
||||
return request.post<AdminLoginResult>({
|
||||
url: '/api/admin/auth/login',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchChangePassword(data: { oldPassword: string; newPassword: string }) {
|
||||
return request.post<{ ok?: boolean }>({
|
||||
url: '/api/admin/auth/password',
|
||||
data
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user