feat: 个人中心-安全设置,支持绑定、解绑三方账号

This commit is contained in:
2023-10-19 23:44:56 +08:00
parent 36d52d3e15
commit efe455736c
19 changed files with 520 additions and 76 deletions

View File

@@ -1,6 +1,6 @@
import axios from 'axios';
const BASE_URL = '/system/user/center';
const BASE_URL = '/system/user';
export interface BasicInfoModel {
username: string;
@@ -43,3 +43,20 @@ export interface UpdateEmailReq {
export function updateEmail(req: UpdateEmailReq) {
return axios.patch(`${BASE_URL}/email`, req);
}
export interface UserSocialBindRecord {
source: string;
description: string;
}
export function listSocial() {
return axios.get<UserSocialBindRecord[]>(`${BASE_URL}/social`);
}
export function bindSocial(source: string, req: any) {
return axios.post(`${BASE_URL}/social/${source}`, req);
}
export function unbindSocial(source: string) {
return axios.delete(`${BASE_URL}/social/${source}`);
}