Commit 0660d84b authored by youjie's avatar youjie

优化

parent 279a70f5
import OtaRequest,{ type HttpResponse} from '@/api/OtaRequest' import OtaRequest, { type HttpResponse } from '@/api/OtaRequest'
/** /**
* 用户服务 - 处理所有用户相关的 API 请求 * 用户服务 - 处理所有用户相关的 API 请求
...@@ -57,39 +57,39 @@ export interface DistributorLoginDto { ...@@ -57,39 +57,39 @@ export interface DistributorLoginDto {
*/ */
export interface DistributorSelfRegisterDto { export interface DistributorSelfRegisterDto {
/*** 出生日期*/ /*** 出生日期*/
birthday?: Date | null | string; birthday?: Date | null | string
/*** 确认密码*/ /*** 确认密码*/
confirmPassword: string; confirmPassword: string
/*** 分销商推广码*/ /*** 分销商推广码*/
distributorCode?: null | string; distributorCode?: null | string
/*** 分销商ID*/ /*** 分销商ID*/
distributorId?: number; distributorId?: number
/*** 电子邮箱(需要判断唯一,作为登录账号)*/ /*** 电子邮箱(需要判断唯一,作为登录账号)*/
email: string; email: string
/*** 勾選「我願意接收優惠與電子報」 1是*/ /*** 勾選「我願意接收優惠與電子報」 1是*/
isReceivePush?: number; isReceivePush?: number
/*** LINE ID*/ /*** LINE ID*/
lineId?: null | string; lineId?: null | string
/*** 会员昵称*/ /*** 会员昵称*/
name?: null | string; name?: null | string
/*** 父级会员ID*/ /*** 父级会员ID*/
parentId?: null | string; parentId?: null | string
/*** 密码*/ /*** 密码*/
password: string; password: string
/*** 电话*/ /*** 电话*/
phone?: null | string; phone?: null | string
/*** 居住地區*/ /*** 居住地區*/
residentialArea?: null | string; residentialArea?: null | string
/*** 注册类型 0邮箱验证码 1谷歌授权 3LINE授权 7FaceBook授权*/ /*** 注册类型 0邮箱验证码 1谷歌授权 3LINE授权 7FaceBook授权*/
reType?: number; reType?: number
/*** 性别 1男 2女*/ /*** 性别 1男 2女*/
sex?: number; sex?: number
/*** 临时令牌token*/ /*** 临时令牌token*/
temporaryToken?: null | string; temporaryToken?: null | string
/*** 租户ID(手动传入,用于多租户隔离)*/ /*** 租户ID(手动传入,用于多租户隔离)*/
tenantId: string; tenantId: string
/*** 微信ID*/ /*** 微信ID*/
wechatId?: null | string; wechatId?: null | string
} }
/** /**
...@@ -97,11 +97,11 @@ export interface DistributorSelfRegisterDto { ...@@ -97,11 +97,11 @@ export interface DistributorSelfRegisterDto {
*/ */
export interface MemberUpdateEmailDto { export interface MemberUpdateEmailDto {
/** 临时令牌token(可选) */ /** 临时令牌token(可选) */
temporaryToken?: string | null; temporaryToken?: string | null
/** 电子邮箱(必填,最小长度1,格式email,需判断唯一性作为登录账号) */ /** 电子邮箱(必填,最小长度1,格式email,需判断唯一性作为登录账号) */
email: string; email: string
/** 第一次绑定邮箱时需输入密码(修改邮箱不需要,可选) */ /** 第一次绑定邮箱时需输入密码(修改邮箱不需要,可选) */
newPassword?: string | null; newPassword?: string | null
} }
// ==================== 响应 DTO ==================== // ==================== 响应 DTO ====================
...@@ -137,21 +137,21 @@ export interface DistributorLevelDto { ...@@ -137,21 +137,21 @@ export interface DistributorLevelDto {
*/ */
export interface DistributorLoginResultDto { export interface DistributorLoginResultDto {
/*** 域名*/ /*** 域名*/
domain?: null | string; domain?: null | string
/*** 令牌过期时间*/ /*** 令牌过期时间*/
expireTime?: Date; expireTime?: Date
/*** 会员基础信息*/ /*** 会员基础信息*/
memberData?: null; memberData?: null
/*** 🆕 权限列表*/ /*** 🆕 权限列表*/
permissions?: string[] | null; permissions?: string[] | null
/*** 🆕 刷新令牌*/ /*** 🆕 刷新令牌*/
refreshToken?: null | string; refreshToken?: null | string
/*** 租户ID(ABP 多租户)*/ /*** 租户ID(ABP 多租户)*/
tenantId?: null | string; tenantId?: null | string
/*** JWT访问令牌*/ /*** JWT访问令牌*/
token?: null | string; token?: null | string
/*** 🆕 用户基础信息*/ /*** 🆕 用户基础信息*/
userInfo?: null; userInfo?: null
} }
/** /**
...@@ -240,10 +240,6 @@ export interface ResetPasswordDto { ...@@ -240,10 +240,6 @@ export interface ResetPasswordDto {
newPassword: string newPassword: string
} }
/** /**
* 重置密码响应 * 重置密码响应
*/ */
...@@ -265,69 +261,68 @@ export interface GeneralResponseDto { ...@@ -265,69 +261,68 @@ export interface GeneralResponseDto {
} }
/** /**
* 微信AppID响应 * 微信AppID响应
*/ */
export interface WechatAppIdResponseDto { export interface WechatAppIdResponseDto {
appId?: string, appId?: string
redirectUri?: string, redirectUri?: string
} }
/** /**
* 修改密码请求参数 * 修改密码请求参数
*/ */
export interface NewPasswordDto { export interface NewPasswordDto {
/** 旧密码 */ /** 旧密码 */
oldPassword: string, oldPassword: string
/** 新密码 */ /** 新密码 */
newPassword: string, newPassword: string
} }
/** /**
* 修改密码响应 * 修改密码响应
*/ */
export interface NewPasswordResponseDto { export interface NewPasswordResponseDto {
code?: number, code?: number
} }
// 外部登录信息DTO(对应接口 ExternalLoginInfoDto) // 外部登录信息DTO(对应接口 ExternalLoginInfoDto)
export interface ExternalLoginInfoDto { export interface ExternalLoginInfoDto {
/** 主键ID(UUID格式) */ /** 主键ID(UUID格式) */
id: string; id: string
/** 登录提供商(如Google/WeChat,可选) */ /** 登录提供商(如Google/WeChat,可选) */
provider?: string | null; provider?: string | null
/** 提供商显示名称(可选) */ /** 提供商显示名称(可选) */
providerDisplayName?: string | null; providerDisplayName?: string | null
/** 创建时间(date-time格式) */ /** 创建时间(date-time格式) */
creationTime: string; creationTime: string
} }
/** /**
* 个人中心信息响应 * 个人中心信息响应
*/ */
export interface PersonalCenterResponseDto { export interface PersonalCenterResponseDto {
/** 会员昵称(最大长度200,可选) */ /** 会员昵称(最大长度200,可选) */
name?: string | null; name?: string | null
/** 会员等级(UUID格式,可选) */ /** 会员等级(UUID格式,可选) */
memberGrade?: string | null; memberGrade?: string | null
/** 会员等级名称(可选) */ /** 会员等级名称(可选) */
memberGradeName?: string | null; memberGradeName?: string | null
/** 会员等级图标(可选) */ /** 会员等级图标(可选) */
memberGradeIcon?: string | null; memberGradeIcon?: string | null
/** 头像(最大长度500,可选) */ /** 头像(最大长度500,可选) */
photo?: string | null; photo?: string | null
/** 邮箱(最大长度100,可选) */ /** 邮箱(最大长度100,可选) */
email?: string | null; email?: string | null
/** 分销佣金(double格式) */ /** 分销佣金(double格式) */
balance: number; balance: number
/** 积分(double格式) */ /** 积分(double格式) */
integral: number; integral: number
/** 资料是否完整(1=完整,int32格式) */ /** 资料是否完整(1=完整,int32格式) */
isComplete: number; isComplete: number
/** 快捷登录列表(外部登录信息数组,可选) */ /** 快捷登录列表(外部登录信息数组,可选) */
externalLoginList?: ExternalLoginInfoDto[] | null; externalLoginList?: ExternalLoginInfoDto[] | null
/** 密码安全等级(1低/2中/3高,int32格式) */ /** 密码安全等级(1低/2中/3高,int32格式) */
passwordSecurity: number; passwordSecurity: number
} }
/** /**
...@@ -342,47 +337,47 @@ export interface MemberUpdateEmailResponseDto { ...@@ -342,47 +337,47 @@ export interface MemberUpdateEmailResponseDto {
export interface MemberUserOutputDto { export interface MemberUserOutputDto {
/** 主键ID(UUID格式) */ /** 主键ID(UUID格式) */
id: string; id: string
/** 归属分销商ID */ /** 归属分销商ID */
distributorId: number; distributorId: number
/** 归属分销商名称 */ /** 归属分销商名称 */
distributorName?: string | null; distributorName?: string | null
/** 名(最大长度200) */ /** 名(最大长度200) */
name?: string | null; name?: string | null
/** 姓(最大长度200) */ /** 姓(最大长度200) */
surName?: string | null; surName?: string | null
/** 父级ID(UUID格式) */ /** 父级ID(UUID格式) */
parentId?: string | null; parentId?: string | null
/** 上级会员 */ /** 上级会员 */
parentName?: string | null; parentName?: string | null
/** 会员等级(UUID格式) */ /** 会员等级(UUID格式) */
memberGrade?: string | null; memberGrade?: string | null
/** 会员等级名称 */ /** 会员等级名称 */
memberGradeName?: string | null; memberGradeName?: string | null
/** 头像(最大长度500) */ /** 头像(最大长度500) */
photo?: string | null; photo?: string | null
/** 性别(1男 2女) */ /** 性别(1男 2女) */
sex: number; sex: number
/** 出生日期(date-time格式) */ /** 出生日期(date-time格式) */
birthday?: string | null; birthday?: string | null
/** 邮箱(最大长度100) */ /** 邮箱(最大长度100) */
email?: string | null; email?: string | null
/** LINE ID */ /** LINE ID */
lineId?: string | null; lineId?: string | null
/** 微信ID */ /** 微信ID */
wechatId?: string | null; wechatId?: string | null
/** 电话区号(最大长度10) */ /** 电话区号(最大长度10) */
phoneCode?: string | null; phoneCode?: string | null
/** 电话(最大长度50) */ /** 电话(最大长度50) */
phone?: string | null; phone?: string | null
/** 居住地區 */ /** 居住地區 */
residentialArea?: string | null; residentialArea?: string | null
/** 是否接收推送(1是) */ /** 是否接收推送(1是) */
isReceivePush: number; isReceivePush: number
/** 是否黑名单(1是) */ /** 是否黑名单(1是) */
isBlacklist: number; isBlacklist: number
/** 创建时间(date-time格式) */ /** 创建时间(date-time格式) */
creationTime: string; creationTime: string
} }
/** /**
...@@ -392,69 +387,69 @@ export interface MemberUserOutputDto { ...@@ -392,69 +387,69 @@ export interface MemberUserOutputDto {
// 分页结果DTO(泛型,对应接口 PagedResultDto) // 分页结果DTO(泛型,对应接口 PagedResultDto)
export interface PagedResultDto<T> { export interface PagedResultDto<T> {
/** 数据列表(可空) */ /** 数据列表(可空) */
items?: T[] | null; items?: T[] | null
/** 总条数(int64格式) */ /** 总条数(int64格式) */
totalCount: number; totalCount: number
} }
// 旅客输出DTO(对应接口 MemberGuestOutputDto) // 旅客输出DTO(对应接口 MemberGuestOutputDto)
export interface MemberGuestOutputDto { export interface MemberGuestOutputDto {
/** 主键ID(UUID格式) */ /** 主键ID(UUID格式) */
id: string; id: string
/** 会员用户ID(UUID格式) */ /** 会员用户ID(UUID格式) */
memberId: string; memberId: string
/** 名(最大长度50,可选) */ /** 名(最大长度50,可选) */
name?: string | null; name?: string | null
/** 姓(最大长度100,可选) */ /** 姓(最大长度100,可选) */
surName?: string | null; surName?: string | null
/** 性别(1男 2女,int32格式) */ /** 性别(1男 2女,int32格式) */
sex: number; sex: number
/** 出生日期(date-time格式,可选) */ /** 出生日期(date-time格式,可选) */
birthday?: string | null; birthday?: string | null
/** 国籍(UUID格式,可选) */ /** 国籍(UUID格式,可选) */
countryId?: string | null; countryId?: string | null
/** 证件列表(JSON格式,最大长度600,可选) */ /** 证件列表(JSON格式,最大长度600,可选) */
idCard?: string | null; idCard?: string | null
/** 邮箱(最大长度50,可选) */ /** 邮箱(最大长度50,可选) */
email?: string | null; email?: string | null
/** 电话区号(最大长度10,可选) */ /** 电话区号(最大长度10,可选) */
phoneCode?: string | null; phoneCode?: string | null
/** 电话(最大长度50,可选) */ /** 电话(最大长度50,可选) */
phone?: string | null; phone?: string | null
} }
// 旅客分页查询参数DTO(对应接口 query 参数) // 旅客分页查询参数DTO(对应接口 query 参数)
export interface MemberGuestQueryParams { export interface MemberGuestQueryParams {
/** 跳过条数(最小0,最大2147483647,可选) */ /** 跳过条数(最小0,最大2147483647,可选) */
SkipCount?: number; SkipCount?: number
/** 每页条数(最小1,最大2147483647,可选) */ /** 每页条数(最小1,最大2147483647,可选) */
MaxResultCount?: number; MaxResultCount?: number
/** 姓名(可选) */ /** 姓名(可选) */
Name?: string; Name?: string
} }
// 旅客输入DTO(对应接口 MemberGuestInputDto,用于新增/修改旅客资料) // 旅客输入DTO(对应接口 MemberGuestInputDto,用于新增/修改旅客资料)
export interface MemberGuestInputDto { export interface MemberGuestInputDto {
/** 主键ID(UUID格式,可选,新增时不传,修改时传) */ /** 主键ID(UUID格式,可选,新增时不传,修改时传) */
id?: string | null; id?: string | null
/** 名(最大长度50,可选) */ /** 名(最大长度50,可选) */
name?: string | null; name?: string | null
/** 姓(最大长度100,可选) */ /** 姓(最大长度100,可选) */
surName?: string | null; surName?: string | null
/** 性别(1男 2女,int32格式,必填) */ /** 性别(1男 2女,int32格式,必填) */
sex: number; sex: number
/** 出生日期(date-time格式,可选) */ /** 出生日期(date-time格式,可选) */
birthday?: string | null; birthday?: string | null
/** 国籍(UUID格式,可选) */ /** 国籍(UUID格式,可选) */
countryId?: string | null; countryId?: string | null
/** 证件列表(JSON格式,最大长度600,可选) */ /** 证件列表(JSON格式,最大长度600,可选) */
idCard?: string | null; idCard?: string | null
/** 邮箱(最大长度50,可选) */ /** 邮箱(最大长度50,可选) */
email?: string | null; email?: string | null
/** 电话区号(最大长度10,可选) */ /** 电话区号(最大长度10,可选) */
phoneCode?: string | null; phoneCode?: string | null
/** 电话(最大长度50,可选) */ /** 电话(最大长度50,可选) */
phone?: string | null; phone?: string | null
} }
/** /**
...@@ -464,66 +459,67 @@ export interface MemberGuestInputDto { ...@@ -464,66 +459,67 @@ export interface MemberGuestInputDto {
// 分页结果DTO(泛型,复用通用分页结构) // 分页结果DTO(泛型,复用通用分页结构)
export interface PagedResultDto<T> { export interface PagedResultDto<T> {
/** 数据列表(可空) */ /** 数据列表(可空) */
items?: T[] | null; items?: T[] | null
/** 总条数(int64格式) */ /** 总条数(int64格式) */
totalCount: number; totalCount: number
} }
// 邮寄地址输出DTO(对应接口 MemberMailingAddressOutputDto) // 邮寄地址输出DTO(对应接口 MemberMailingAddressOutputDto)
export interface MemberMailingAddressOutputDto { export interface MemberMailingAddressOutputDto {
/** 主键ID(UUID格式) */ /** 主键ID(UUID格式) */
id: string; id: string
/** 会员用户ID(UUID格式) */ /** 会员用户ID(UUID格式) */
memberId: string; memberId: string
/** 收件人(最大长度50,可选) */ /** 收件人(最大长度50,可选) */
name?: string | null; name?: string | null
/** 国家(UUID格式,可选) */ /** 国家(UUID格式,可选) */
countryId?: string | null; countryId?: string | null
/** 所在城市(最大长度200,可选) */ /** 所在城市(最大长度200,可选) */
cityName?: string | null; cityName?: string | null
/** 详细地址(最大长度200,可选) */ /** 详细地址(最大长度200,可选) */
address?: string | null; address?: string | null
/** 邮编(最大长度20,可选) */ /** 邮编(最大长度20,可选) */
postalCode?: string | null; postalCode?: string | null
/** 电话区号(最大长度10,可选) */ /** 电话区号(最大长度10,可选) */
phoneCode?: string | null; phoneCode?: string | null
/** 电话(最大长度50,可选) */ /** 电话(最大长度50,可选) */
phone?: string | null; phone?: string | null
/** 是否默认(1=是,int32格式,必填) */ /** 是否默认(1=是,int32格式,必填) */
isDefault: number; isDefault: number
} }
// 邮寄地址分页查询参数DTO(对应接口 query 参数) // 邮寄地址分页查询参数DTO(对应接口 query 参数)
export interface MemberMailingAddressQueryParams { export interface MemberMailingAddressQueryParams {
/** 跳过条数(最小0,最大2147483647,可选) */ /** 跳过条数(最小0,最大2147483647,可选) */
SkipCount?: number; SkipCount?: number
/** 每页条数(最小1,最大2147483647,可选) */ /** 每页条数(最小1,最大2147483647,可选) */
MaxResultCount?: number; MaxResultCount?: number
/** 姓名(收件人姓名,可选) */ /** 姓名(收件人姓名,可选) */
Name?: string; Name?: string
} }
/** /**
* 新增/修改邮寄地址相关类型定义 * 新增/修改邮寄地址相关类型定义
*/ */
export interface MemberMailingAddressInputDto { export interface MemberMailingAddressInputDto {
/** 主键ID(UUID格式,可选,新增时不传,修改时传) */ /** 主键ID(UUID格式,可选,新增时不传,修改时传) */
id?: string | null; id?: string | null
/** 收件人(最大长度50,可选) */ /** 收件人(最大长度50,可选) */
name?: string | null; name?: string | null
/** 国家(UUID格式,可选) */ /** 国家(UUID格式,可选) */
countryId?: string | null; countryId?: string | null
/** 所在城市(最大长度200,可选) */ /** 所在城市(最大长度200,可选) */
cityName?: string | null; cityName?: string | null
/** 详细地址(最大长度200,可选) */ /** 详细地址(最大长度200,可选) */
address?: string | null; address?: string | null
/** 邮编(最大长度20,可选) */ /** 邮编(最大长度20,可选) */
postalCode?: string | null; postalCode?: string | null
/** 电话区号(最大长度10,可选) */ /** 电话区号(最大长度10,可选) */
phoneCode?: string | null; phoneCode?: string | null
/** 电话(最大长度50,可选) */ /** 电话(最大长度50,可选) */
phone?: string | null; phone?: string | null
/** 是否默认(1=是,int32格式,必填) */ /** 是否默认(1=是,int32格式,必填) */
isDefault: number; isDefault: number
} }
// ==================== 服务类 ==================== // ==================== 服务类 ====================
...@@ -551,6 +547,7 @@ class UserService { ...@@ -551,6 +547,7 @@ class UserService {
) )
return response as unknown as DistributorLoginResultDto return response as unknown as DistributorLoginResultDto
} }
/** /**
* 登录 * 登录
* @param email 邮箱 * @param email 邮箱
...@@ -584,12 +581,19 @@ class UserService { ...@@ -584,12 +581,19 @@ class UserService {
) )
return response as unknown as DistributorLoginResultDto return response as unknown as DistributorLoginResultDto
} }
/** /**
* 谷歌登录 * 谷歌登录
* @param credential 谷歌token * @param credential 谷歌token
* @returns * @returns
*/ */
static async GoogleLoginAsync(tenantId: string,code: string,distributorId: number,parentId?: any,redirectUri?: string): Promise<DistributorLoginResultDto> { static async GoogleLoginAsync(
tenantId: string,
code: string,
distributorId: number,
parentId?: any,
redirectUri?: string
): Promise<DistributorLoginResultDto> {
const data = { const data = {
tenantId, tenantId,
code, code,
...@@ -602,9 +606,7 @@ class UserService { ...@@ -602,9 +606,7 @@ class UserService {
'/member-auth/google-login-by-code', '/member-auth/google-login-by-code',
data, data,
{ {
headers: { headers: {}
}
} }
) )
return response as unknown as DistributorLoginResultDto return response as unknown as DistributorLoginResultDto
...@@ -615,7 +617,13 @@ class UserService { ...@@ -615,7 +617,13 @@ class UserService {
* @param credential 谷歌token * @param credential 谷歌token
* @returns * @returns
*/ */
static async GoogleBindAsync(tenantId: string,code: string,distributorId: number,parentId?: any,redirectUri?: string): Promise<GeneralResponseDto> { static async GoogleBindAsync(
tenantId: string,
code: string,
distributorId: number,
parentId?: any,
redirectUri?: string
): Promise<GeneralResponseDto> {
const data = { const data = {
tenantId, tenantId,
code, code,
...@@ -628,9 +636,7 @@ class UserService { ...@@ -628,9 +636,7 @@ class UserService {
'/member-auth/google-bind-by-code', '/member-auth/google-bind-by-code',
data, data,
{ {
headers: { headers: {}
}
} }
) )
return response as unknown as GeneralResponseDto return response as unknown as GeneralResponseDto
...@@ -641,7 +647,13 @@ class UserService { ...@@ -641,7 +647,13 @@ class UserService {
* @param tenantId 租户ID * @param tenantId 租户ID
* @returns * @returns
*/ */
static async wechatLoginAsync(tenantId: string,code: string,distributorId: number,parentId?: any,redirectUri?: string): Promise<DistributorLoginResultDto> { static async wechatLoginAsync(
tenantId: string,
code: string,
distributorId: number,
parentId?: any,
redirectUri?: string
): Promise<DistributorLoginResultDto> {
const data = { const data = {
tenantId, tenantId,
code, code,
...@@ -661,12 +673,19 @@ class UserService { ...@@ -661,12 +673,19 @@ class UserService {
) )
return response as unknown as DistributorLoginResultDto return response as unknown as DistributorLoginResultDto
} }
/** /**
* 微信绑定 * 微信绑定
* @param tenantId 租户ID * @param tenantId 租户ID
* @returns * @returns
*/ */
static async wechatBindAsync(tenantId: string,code: string,distributorId: number,parentId?: any,redirectUri?: string): Promise<GeneralResponseDto> { static async wechatBindAsync(
tenantId: string,
code: string,
distributorId: number,
parentId?: any,
redirectUri?: string
): Promise<GeneralResponseDto> {
const data = { const data = {
tenantId, tenantId,
code, code,
...@@ -686,12 +705,19 @@ class UserService { ...@@ -686,12 +705,19 @@ class UserService {
) )
return response as unknown as GeneralResponseDto return response as unknown as GeneralResponseDto
} }
/** /**
* line登录 * line登录
* @param tenantId 租户ID * @param tenantId 租户ID
* @returns * @returns
*/ */
static async lineLoginAsync(tenantId: string,code: string,distributorId: number,parentId?: any,redirectUri?: string): Promise<DistributorLoginResultDto> { static async lineLoginAsync(
tenantId: string,
code: string,
distributorId: number,
parentId?: any,
redirectUri?: string
): Promise<DistributorLoginResultDto> {
const data = { const data = {
tenantId, tenantId,
code, code,
...@@ -711,12 +737,19 @@ class UserService { ...@@ -711,12 +737,19 @@ class UserService {
) )
return response as unknown as DistributorLoginResultDto return response as unknown as DistributorLoginResultDto
} }
/** /**
* line绑定 * line绑定
* @param tenantId 租户ID * @param tenantId 租户ID
* @returns * @returns
*/ */
static async lineBindAsync(tenantId: string,code: string,distributorId: number,parentId?: any,redirectUri?: string): Promise<GeneralResponseDto> { static async lineBindAsync(
tenantId: string,
code: string,
distributorId: number,
parentId?: any,
redirectUri?: string
): Promise<GeneralResponseDto> {
const data = { const data = {
tenantId, tenantId,
code, code,
...@@ -736,12 +769,16 @@ class UserService { ...@@ -736,12 +769,16 @@ class UserService {
) )
return response as unknown as GeneralResponseDto return response as unknown as GeneralResponseDto
} }
/** /**
* 获取微信AppID * 获取微信AppID
* @param tenantId 租户ID * @param tenantId 租户ID
* @returns * @returns
*/ */
static async wechatThirdConfigAsync(tenantId: string,providerType: string): Promise<WechatAppIdResponseDto> { static async wechatThirdConfigAsync(
tenantId: string,
providerType: string
): Promise<WechatAppIdResponseDto> {
const data = { const data = {
providerType providerType
} }
...@@ -763,7 +800,9 @@ class UserService { ...@@ -763,7 +800,9 @@ class UserService {
* @param refreshToken 刷新令牌 * @param refreshToken 刷新令牌
* @returns 新的访问令牌 * @returns 新的访问令牌
*/ */
static async refreshTokenAsync(refreshToken: string): Promise<DistributorLoginResultDto> { static async refreshTokenAsync(
refreshToken: string
): Promise<DistributorLoginResultDto> {
const response = await OtaRequest.post('/auth/refresh-token', { const response = await OtaRequest.post('/auth/refresh-token', {
refreshToken refreshToken
}) })
...@@ -930,7 +969,9 @@ class UserService { ...@@ -930,7 +969,9 @@ class UserService {
* @param tenantId 租户ID(可选) * @param tenantId 租户ID(可选)
* @returns 验证结果 * @returns 验证结果
*/ */
static async memberCenterAsync(tenantId: string): Promise<PersonalCenterResponseDto> { static async memberCenterAsync(
tenantId: string
): Promise<PersonalCenterResponseDto> {
const response = await OtaRequest.get( const response = await OtaRequest.get(
'/member-auth/member-center', '/member-auth/member-center',
{}, {},
...@@ -942,13 +983,17 @@ class UserService { ...@@ -942,13 +983,17 @@ class UserService {
) )
return response as unknown as PersonalCenterResponseDto return response as unknown as PersonalCenterResponseDto
} }
/** /**
* 设置邮箱 * 设置邮箱
* @param tenantId 租户ID(可选) * @param tenantId 租户ID(可选)
* @param email 邮箱地址 * @param email 邮箱地址
* @returns 验证结果 * @returns 验证结果
*/ */
static async resetEmail(tenantId: string,data: MemberUpdateEmailDto): Promise<GeneralResponseDto> { static async resetEmail(
tenantId: string,
data: MemberUpdateEmailDto
): Promise<GeneralResponseDto> {
const response = await OtaRequest.post( const response = await OtaRequest.post(
'/member-auth/reset-email', '/member-auth/reset-email',
data, data,
...@@ -966,7 +1011,10 @@ class UserService { ...@@ -966,7 +1011,10 @@ class UserService {
* @param tenantId 租户ID(可选) * @param tenantId 租户ID(可选)
* @param provider 外部id * @param provider 外部id
*/ */
static async externalunbindBind(tenantId: string,ProviderType:string): Promise<GeneralResponseDto> { static async externalunbindBind(
tenantId: string,
ProviderType: string
): Promise<GeneralResponseDto> {
const Query = { const Query = {
ProviderType ProviderType
} }
...@@ -978,8 +1026,7 @@ class UserService { ...@@ -978,8 +1026,7 @@ class UserService {
...Query ...Query
}, },
headers: { headers: {
'__tenant': tenantId?tenantId:'', '__tenant': tenantId ? tenantId : ''
} }
} }
) )
...@@ -991,7 +1038,10 @@ class UserService { ...@@ -991,7 +1038,10 @@ class UserService {
* @param tenantId 租户ID(可选) * @param tenantId 租户ID(可选)
* @param provider 外部id * @param provider 外部id
*/ */
static async memberUserDetail(tenantId: string,id:any): Promise<MemberUserOutputDto> { static async memberUserDetail(
tenantId: string,
id: any
): Promise<MemberUserOutputDto> {
const response = await OtaRequest.get( const response = await OtaRequest.get(
`/member-user/${id}/detail`, `/member-user/${id}/detail`,
{}, {},
...@@ -1009,7 +1059,10 @@ class UserService { ...@@ -1009,7 +1059,10 @@ class UserService {
* @param tenantId 租户ID(可选) * @param tenantId 租户ID(可选)
* @param provider 外部id * @param provider 外部id
*/ */
static async updateMemberUser(tenantId: string,data:any): Promise<GeneralResponseDto> { static async updateMemberUser(
tenantId: string,
data: any
): Promise<GeneralResponseDto> {
const response = await OtaRequest.put( const response = await OtaRequest.put(
'/member-user', '/member-user',
data, data,
...@@ -1021,11 +1074,15 @@ class UserService { ...@@ -1021,11 +1074,15 @@ class UserService {
) )
return response as unknown as GeneralResponseDto return response as unknown as GeneralResponseDto
} }
/** /**
* 旅客分页列表 * 旅客分页列表
* @param tenantId 租户ID(可选) * @param tenantId 租户ID(可选)
*/ */
static async memberGuest(tenantId: string,data:MemberGuestQueryParams): Promise<PagedResultDto<MemberGuestOutputDto>> { static async memberGuest(
tenantId: string,
data: MemberGuestQueryParams
): Promise<PagedResultDto<MemberGuestOutputDto>> {
const response = await OtaRequest.get( const response = await OtaRequest.get(
'/member-guest/paged', '/member-guest/paged',
data, data,
...@@ -1037,11 +1094,15 @@ class UserService { ...@@ -1037,11 +1094,15 @@ class UserService {
) )
return response as unknown as PagedResultDto<MemberGuestOutputDto> return response as unknown as PagedResultDto<MemberGuestOutputDto>
} }
/** /**
* 新增修改旅客 * 新增修改旅客
* @param tenantId 租户ID(可选) * @param tenantId 租户ID(可选)
*/ */
static async updateMemberGuest(tenantId: string,data:MemberGuestInputDto): Promise<MemberGuestInputDto> { static async updateMemberGuest(
tenantId: string,
data: MemberGuestInputDto
): Promise<MemberGuestInputDto> {
const response = await OtaRequest.post( const response = await OtaRequest.post(
'/member-guest/or-update', '/member-guest/or-update',
data, data,
...@@ -1058,7 +1119,10 @@ class UserService { ...@@ -1058,7 +1119,10 @@ class UserService {
* 删除旅客 * 删除旅客
* @param tenantId 租户ID(可选) * @param tenantId 租户ID(可选)
*/ */
static async deleteMemberGuest(tenantId: string,id:any): Promise<GeneralResponseDto> { static async deleteMemberGuest(
tenantId: string,
id: any
): Promise<GeneralResponseDto> {
const response = await OtaRequest.delete( const response = await OtaRequest.delete(
`/member-guest/${id}`, `/member-guest/${id}`,
{ {
...@@ -1069,11 +1133,15 @@ class UserService { ...@@ -1069,11 +1133,15 @@ class UserService {
) )
return response as unknown as GeneralResponseDto return response as unknown as GeneralResponseDto
} }
/** /**
* 邮寄地址分页列表 * 邮寄地址分页列表
* @param tenantId 租户ID(可选) * @param tenantId 租户ID(可选)
*/ */
static async memberMailingAddress(tenantId: string,data:MemberMailingAddressQueryParams): Promise<PagedResultDto<MemberMailingAddressOutputDto>> { static async memberMailingAddress(
tenantId: string,
data: MemberMailingAddressQueryParams
): Promise<PagedResultDto<MemberMailingAddressOutputDto>> {
const response = await OtaRequest.get( const response = await OtaRequest.get(
'/member-mailing-address/paged', '/member-mailing-address/paged',
data, data,
...@@ -1090,7 +1158,10 @@ class UserService { ...@@ -1090,7 +1158,10 @@ class UserService {
* 新增修改邮寄地址 * 新增修改邮寄地址
* @param tenantId 租户ID(可选) * @param tenantId 租户ID(可选)
*/ */
static async updateMemberMailingAddress(tenantId: string,data:MemberMailingAddressInputDto): Promise<MemberMailingAddressInputDto> { static async updateMemberMailingAddress(
tenantId: string,
data: MemberMailingAddressInputDto
): Promise<MemberMailingAddressInputDto> {
const response = await OtaRequest.post( const response = await OtaRequest.post(
'/member-mailing-address/or-update', '/member-mailing-address/or-update',
data, data,
...@@ -1104,10 +1175,13 @@ class UserService { ...@@ -1104,10 +1175,13 @@ class UserService {
} }
/** /**
* 删除旅客 * 删除邮寄地址
* @param tenantId 租户ID(可选) * @param tenantId 租户ID(可选)
*/ */
static async deleteMemberMailingAddress(tenantId: string,id:any): Promise<GeneralResponseDto> { static async deleteMemberMailingAddress(
tenantId: string,
id: any
): Promise<GeneralResponseDto> {
const response = await OtaRequest.delete( const response = await OtaRequest.delete(
`/member-mailing-address/${id}`, `/member-mailing-address/${id}`,
{ {
......
...@@ -391,12 +391,11 @@ const handleSubmit = async () => { ...@@ -391,12 +391,11 @@ const handleSubmit = async () => {
try { try {
const registerData = formData const registerData = formData
const response = await UserService.updateMemberUser(tenantId|| 'default',registerData) const response = await UserService.updateMemberUser(tenantId|| 'default',registerData)
// if (response) {} if (response) {
Message.success(t('personal.updateSuccess')) Message.success(t('personal.updateSuccess'))
getUserDetail() getUserDetail()
getPersonalInfor() getPersonalInfor()
// userStore.updateProfile({photo:formData.photo,name:formData.name}) }
} catch (error: any) { } catch (error: any) {
console.error('提交失败:', error) console.error('提交失败:', error)
Message.error(error.message) Message.error(error.message)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment