feat: 新增租户、客户和令牌模块及相关功能

refactor: 重构用户、角色、部门等模块的字段长度和校验逻辑

fix: 修复前端接口类型定义和字段显示问题

style: 优化代码格式和注释

perf: 提升数据库连接性能和查询效率

docs: 更新README和配置文档

test: 添加字段校验和数据库连接测试

chore: 更新依赖包和配置文件
This commit is contained in:
zhangtao
2025-12-21 23:14:02 +08:00
parent 33cf047c93
commit fb592d4f1b
71 changed files with 6274 additions and 209 deletions
+2 -2
View File
@@ -164,8 +164,8 @@ export interface JobTable extends BaseType {
trigger_args?: string;
start_date?: string;
end_date?: string;
created_by?: creatorType;
updated_by?: updatorType;
created_by?: CommonType;
updated_by?: CommonType;
}
export interface JobForm extends BaseFormType {
+2 -2
View File
@@ -97,8 +97,8 @@ export interface ApplicationInfo extends BaseType {
name?: string;
access_url?: string;
icon_url?: string;
created_by?: creatorType;
updated_by?: updatorType;
created_by?: CommonType;
updated_by?: CommonType;
}
/**
+2 -2
View File
@@ -92,8 +92,8 @@ export interface DemoPageQuery extends PageQuery {
export interface DemoTable extends BaseType {
name?: string;
created_by?: creatorType;
updated_by?: updatorType;
created_by?: CommonType;
updated_by?: CommonType;
}
export interface DemoForm extends BaseFormType {
+4 -4
View File
@@ -166,8 +166,8 @@ export interface GenTableSchema extends BaseType {
sub_table?: GenTableSchema;
/** 是否为子表 */
sub?: boolean;
created_by?: creatorType;
updated_by?: updatorType;
created_by?: CommonType;
updated_by?: CommonType;
}
/** 代码生成业务表列模型 */
@@ -212,6 +212,6 @@ export interface GenTableColumnSchema extends BaseType {
dict_type?: string;
/** 排序 */
sort?: number;
created_by?: creatorType;
updated_by?: updatorType;
created_by?: CommonType;
updated_by?: CommonType;
}
+101
View File
@@ -0,0 +1,101 @@
import request from "@/utils/request";
const API_PATH = "/system/customer";
const CustomerAPI = {
listCustomer(query: CustomerPageQuery) {
return request<ApiResponse<PageResult<CustomerTable[]>>>({
url: `${API_PATH}/list`,
method: "get",
params: query,
});
},
detailCustomer(query: number) {
return request<ApiResponse<CustomerTable>>({
url: `${API_PATH}/detail/${query}`,
method: "get",
});
},
createCustomer(body: CustomerForm) {
return request<ApiResponse>({
url: `${API_PATH}/create`,
method: "post",
data: body,
});
},
updateCustomer(id: number, body: CustomerForm) {
return request<ApiResponse>({
url: `${API_PATH}/update/${id}`,
method: "put",
data: body,
});
},
deleteCustomer(body: number[]) {
return request<ApiResponse>({
url: `${API_PATH}/delete`,
method: "delete",
data: body,
});
},
batchCustomer(body: BatchType) {
return request<ApiResponse>({
url: `${API_PATH}/available/setting`,
method: "patch",
data: body,
});
},
exportCustomer(body: CustomerPageQuery) {
return request<Blob>({
url: `${API_PATH}/export`,
method: "post",
data: body,
responseType: "blob",
});
},
downloadCustomer() {
return request<ApiResponse>({
url: `${API_PATH}/download/template`,
method: "post",
responseType: "blob",
});
},
importCustomer(body: FormData) {
return request<ApiResponse>({
url: `${API_PATH}/import`,
method: "post",
data: body,
headers: {
"Content-Type": "multipart/form-data",
},
});
},
};
export default CustomerAPI;
export interface CustomerPageQuery extends PageQuery {
name?: string;
status?: string;
created_time?: string[];
}
export interface CustomerTable extends BaseType {
name?: string;
code?: string;
created_by?: CommonType;
updated_by?: CommonType;
tenant?: CommonType;
}
export interface CustomerForm extends BaseFormType {
name?: string;
code?: string;
}
+2 -2
View File
@@ -60,6 +60,6 @@ export interface LogTable extends BaseType {
request_payload?: string;
response_json?: string;
process_time?: string;
created_by?: creatorType;
updated_by?: updatorType;
created_by?: CommonType;
updated_by?: CommonType;
}
+2 -2
View File
@@ -83,8 +83,8 @@ export interface NoticeTable extends BaseType {
notice_title?: string;
notice_type?: string;
notice_content?: string;
created_by?: creatorType;
updated_by?: updatorType;
created_by?: CommonType;
updated_by?: CommonType;
}
export interface NoticeForm extends BaseFormType {
+2 -2
View File
@@ -73,8 +73,8 @@ export interface PositionPageQuery extends PageQuery {
export interface PositionTable extends BaseType {
name?: string;
order?: number;
created_by?: creatorType;
updated_by?: updatorType;
created_by?: CommonType;
updated_by?: CommonType;
}
export interface PositionForm extends BaseFormType {
+102
View File
@@ -0,0 +1,102 @@
import request from "@/utils/request";
const API_PATH = "/system/tenant";
const TenantAPI = {
listTenant(query: TenantPageQuery) {
return request<ApiResponse<PageResult<TenantTable[]>>>({
url: `${API_PATH}/list`,
method: "get",
params: query,
});
},
detailTenant(query: number) {
return request<ApiResponse<TenantTable>>({
url: `${API_PATH}/detail/${query}`,
method: "get",
});
},
createTenant(body: TenantForm) {
return request<ApiResponse>({
url: `${API_PATH}/create`,
method: "post",
data: body,
});
},
updateTenant(id: number, body: TenantForm) {
return request<ApiResponse>({
url: `${API_PATH}/update/${id}`,
method: "put",
data: body,
});
},
deleteTenant(body: number[]) {
return request<ApiResponse>({
url: `${API_PATH}/delete`,
method: "delete",
data: body,
});
},
batchTenant(body: BatchType) {
return request<ApiResponse>({
url: `${API_PATH}/available/setting`,
method: "patch",
data: body,
});
},
exportTenant(body: TenantPageQuery) {
return request<Blob>({
url: `${API_PATH}/export`,
method: "post",
data: body,
responseType: "blob",
});
},
downloadTenant() {
return request<ApiResponse>({
url: `${API_PATH}/download/template`,
method: "post",
responseType: "blob",
});
},
importTenant(body: FormData) {
return request<ApiResponse>({
url: `${API_PATH}/import`,
method: "post",
data: body,
headers: {
"Content-Type": "multipart/form-data",
},
});
},
};
export default TenantAPI;
export interface TenantPageQuery extends PageQuery {
name?: string;
status?: string;
created_time?: string[];
}
export interface TenantTable extends BaseType {
name?: string;
code?: string;
start_time?: string;
end_time?: string;
}
export interface TenantForm extends BaseFormType {
name?: string;
code?: string;
start_time?: string;
end_time?: string;
}
+101
View File
@@ -0,0 +1,101 @@
import request from "@/utils/request";
const API_PATH = "/system/token";
const TokenAPI = {
getTokenList(query: TokenPageQuery) {
return request<ApiResponse<PageResult<TokenTable[]>>>({
url: `${API_PATH}/list`,
method: "get",
params: query,
});
},
getTokenDetail(query: number) {
return request<ApiResponse<TokenTable>>({
url: `${API_PATH}/detail/${query}`,
method: "get",
});
},
createToken(body: TokenForm) {
return request<ApiResponse>({
url: `${API_PATH}/create`,
method: "post",
data: body,
});
},
updateToken(id: number, body: TokenForm) {
return request<ApiResponse>({
url: `${API_PATH}/update/${id}`,
method: "put",
data: body,
});
},
deleteToken(body: number[]) {
return request<ApiResponse>({
url: `${API_PATH}/delete`,
method: "delete",
data: body,
});
},
batchToken(body: BatchType) {
return request<ApiResponse>({
url: `${API_PATH}/available/setting`,
method: "patch",
data: body,
});
},
exportToken(body: TokenPageQuery) {
return request<Blob>({
url: `${API_PATH}/export`,
method: "post",
data: body,
responseType: "blob",
});
},
downloadTemplateToken() {
return request<ApiResponse>({
url: `${API_PATH}/download/template`,
method: "post",
responseType: "blob",
});
},
importToken(body: FormData) {
return request<ApiResponse>({
url: `${API_PATH}/import`,
method: "post",
data: body,
headers: {
"Content-Type": "multipart/form-data",
},
});
},
};
export default TokenAPI;
export interface TokenPageQuery extends PageQuery {
name?: string;
status?: string;
created_time?: string[];
updated_time?: string[];
created_id?: number;
updated_id?: number;
}
export interface TokenTable extends BaseType {
name?: string;
created_by?: CommonType;
updated_by?: CommonType;
}
export interface TokenForm extends BaseFormType {
name?: string;
}
+2 -2
View File
@@ -188,8 +188,8 @@ export interface UserInfo extends BaseType {
position_ids?: positionSelectorType["id"][];
is_superuser?: boolean;
last_login?: string;
created_by?: creatorType;
updated_by?: updatorType;
created_by?: CommonType;
updated_by?: CommonType;
}
export interface deptTreeType {