✨ add image backup function and user information detailed display and editing function
This commit is contained in:
55
src/api/storage/backup.ts
Normal file
55
src/api/storage/backup.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import {service} from "@/utils/alova/service.ts";
|
||||
|
||||
/**
|
||||
* 从一个存储桶备份到另一个存储桶
|
||||
* @param sourceProvider 源存储商
|
||||
* @param sourceBucket 源存储桶
|
||||
* @param targetProvider 目标存储商
|
||||
* @param targetBucket 目标存储桶
|
||||
*/
|
||||
export const backupStorageApi = (sourceProvider: string, sourceBucket: string, targetProvider: string, targetBucket: string) => {
|
||||
return service.Post('/api/auth/storage/backup', {
|
||||
source_provider: sourceProvider,
|
||||
source_bucket: sourceBucket,
|
||||
target_provider: targetProvider,
|
||||
target_bucket: targetBucket,
|
||||
}, {
|
||||
meta: {
|
||||
ignoreToken: false,
|
||||
signature: false,
|
||||
},
|
||||
name: "backup-storage",
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取备份进度
|
||||
* @param taskId 备份任务ID
|
||||
*/
|
||||
export const getBackupProgressApi = (taskId: string) => {
|
||||
return service.Post('/api/auth/storage/backup/progress', {
|
||||
task_id: taskId,
|
||||
}, {
|
||||
meta: {
|
||||
ignoreToken: false,
|
||||
signature: false,
|
||||
},
|
||||
name: "get-backup-progress",
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 取消备份任务
|
||||
* @param taskId 备份任务ID
|
||||
*/
|
||||
export const cancelBackupTaskApi = (taskId: string) => {
|
||||
return service.Post('/api/auth/storage/backup/cancel', {
|
||||
task_id: taskId,
|
||||
}, {
|
||||
meta: {
|
||||
ignoreToken: false,
|
||||
signature: false,
|
||||
},
|
||||
name: "cancel-backup-task",
|
||||
});
|
||||
};
|
70
src/api/user/email.ts
Normal file
70
src/api/user/email.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
import {service} from "@/utils/alova/service.ts";
|
||||
|
||||
/**
|
||||
* 发送邮箱验证码
|
||||
* @param email 邮箱地址
|
||||
*/
|
||||
export const sendEmailCaptchaApi = (email: string) => {
|
||||
return service.Post('/api/user/email/captcha/send', {
|
||||
email: email,
|
||||
},
|
||||
{
|
||||
meta: {
|
||||
ignoreToken: false,
|
||||
signature: true
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* 绑定邮箱
|
||||
* @param email 邮箱地址
|
||||
* @param captcha 验证码
|
||||
*/
|
||||
export const bindEmailApi = (email: string, captcha: string) => {
|
||||
return service.Post('/api/user/email/bind', {
|
||||
email: email,
|
||||
captcha: captcha,
|
||||
},
|
||||
{
|
||||
meta: {
|
||||
ignoreToken: false,
|
||||
signature: true
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* 解绑邮箱
|
||||
*/
|
||||
export const unbindEmailApi = () => {
|
||||
return service.Post('/api/user/email/unbind', {},
|
||||
{
|
||||
meta: {
|
||||
ignoreToken: false,
|
||||
signature: true
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改邮箱
|
||||
* @param email 新邮箱地址
|
||||
* @param captcha 验证码
|
||||
*/
|
||||
export const updateEmailApi = (email: string, captcha: string) => {
|
||||
return service.Post('/api/user/email/update', {
|
||||
email: email,
|
||||
captcha: captcha,
|
||||
},
|
||||
{
|
||||
meta: {
|
||||
ignoreToken: false,
|
||||
signature: true
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
Reference in New Issue
Block a user