mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-11-02 16:57:11 +08:00
新增:新增上传头像 API,采用本地存储方式存储头像
This commit is contained in:
18
continew-admin-ui/src/api/system/user-center.ts
Normal file
18
continew-admin-ui/src/api/system/user-center.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import axios from 'axios';
|
||||
|
||||
export interface BasicInfoModel {
|
||||
username: string;
|
||||
nickname: string;
|
||||
gender: number;
|
||||
}
|
||||
|
||||
export interface AvatarRes {
|
||||
avatar: string;
|
||||
}
|
||||
export function uploadAvatar(data: FormData) {
|
||||
return axios.post<AvatarRes>('/system/user/center/avatar', data);
|
||||
}
|
||||
|
||||
export function saveUserInfo() {
|
||||
return axios.get('/api/user/save-info');
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
import axios from 'axios';
|
||||
|
||||
export interface MyProjectRecord {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
peopleNumber: number;
|
||||
contributors: {
|
||||
name: string;
|
||||
email: string;
|
||||
avatar: string;
|
||||
}[];
|
||||
}
|
||||
export function queryMyProjectList() {
|
||||
return axios.get('/api/user/my-project/list');
|
||||
}
|
||||
|
||||
export interface MyTeamRecord {
|
||||
id: number;
|
||||
avatar: string;
|
||||
name: string;
|
||||
peopleNumber: number;
|
||||
}
|
||||
export function queryMyTeamList() {
|
||||
return axios.get('/api/user/my-team/list');
|
||||
}
|
||||
|
||||
export interface LatestActivity {
|
||||
id: number;
|
||||
title: string;
|
||||
description: string;
|
||||
avatar: string;
|
||||
}
|
||||
export function queryLatestActivity() {
|
||||
return axios.get<LatestActivity[]>('/api/user/latest-activity');
|
||||
}
|
||||
|
||||
export function saveUserInfo() {
|
||||
return axios.get('/api/user/save-info');
|
||||
}
|
||||
|
||||
export interface BasicInfoModel {
|
||||
username: string;
|
||||
nickname: string;
|
||||
gender: number;
|
||||
}
|
||||
|
||||
export function userUploadApi(
|
||||
data: FormData,
|
||||
config: {
|
||||
controller: AbortController;
|
||||
onUploadProgress?: (progressEvent: any) => void;
|
||||
}
|
||||
) {
|
||||
// const controller = new AbortController();
|
||||
return axios.post('/api/user/upload', data, config);
|
||||
}
|
||||
Reference in New Issue
Block a user