✨ add user dashboard page
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {service} from "@/utils/alova/service.ts";
|
||||
import {service} from "@/utils/alova/service_app.ts";
|
||||
|
||||
export const uploadImage = (data: any) => {
|
||||
return service.Post('/api/auth/phone/upload', {
|
||||
@@ -26,3 +26,37 @@ export const sharePhoneUploadApi = (data: any) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
* @param formData
|
||||
* @param headers
|
||||
*/
|
||||
export const uploadFile = (formData: any, headers: any) => {
|
||||
return service.Post('/api/auth/storage/uploads', formData, {
|
||||
headers: headers,
|
||||
meta: {
|
||||
ignoreToken: false,
|
||||
signature: false,
|
||||
},
|
||||
name: "upload-file",
|
||||
});
|
||||
};
|
||||
|
||||
export const albumListApi = (type: number, sort: boolean, headers: any) => {
|
||||
return service.Post('/api/auth/storage/album/list', {
|
||||
type: type,
|
||||
sort: sort,
|
||||
}, {
|
||||
headers: headers,
|
||||
cacheFor: {
|
||||
expire: 60 * 60 * 24 * 7,
|
||||
mode: "restore",
|
||||
},
|
||||
meta: {
|
||||
ignoreToken: false,
|
||||
signature: false,
|
||||
},
|
||||
hitSource: ["create-album", "rename-album", "delete-album", "album-share"],
|
||||
});
|
||||
};
|
||||
|
@@ -350,6 +350,7 @@ export const getStorageConfigListApi = () => {
|
||||
signature: false,
|
||||
},
|
||||
name: "storage-config-list",
|
||||
hitSource: ["delete-storage-config", "add-storage-config"]
|
||||
});
|
||||
};
|
||||
/**
|
||||
@@ -509,3 +510,54 @@ export const downloadAlbumImagesApi = (id: number, provider: string, bucket: str
|
||||
name: "download-album-images",
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 获取用户存储配置
|
||||
*/
|
||||
export const listUserStorageConfigApi = () => {
|
||||
return service.Post('/api/auth/storage/user/storage/list', {}, {
|
||||
cacheFor: {
|
||||
expire: 60 * 60 * 24 * 7,
|
||||
mode: "restore",
|
||||
},
|
||||
meta: {
|
||||
ignoreToken: false,
|
||||
signature: false,
|
||||
},
|
||||
name: "list-user-storage-config",
|
||||
hitSource: ["delete-storage-config", "add-storage-config"],
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 创建存储配置
|
||||
* @param id
|
||||
* @param provider
|
||||
* @param bucket
|
||||
*/
|
||||
export const deleteStorageConfigApi = (id: number, provider: string, bucket: string) => {
|
||||
return service.Post('/api/auth/storage/config/delete', {
|
||||
id: id,
|
||||
provider: provider,
|
||||
bucket: bucket,
|
||||
}, {
|
||||
meta: {
|
||||
ignoreToken: false,
|
||||
signature: false,
|
||||
},
|
||||
name: "delete-storage-config",
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 创建存储配置
|
||||
* @param params
|
||||
*/
|
||||
export const addStorageConfigApi = (params: any) => {
|
||||
return service.Post('/api/auth/storage/config/add', {
|
||||
...params,
|
||||
}, {
|
||||
meta: {
|
||||
ignoreToken: false,
|
||||
signature: false,
|
||||
},
|
||||
name: "add-storage-config",
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user