import type { PageParam, PageResult } from '@vben/request';
|
|
import type { UmsMemberApi } from './index';
|
|
import { requestClient } from '#/api/request';
|
|
export namespace UmsMemberProfileApi {
|
/** 资料变更申请 */
|
export interface ChangeRecord {
|
id?: number;
|
memberId?: number;
|
memberNo?: string;
|
memberName?: string;
|
userId?: number;
|
status?: number; // 0待审核 10已通过 20已驳回
|
contactUser?: string;
|
contactPhone?: string;
|
contactEmail?: string;
|
workUnit?: string;
|
title?: string;
|
researchDirection?: string;
|
unitIntro?: string;
|
legalPerson?: string;
|
organizationCode?: string;
|
regionCode?: string;
|
industry?: string;
|
changeSummary?: string;
|
auditUserId?: number;
|
auditTime?: string;
|
auditRemark?: string;
|
createTime?: string;
|
}
|
|
/** 提交资料变更申请 */
|
export interface ApplyReq {
|
contactUser?: string;
|
contactPhone?: string;
|
contactEmail?: string;
|
workUnit?: string;
|
title?: string;
|
researchDirection?: string;
|
unitIntro?: string;
|
legalPerson?: string;
|
organizationCode?: string;
|
regionCode?: string;
|
industry?: string;
|
}
|
}
|
|
/** 获得当前登录会员的个人资料 */
|
export function getMyProfile() {
|
return requestClient.get<UmsMemberApi.Member>('/ums/member/profile/get');
|
}
|
|
/** 获得当前会员最近一次资料变更申请 */
|
export function getMyLatestChange() {
|
return requestClient.get<UmsMemberProfileApi.ChangeRecord | null>(
|
'/ums/member/profile/change/latest',
|
);
|
}
|
|
/** 提交资料变更申请 */
|
export function applyProfileChange(data: UmsMemberProfileApi.ApplyReq) {
|
return requestClient.post<number>('/ums/member/profile/change/apply', data);
|
}
|
|
/** 管理员分页查询资料变更申请 */
|
export function getProfileChangePage(
|
params: PageParam & {
|
memberNo?: string;
|
memberName?: string;
|
status?: number;
|
},
|
) {
|
return requestClient.get<PageResult<UmsMemberProfileApi.ChangeRecord>>(
|
'/ums/member/profile/change/page',
|
{ params },
|
);
|
}
|
|
/** 审核通过 */
|
export function approveProfileChange(id: number) {
|
return requestClient.put('/ums/member/profile/change/approve', null, {
|
params: { id },
|
});
|
}
|
|
/** 审核驳回 */
|
export function rejectProfileChange(id: number, remark: string) {
|
return requestClient.put('/ums/member/profile/change/reject', null, {
|
params: { id, remark },
|
});
|
}
|