|
|
@@ -1,5 +1,21 @@
|
|
|
import { request } from '@umijs/max';
|
|
|
|
|
|
+export async function fetchCapEndpoint(options?: { [key: string]: any }) {
|
|
|
+ return request<API.CapEndpointResult>('/capjs/endpoint', {
|
|
|
+ method: 'POST',
|
|
|
+ ...(options || {}),
|
|
|
+ requireToken: false,
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+export async function fetchCaptcha(options?: { [key: string]: any }) {
|
|
|
+ return request<API.CaptchaResult>('/captcha/get', {
|
|
|
+ method: 'POST',
|
|
|
+ ...(options || {}),
|
|
|
+ requireToken: false,
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
/** 管理后台图片验证码登录(POST /auth/adminLogin) */
|
|
|
export async function fetchAdminLogin(
|
|
|
body: API.AdminLoginParams,
|
|
|
@@ -27,7 +43,7 @@ export async function fetchAdminLoginByCap(
|
|
|
}
|
|
|
|
|
|
export async function fetchLogout(options?: { [key: string]: any }) {
|
|
|
- return request<API.Result>('/user/logout', {
|
|
|
+ return request<API.Result>('/auth/logout', {
|
|
|
method: 'POST',
|
|
|
...(options || {}),
|
|
|
});
|
|
|
@@ -41,14 +57,6 @@ export async function fetchRefreshToken(options?: { [key: string]: any }) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-export async function fetchCaptcha(options?: { [key: string]: any }) {
|
|
|
- return request<API.CaptchaResult>('/captcha/get', {
|
|
|
- method: 'POST',
|
|
|
- ...(options || {}),
|
|
|
- requireToken: false,
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
export async function fetchUserUpdateInfo(
|
|
|
body: API.UserUpdateInfoReq,
|
|
|
options?: { [key: string]: any },
|
|
|
@@ -64,17 +72,9 @@ export async function fetchUserUpdatePassword(
|
|
|
body: API.UserUpdatePasswordReq,
|
|
|
options?: { [key: string]: any },
|
|
|
) {
|
|
|
- return request<API.UserUpdatePasswordResult>('/user/updatePassword', {
|
|
|
+ return request<API.UserUpdatePasswordResult>('/auth/changePassword', {
|
|
|
method: 'POST',
|
|
|
data: body,
|
|
|
...(options || {}),
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
-export async function fetchCapEndpoint(options?: { [key: string]: any }) {
|
|
|
- return request<API.CapEndpointResult>('/capjs/endpoint', {
|
|
|
- method: 'POST',
|
|
|
- ...(options || {}),
|
|
|
- requireToken: false,
|
|
|
- });
|
|
|
-}
|