feat:增加个人中心:50% 支持右侧的社交绑定

This commit is contained in:
YunaiV
2025-04-20 18:52:21 +08:00
parent d030a73beb
commit a6dcd8c200
5 changed files with 190 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
import { requestClient } from '#/api/request';
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace SystemSocialUserApi {
/** 社交用户信息 */
export interface SystemSocialUser {
@@ -17,6 +18,19 @@ export namespace SystemSocialUserApi {
createTime?: Date;
updateTime?: Date;
}
/** 社交绑定请求 */
export interface SocialUserBindReqVO {
type: number;
code: string;
state: string;
}
/** 取消社交绑定请求 */
export interface SocialUserUnbindReqVO {
type: number;
openid: string;
}
}
/** 查询社交用户列表 */
@@ -30,3 +44,18 @@ export function getSocialUserPage(params: PageParam) {
export function getSocialUser(id: number) {
return requestClient.get<SystemSocialUserApi.SystemSocialUser>(`/system/social-user/get?id=${id}`);
}
/** 社交绑定,使用 code 授权码 */
export function socialBind(data: SystemSocialUserApi.SocialUserBindReqVO) {
return requestClient.post<boolean>('/system/social-user/bind', data);
}
/** 取消社交绑定 */
export function socialUnbind(data: SystemSocialUserApi.SocialUserUnbindReqVO) {
return requestClient.delete<boolean>('/system/social-user/unbind', { data });
}
/** 获得绑定社交用户列表 */
export function getBindSocialUserList() {
return requestClient.get<SystemSocialUserApi.SystemSocialUser[]>('/system/social-user/get-bind-list');
}

View File

@@ -1,12 +1,6 @@
import { requestClient } from '#/api/request';
export namespace SystemUserProfileApi {
/** 社交用户信息 */
export interface SocialUser {
type: number;
openid: string;
}
/** 用户个人中心信息 */
export interface UserProfileRespVO {
id: number;
@@ -22,7 +16,6 @@ export namespace SystemUserProfileApi {
roles: any[];
dept: any;
posts: any[];
socialUsers: SocialUser[];
}
/** 更新密码请求 */