feat(system): 实现注册码功能并优化用户注册流程
- 新增注册码生成和验证功能- 实现系统设置管理,包括注册功能开关 - 更新前端界面,增加系统管理和注册码相关功能 - 修改数据库结构,添加系统设置和注册码表
This commit is contained in:
@@ -66,6 +66,7 @@ export const register = (data) => {
|
||||
const formData = new FormData()
|
||||
formData.append('username', data.username)
|
||||
formData.append('password', data.password)
|
||||
formData.append('registrationCode', data.registrationCode)
|
||||
return axiosApi.post('/api/user/register', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
@@ -132,3 +133,20 @@ export const cleanTrash = () => axiosApi.delete('/api/trash/clean');
|
||||
|
||||
// 验证Token
|
||||
export const validateToken = () => axiosApi.post('/api/user/validate-token');
|
||||
|
||||
// System APIs
|
||||
export const getRegistrationStatus = () => {
|
||||
return axiosApi.get('/system/registration/status');
|
||||
};
|
||||
|
||||
export const toggleRegistration = (enabled) => {
|
||||
return axiosApi.post('/system/registration/toggle', enabled, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const generateRegistrationCode = () => {
|
||||
return axiosApi.post('/system/registration/generate-code');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user