fetch(modify):修复API的URL
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m1s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m1s
This commit is contained in:
@@ -92,4 +92,24 @@ export class AccountService extends BaseService {
|
||||
static removeRoleFromAccount(accountId: number, roleId: number): Promise<BaseResponse> {
|
||||
return this.delete<BaseResponse>(`/api/admin/accounts/${accountId}/roles/${roleId}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账号密码
|
||||
* PUT /api/admin/accounts/{id}/password
|
||||
* @param id 账号ID
|
||||
* @param password 新密码
|
||||
*/
|
||||
static updateAccountPassword(id: number, password: string): Promise<BaseResponse> {
|
||||
return this.put<BaseResponse>(`/api/admin/accounts/${id}/password`, { password })
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账号状态
|
||||
* PUT /api/admin/accounts/{id}/status
|
||||
* @param id 账号ID
|
||||
* @param status 状态 (0:禁用, 1:启用)
|
||||
*/
|
||||
static updateAccountStatus(id: number, status: 0 | 1): Promise<BaseResponse> {
|
||||
return this.put<BaseResponse>(`/api/admin/accounts/${id}/status`, { status })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,42 +16,42 @@ import type {
|
||||
|
||||
export class AuthService extends BaseService {
|
||||
/**
|
||||
* 用户登录
|
||||
* 用户登录(统一认证接口)
|
||||
* @param params 登录参数
|
||||
*/
|
||||
static login(params: LoginParams): Promise<BaseResponse<LoginData>> {
|
||||
return this.post<BaseResponse<LoginData>>('/api/admin/login', params)
|
||||
return this.post<BaseResponse<LoginData>>('/api/auth/login', params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
* 退出登录(统一认证接口)
|
||||
*/
|
||||
static logout(): Promise<BaseResponse> {
|
||||
return this.post<BaseResponse>('/api/admin/logout')
|
||||
return this.post<BaseResponse>('/api/auth/logout')
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户信息
|
||||
* GET /api/admin/me
|
||||
* 获取当前用户信息(统一认证接口)
|
||||
* GET /api/auth/me
|
||||
*/
|
||||
static getUserInfo(): Promise<BaseResponse<UserInfoResponse>> {
|
||||
return this.get<BaseResponse<UserInfoResponse>>('/api/admin/me')
|
||||
return this.get<BaseResponse<UserInfoResponse>>('/api/auth/me')
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新 Token
|
||||
* 刷新 Token(统一认证接口)
|
||||
* @param params 刷新参数
|
||||
*/
|
||||
static refreshToken(params: RefreshTokenParams): Promise<BaseResponse<RefreshTokenData>> {
|
||||
return this.post<BaseResponse<RefreshTokenData>>('/api/auth/refresh', params)
|
||||
return this.post<BaseResponse<RefreshTokenData>>('/api/auth/refresh-token', params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
* 修改密码(统一认证接口)
|
||||
* @param params 修改密码参数
|
||||
*/
|
||||
static changePassword(params: ChangePasswordParams): Promise<BaseResponse> {
|
||||
return this.post<BaseResponse>('/api/auth/change-password', params)
|
||||
return this.put<BaseResponse>('/api/auth/password', params)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
/**
|
||||
* 客户账号管理 API
|
||||
* 客户账号管理 API (企业账号)
|
||||
*
|
||||
* @deprecated 此 API 已废弃,请使用统一的 AccountService 代替
|
||||
* @see AccountService - 统一账号管理接口 (/api/admin/accounts)
|
||||
*
|
||||
* 迁移说明:
|
||||
* - 所有账号类型统一使用 /api/admin/accounts 接口
|
||||
* - 通过 user_type 参数区分账号类型 (2=平台, 3=代理, 4=企业)
|
||||
* - customer-accounts 已改名为 enterprise(企业账号)
|
||||
* - 详见:docs/迁移指南.md
|
||||
*/
|
||||
|
||||
import { BaseService } from '../BaseService'
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
/**
|
||||
* 平台账号相关 API - 匹配后端实际接口
|
||||
*
|
||||
* @deprecated 此 API 已废弃,请使用统一的 AccountService 代替
|
||||
* @see AccountService - 统一账号管理接口 (/api/admin/accounts)
|
||||
*
|
||||
* 迁移说明:
|
||||
* - 所有账号类型统一使用 /api/admin/accounts 接口
|
||||
* - 通过 user_type 参数区分账号类型 (2=平台, 3=代理, 4=企业)
|
||||
* - 详见:docs/迁移指南.md
|
||||
*/
|
||||
|
||||
import { BaseService } from '../BaseService'
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
/**
|
||||
* 代理账号相关 API - 匹配后端实际接口
|
||||
*
|
||||
* @deprecated 此 API 已废弃,请使用统一的 AccountService 代替
|
||||
* @see AccountService - 统一账号管理接口 (/api/admin/accounts)
|
||||
*
|
||||
* 迁移说明:
|
||||
* - 所有账号类型统一使用 /api/admin/accounts 接口
|
||||
* - 通过 user_type 参数区分账号类型 (2=平台, 3=代理, 4=企业)
|
||||
* - 详见:docs/迁移指南.md
|
||||
*/
|
||||
|
||||
import { BaseService } from '../BaseService'
|
||||
|
||||
Reference in New Issue
Block a user