diff --git a/Admin.NET/Admin.NET.Application/Configuration/Limit.json b/Admin.NET/Admin.NET.Application/Configuration/Limit.json
index 9bce62cb..8239c53c 100644
--- a/Admin.NET/Admin.NET.Application/Configuration/Limit.json
+++ b/Admin.NET/Admin.NET.Application/Configuration/Limit.json
@@ -21,7 +21,7 @@
// 客户端白名单
"ClientWhitelist": [],
"QuotaExceededResponse": {
- "Content": "{{\"code\":429,\"type\":\"error\",\"message\":\"访问过于频繁,请稍后重试!\",\"result\":null,\"extras\":null}}",
+ "Content": "{{\"code\":429,\"type\":\"error\",\"message\":\"访问过于频繁,请稍后重试!禁止违法行为否则110 👮\",\"result\":null,\"extras\":null}}",
"ContentType": "application/json",
"StatusCode": 429
},
@@ -29,46 +29,42 @@
"HttpStatusCode": 429,
// API规则,结尾一定要带*
"GeneralRules": [
- // 1秒钟只能调用10次
+ // 1秒钟只能调用1000次
{
"Endpoint": "*",
"Period": "1s",
- "Limit": 10
+ "Limit": 1000
},
- // 1分钟只能调用600次
+ // 1分钟只能调用60000次
{
"Endpoint": "*",
"Period": "1m",
- "Limit": 600
- },
- // 1小时只能调用3600
- {
- "Endpoint": "*",
- "Period": "1h",
- "Limit": 3600
- },
- // 1天只能调用86400次
- {
- "Endpoint": "*",
- "Period": "1d",
- "Limit": 86400
+ "Limit": 60000
}
+ //// 1小时只能调用3600000次
+ //{
+ // "Endpoint": "*",
+ // "Period": "1h",
+ // "Limit": 3600000
+ //},
+ //// 1天只能调用86400000次
+ //{
+ // "Endpoint": "*",
+ // "Period": "1d",
+ // "Limit": 86400000
+ //}
]
},
+ // IP 黑名单
"IpRateLimitPolicies": {
"IpRules": [
{
- "Ip": "XXX.XXX.XXX.XXX",
+ "Ip": "0.0.0.0", // IP可用:"::1/10"
"Rules": [
{
"Endpoint": "*",
"Period": "1s",
- "Limit": 10
- },
- {
- "Endpoint": "*",
- "Period": "1m",
- "Limit": 600
+ "Limit": 0 // 设置为0就是1次都不能请求,完全屏蔽
}
]
}
@@ -90,29 +86,19 @@
{
"Endpoint": "*",
"Period": "1s",
- "Limit": 10
- },
- {
- "Endpoint": "*",
- "Period": "1m",
- "Limit": 600
+ "Limit": 2000
}
]
},
"ClientRateLimitPolicies": {
"ClientRules": [
{
- "ClientId": "xxx-xxx",
+ "ClientId": "",
"Rules": [
{
"Endpoint": "*",
"Period": "1s",
- "Limit": 10
- },
- {
- "Endpoint": "*",
- "Period": "1m",
- "Limit": 600
+ "Limit": 2000
}
]
}
diff --git a/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj b/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj
index b02eeb85..8aa9aa9f 100644
--- a/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj
+++ b/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj
@@ -21,7 +21,7 @@
-
+
@@ -40,7 +40,7 @@
-
+
diff --git a/Admin.NET/Admin.NET.Core/Extension/UseApplicationBuilder.cs b/Admin.NET/Admin.NET.Core/Extension/UseApplicationBuilder.cs
new file mode 100644
index 00000000..f10ca84c
--- /dev/null
+++ b/Admin.NET/Admin.NET.Core/Extension/UseApplicationBuilder.cs
@@ -0,0 +1,26 @@
+// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
+//
+// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
+//
+// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
+
+using AspNetCoreRateLimit;
+using Microsoft.AspNetCore.Builder;
+
+namespace Admin.NET.Core;
+
+///
+/// 配置中间件扩展
+///
+public static class UseApplicationBuilder
+{
+ // 配置限流中间件策略
+ public static void UsePolicyRateLimit(this IApplicationBuilder app)
+ {
+ var ipPolicyStore = app.ApplicationServices.GetRequiredService();
+ ipPolicyStore.SeedAsync().GetAwaiter().GetResult();
+
+ var clientPolicyStore = app.ApplicationServices.GetRequiredService();
+ clientPolicyStore.SeedAsync().GetAwaiter().GetResult();
+ }
+}
\ No newline at end of file
diff --git a/Admin.NET/Admin.NET.Core/SeedData/SysCodeGenTemplate.cs b/Admin.NET/Admin.NET.Core/SeedData/SysCodeGenTemplate.cs
index e91a1ba2..bf24009b 100644
--- a/Admin.NET/Admin.NET.Core/SeedData/SysCodeGenTemplate.cs
+++ b/Admin.NET/Admin.NET.Core/SeedData/SysCodeGenTemplate.cs
@@ -4,14 +4,12 @@
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
-using Microsoft.AspNetCore.Server.IISIntegration;
-
namespace Admin.NET.Core;
///
/// 代码生成模板配置表种子数据
///
-public class SysCodeGenTemplateSeedData : ISqlSugarEntitySeedData
+public class SysCodeGenTemplateSeedData : ISqlSugarEntitySeedData
{
///
/// 种子数据
diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenService.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenService.cs
index 3de4e46a..679f0445 100644
--- a/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenService.cs
+++ b/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenService.cs
@@ -84,7 +84,6 @@ public class SysCodeGenService : IDynamicApiController, ITransient
///
private List GetCodeGenTemplateRelation(long codeGenId, List templateIds)
{
-
List list = new List();
foreach (var item in templateIds)
{
@@ -96,8 +95,6 @@ public class SysCodeGenService : IDynamicApiController, ITransient
return list;
}
-
-
///
/// 更新代码生成 🔖
///
@@ -138,7 +135,7 @@ public class SysCodeGenService : IDynamicApiController, ITransient
inputs.ForEach(u =>
{
//_db.Deleteable().In(u.Id).ExecuteCommand();
- _db.DeleteNav(t=>t.Id==u.Id)
+ _db.DeleteNav(t => t.Id == u.Id)
.Include(t => t.CodeGenTemplateRelations)
.ExecuteCommand();
diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenTemplateService.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenTemplateService.cs
index a2906c63..0e65a8a8 100644
--- a/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenTemplateService.cs
+++ b/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenTemplateService.cs
@@ -13,6 +13,7 @@ namespace Admin.NET.Core.Service;
public class SysCodeGenTemplateService : IDynamicApiController, ITransient
{
private readonly SqlSugarRepository _codeGenTemplateRep;
+
public SysCodeGenTemplateService(SqlSugarRepository codeGenTemplateRep)
{
_codeGenTemplateRep = codeGenTemplateRep;
@@ -28,4 +29,4 @@ public class SysCodeGenTemplateService : IDynamicApiController, ITransient
{
return await _codeGenTemplateRep.AsQueryable().Select().ToListAsync();
}
-}
+}
\ No newline at end of file
diff --git a/Admin.NET/Admin.NET.Core/Service/Server/SysServerService.cs b/Admin.NET/Admin.NET.Core/Service/Server/SysServerService.cs
index 8f47d067..b7cc9ad8 100644
--- a/Admin.NET/Admin.NET.Core/Service/Server/SysServerService.cs
+++ b/Admin.NET/Admin.NET.Core/Service/Server/SysServerService.cs
@@ -109,6 +109,7 @@ public class SysServerService : IDynamicApiController, ITransient
var giteeAuthenticationOptionsAssembly = typeof(AspNet.Security.OAuth.Gitee.GiteeAuthenticationOptions).Assembly.GetName();
var hashidsAssembly = typeof(HashidsNet.Hashids).Assembly.GetName();
var sftpClientAssembly = typeof(Renci.SshNet.SftpClient).Assembly.GetName();
+ var hardwareInfoAssembly = typeof(Hardware.Info.HardwareInfo).Assembly.GetName();
return new[]
{
@@ -140,6 +141,7 @@ public class SysServerService : IDynamicApiController, ITransient
new { giteeAuthenticationOptionsAssembly.Name, giteeAuthenticationOptionsAssembly.Version },
new { hashidsAssembly.Name, hashidsAssembly.Version },
new { sftpClientAssembly.Name, sftpClientAssembly.Version },
+ new { hardwareInfoAssembly.Name, hardwareInfoAssembly.Version },
};
}
}
\ No newline at end of file
diff --git a/Admin.NET/Admin.NET.Web.Core/Startup.cs b/Admin.NET/Admin.NET.Web.Core/Startup.cs
index fc2fc2b8..7925ab98 100644
--- a/Admin.NET/Admin.NET.Web.Core/Startup.cs
+++ b/Admin.NET/Admin.NET.Web.Core/Startup.cs
@@ -262,6 +262,7 @@ public class Startup : AppStartup
// 限流组件(在跨域之后)
app.UseIpRateLimiting();
app.UseClientRateLimiting();
+ app.UsePolicyRateLimit();
// 任务调度看板
app.UseScheduleUI(options =>
diff --git a/Web/package.json b/Web/package.json
index f8c28432..488d2a27 100644
--- a/Web/package.json
+++ b/Web/package.json
@@ -2,7 +2,7 @@
"name": "admin.net.pro",
"type": "module",
"version": "2.4.33",
- "lastBuildTime": "2024.08.27",
+ "lastBuildTime": "2024.08.30",
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
"author": "zuohuaijun",
"license": "MIT",
@@ -41,7 +41,7 @@
"js-table2excel": "^1.1.2",
"jsplumb": "^2.15.6",
"lodash-es": "^4.17.21",
- "md-editor-v3": "^4.19.1",
+ "md-editor-v3": "^4.19.2",
"mitt": "^3.0.1",
"monaco-editor": "^0.51.0",
"mqtt": "^4.3.8",
@@ -70,7 +70,7 @@
"vue-router": "^4.4.3",
"vue-signature-pad": "^3.0.2",
"vue3-tree-org": "^4.2.2",
- "vxe-pc-ui": "^4.1.8",
+ "vxe-pc-ui": "^4.1.12",
"vxe-table": "^4.7.59",
"vxe-table-plugin-element": "^4.0.4",
"vxe-table-plugin-export-xlsx": "^4.0.5",
@@ -86,7 +86,7 @@
"@types/sortablejs": "^1.15.8",
"@typescript-eslint/eslint-plugin": "^8.3.0",
"@typescript-eslint/parser": "^8.3.0",
- "@vitejs/plugin-vue": "^5.1.2",
+ "@vitejs/plugin-vue": "^5.1.3",
"@vitejs/plugin-vue-jsx": "^4.0.1",
"@vue/compiler-sfc": "^3.4.38",
"code-inspector-plugin": "^0.16.0",
diff --git a/Web/src/api-services/api.ts b/Web/src/api-services/api.ts
index 351a4b3e..ef032857 100644
--- a/Web/src/api-services/api.ts
+++ b/Web/src/api-services/api.ts
@@ -16,6 +16,7 @@ export * from './apis/sys-auth-api';
export * from './apis/sys-cache-api';
export * from './apis/sys-code-gen-api';
export * from './apis/sys-code-gen-config-api';
+export * from './apis/sys-code-gen-template-api';
export * from './apis/sys-common-api';
export * from './apis/sys-config-api';
export * from './apis/sys-const-api';
diff --git a/Web/src/api-services/apis/sys-code-gen-template-api.ts b/Web/src/api-services/apis/sys-code-gen-template-api.ts
new file mode 100644
index 00000000..2c810145
--- /dev/null
+++ b/Web/src/api-services/apis/sys-code-gen-template-api.ts
@@ -0,0 +1,130 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Admin.NET 通用权限开发平台
+ * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
+import { Configuration } from '../configuration';
+// Some imports not used depending on template conditions
+// @ts-ignore
+import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
+import { AdminResultListSysCodeGenTemplate } from '../models';
+/**
+ * SysCodeGenTemplateApi - axios parameter creator
+ * @export
+ */
+export const SysCodeGenTemplateApiAxiosParamCreator = function (configuration?: Configuration) {
+ return {
+ /**
+ * 获取代码生成模板配置列表
+ * @summary 获取代码生成模板配置列表
+ * @param {*} [options] Override http request option.
+ * @throws {RequiredError}
+ */
+ apiSysCodeGenTemplateListGet: async (options: AxiosRequestConfig = {}): Promise => {
+ const localVarPath = `/api/sysCodeGenTemplate/list`;
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
+ let baseOptions;
+ if (configuration) {
+ baseOptions = configuration.baseOptions;
+ }
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
+ const localVarHeaderParameter = {} as any;
+ const localVarQueryParameter = {} as any;
+
+ // authentication Bearer required
+ // http bearer authentication required
+ if (configuration && configuration.accessToken) {
+ const accessToken = typeof configuration.accessToken === 'function'
+ ? await configuration.accessToken()
+ : await configuration.accessToken;
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
+ }
+
+ const query = new URLSearchParams(localVarUrlObj.search);
+ for (const key in localVarQueryParameter) {
+ query.set(key, localVarQueryParameter[key]);
+ }
+ for (const key in options.params) {
+ query.set(key, options.params[key]);
+ }
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
+
+ return {
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
+ options: localVarRequestOptions,
+ };
+ },
+ }
+};
+
+/**
+ * SysCodeGenTemplateApi - functional programming interface
+ * @export
+ */
+export const SysCodeGenTemplateApiFp = function(configuration?: Configuration) {
+ return {
+ /**
+ * 获取代码生成模板配置列表
+ * @summary 获取代码生成模板配置列表
+ * @param {*} [options] Override http request option.
+ * @throws {RequiredError}
+ */
+ async apiSysCodeGenTemplateListGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> {
+ const localVarAxiosArgs = await SysCodeGenTemplateApiAxiosParamCreator(configuration).apiSysCodeGenTemplateListGet(options);
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
+ return axios.request(axiosRequestArgs);
+ };
+ },
+ }
+};
+
+/**
+ * SysCodeGenTemplateApi - factory interface
+ * @export
+ */
+export const SysCodeGenTemplateApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
+ return {
+ /**
+ * 获取代码生成模板配置列表
+ * @summary 获取代码生成模板配置列表
+ * @param {*} [options] Override http request option.
+ * @throws {RequiredError}
+ */
+ async apiSysCodeGenTemplateListGet(options?: AxiosRequestConfig): Promise> {
+ return SysCodeGenTemplateApiFp(configuration).apiSysCodeGenTemplateListGet(options).then((request) => request(axios, basePath));
+ },
+ };
+};
+
+/**
+ * SysCodeGenTemplateApi - object-oriented interface
+ * @export
+ * @class SysCodeGenTemplateApi
+ * @extends {BaseAPI}
+ */
+export class SysCodeGenTemplateApi extends BaseAPI {
+ /**
+ * 获取代码生成模板配置列表
+ * @summary 获取代码生成模板配置列表
+ * @param {*} [options] Override http request option.
+ * @throws {RequiredError}
+ * @memberof SysCodeGenTemplateApi
+ */
+ public async apiSysCodeGenTemplateListGet(options?: AxiosRequestConfig) : Promise> {
+ return SysCodeGenTemplateApiFp(this.configuration).apiSysCodeGenTemplateListGet(options).then((request) => request(this.axios, this.basePath));
+ }
+}
diff --git a/Web/src/api-services/models/add-code-gen-input.ts b/Web/src/api-services/models/add-code-gen-input.ts
index 1e25cd0e..54c22550 100644
--- a/Web/src/api-services/models/add-code-gen-input.ts
+++ b/Web/src/api-services/models/add-code-gen-input.ts
@@ -241,4 +241,12 @@ export interface AddCodeGenInput {
* @memberof AddCodeGenInput
*/
isApiService?: boolean;
+
+ /**
+ * 模板Id集合
+ *
+ * @type {Array}
+ * @memberof AddCodeGenInput
+ */
+ codeGenTemplateIds?: Array | null;
}
diff --git a/Web/src/api-services/models/admin-result-list-sys-code-gen-template.ts b/Web/src/api-services/models/admin-result-list-sys-code-gen-template.ts
new file mode 100644
index 00000000..f8401322
--- /dev/null
+++ b/Web/src/api-services/models/admin-result-list-sys-code-gen-template.ts
@@ -0,0 +1,71 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Admin.NET 通用权限开发平台
+ * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+import { SysCodeGenTemplate } from './sys-code-gen-template';
+ /**
+ * 全局返回结果
+ *
+ * @export
+ * @interface AdminResultListSysCodeGenTemplate
+ */
+export interface AdminResultListSysCodeGenTemplate {
+
+ /**
+ * 状态码
+ *
+ * @type {number}
+ * @memberof AdminResultListSysCodeGenTemplate
+ */
+ code?: number;
+
+ /**
+ * 类型success、warning、error
+ *
+ * @type {string}
+ * @memberof AdminResultListSysCodeGenTemplate
+ */
+ type?: string | null;
+
+ /**
+ * 错误信息
+ *
+ * @type {string}
+ * @memberof AdminResultListSysCodeGenTemplate
+ */
+ message?: string | null;
+
+ /**
+ * 数据
+ *
+ * @type {Array}
+ * @memberof AdminResultListSysCodeGenTemplate
+ */
+ result?: Array | null;
+
+ /**
+ * 附加数据
+ *
+ * @type {any}
+ * @memberof AdminResultListSysCodeGenTemplate
+ */
+ extras?: any | null;
+
+ /**
+ * 时间
+ *
+ * @type {Date}
+ * @memberof AdminResultListSysCodeGenTemplate
+ */
+ time?: Date;
+}
diff --git a/Web/src/api-services/models/code-gen-type-enum.ts b/Web/src/api-services/models/code-gen-type-enum.ts
new file mode 100644
index 00000000..832a9371
--- /dev/null
+++ b/Web/src/api-services/models/code-gen-type-enum.ts
@@ -0,0 +1,24 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Admin.NET 通用权限开发平台
+ * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+/**
+ * 代码生成类型枚举
前端 Frontend = 1
后端 Backend = 2
+ * @export
+ * @enum {string}
+ */
+export enum CodeGenTypeEnum {
+ NUMBER_1 = 1,
+ NUMBER_2 = 2
+}
+
diff --git a/Web/src/api-services/models/index.ts b/Web/src/api-services/models/index.ts
index 507778cd..a4d00a28 100644
--- a/Web/src/api-services/models/index.ts
+++ b/Web/src/api-services/models/index.ts
@@ -48,6 +48,7 @@ export * from './admin-result-list-menu-output';
export * from './admin-result-list-pos-output';
export * from './admin-result-list-role-output';
export * from './admin-result-list-string';
+export * from './admin-result-list-sys-code-gen-template';
export * from './admin-result-list-sys-config';
export * from './admin-result-list-sys-dict-data';
export * from './admin-result-list-sys-dict-type';
@@ -124,6 +125,7 @@ export * from './card-type-enum';
export * from './change-pwd-input';
export * from './cluster-status';
export * from './code-gen-config';
+export * from './code-gen-type-enum';
export * from './column-ouput';
export * from './column-relation';
export * from './compare-info';
@@ -335,6 +337,8 @@ export * from './sync-input';
export * from './sync-sys-ldap-input';
export * from './sys-code-gen';
export * from './sys-code-gen-config';
+export * from './sys-code-gen-template';
+export * from './sys-code-gen-template-relation';
export * from './sys-config';
export * from './sys-dict-data';
export * from './sys-dict-type';
diff --git a/Web/src/api-services/models/sys-code-gen-template-relation.ts b/Web/src/api-services/models/sys-code-gen-template-relation.ts
new file mode 100644
index 00000000..7c58f915
--- /dev/null
+++ b/Web/src/api-services/models/sys-code-gen-template-relation.ts
@@ -0,0 +1,46 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Admin.NET 通用权限开发平台
+ * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+ /**
+ * 代码生成模板关系表
+ *
+ * @export
+ * @interface SysCodeGenTemplateRelation
+ */
+export interface SysCodeGenTemplateRelation {
+
+ /**
+ * 雪花Id
+ *
+ * @type {number}
+ * @memberof SysCodeGenTemplateRelation
+ */
+ id?: number;
+
+ /**
+ * 代码生成Id
+ *
+ * @type {number}
+ * @memberof SysCodeGenTemplateRelation
+ */
+ codeGenId: number;
+
+ /**
+ * 模板Id
+ *
+ * @type {number}
+ * @memberof SysCodeGenTemplateRelation
+ */
+ templateId: number;
+}
diff --git a/Web/src/api-services/models/sys-code-gen-template.ts b/Web/src/api-services/models/sys-code-gen-template.ts
new file mode 100644
index 00000000..67079890
--- /dev/null
+++ b/Web/src/api-services/models/sys-code-gen-template.ts
@@ -0,0 +1,140 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Admin.NET 通用权限开发平台
+ * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+import { CodeGenTypeEnum } from './code-gen-type-enum';
+import { YesNoEnum } from './yes-no-enum';
+ /**
+ * 代码生成模板配置表
+ *
+ * @export
+ * @interface SysCodeGenTemplate
+ */
+export interface SysCodeGenTemplate {
+
+ /**
+ * 雪花Id
+ *
+ * @type {number}
+ * @memberof SysCodeGenTemplate
+ */
+ id?: number;
+
+ /**
+ * 创建时间
+ *
+ * @type {Date}
+ * @memberof SysCodeGenTemplate
+ */
+ createTime?: Date;
+
+ /**
+ * 更新时间
+ *
+ * @type {Date}
+ * @memberof SysCodeGenTemplate
+ */
+ updateTime?: Date | null;
+
+ /**
+ * 创建者Id
+ *
+ * @type {number}
+ * @memberof SysCodeGenTemplate
+ */
+ createUserId?: number | null;
+
+ /**
+ * 创建者姓名
+ *
+ * @type {string}
+ * @memberof SysCodeGenTemplate
+ */
+ createUserName?: string | null;
+
+ /**
+ * 修改者Id
+ *
+ * @type {number}
+ * @memberof SysCodeGenTemplate
+ */
+ updateUserId?: number | null;
+
+ /**
+ * 修改者姓名
+ *
+ * @type {string}
+ * @memberof SysCodeGenTemplate
+ */
+ updateUserName?: string | null;
+
+ /**
+ * 软删除
+ *
+ * @type {boolean}
+ * @memberof SysCodeGenTemplate
+ */
+ isDelete?: boolean;
+
+ /**
+ * 模板文件名
+ *
+ * @type {string}
+ * @memberof SysCodeGenTemplate
+ */
+ name: string;
+
+ /**
+ * @type {CodeGenTypeEnum}
+ * @memberof SysCodeGenTemplate
+ */
+ type?: CodeGenTypeEnum;
+
+ /**
+ * @type {YesNoEnum}
+ * @memberof SysCodeGenTemplate
+ */
+ sysFlag?: YesNoEnum;
+
+ /**
+ * 是否默认
+ *
+ * @type {boolean}
+ * @memberof SysCodeGenTemplate
+ */
+ isDefault?: boolean | null;
+
+ /**
+ * 输出位置
+ *
+ * @type {string}
+ * @memberof SysCodeGenTemplate
+ */
+ outputFile: string;
+
+ /**
+ * 描述
+ *
+ * @type {string}
+ * @memberof SysCodeGenTemplate
+ */
+ describe: string;
+
+ /**
+ * 排序
+ *
+ * @type {number}
+ * @memberof SysCodeGenTemplate
+ */
+ orderNo?: number;
+}
diff --git a/Web/src/api-services/models/sys-code-gen.ts b/Web/src/api-services/models/sys-code-gen.ts
index 4d68550a..bfd0d54e 100644
--- a/Web/src/api-services/models/sys-code-gen.ts
+++ b/Web/src/api-services/models/sys-code-gen.ts
@@ -12,6 +12,7 @@
* Do not edit the class manually.
*/
+import { SysCodeGenTemplateRelation } from './sys-code-gen-template-relation';
/**
* 代码生成表
*
@@ -219,4 +220,12 @@ export interface SysCodeGen {
* @memberof SysCodeGen
*/
isApiService?: boolean;
+
+ /**
+ * 模板关系
+ *
+ * @type {Array}
+ * @memberof SysCodeGen
+ */
+ codeGenTemplateRelations?: Array | null;
}
diff --git a/Web/src/api-services/models/update-code-gen-input.ts b/Web/src/api-services/models/update-code-gen-input.ts
index 6096fc31..1d8fbb74 100644
--- a/Web/src/api-services/models/update-code-gen-input.ts
+++ b/Web/src/api-services/models/update-code-gen-input.ts
@@ -242,6 +242,14 @@ export interface UpdateCodeGenInput {
*/
isApiService?: boolean;
+ /**
+ * 模板Id集合
+ *
+ * @type {Array}
+ * @memberof UpdateCodeGenInput
+ */
+ codeGenTemplateIds?: Array | null;
+
/**
* 代码生成器Id
*
@@ -249,12 +257,4 @@ export interface UpdateCodeGenInput {
* @memberof UpdateCodeGenInput
*/
id: number;
-
- /**
- * 模板关系
- *
- * @type {any[]}
- * @memberof UpdateCodeGenInput
- */
- codeGenTemplateRelations:any[];
}
diff --git a/Web/src/utils/toolsValidate.ts b/Web/src/utils/toolsValidate.ts
index f67cffcb..1c5a7e4d 100644
--- a/Web/src/utils/toolsValidate.ts
+++ b/Web/src/utils/toolsValidate.ts
@@ -190,7 +190,7 @@ export function verifyNumberCnUppercase(val: any, unit = '仟佰拾亿仟佰拾
*/
export function verifyPhone(val: string) {
// false: 手机号码不正确
- if (!/^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0|1,5-9]))\d{8}$/.test(val)) return false;
+ if (!/^1[3456789][0-9]{9}$/.test(val)) return false;
// true: 手机号码正确
else return true;
}
diff --git a/Web/src/views/system/codeGen/component/editCodeGenDialog.vue b/Web/src/views/system/codeGen/component/editCodeGenDialog.vue
index d493e681..2022428c 100644
--- a/Web/src/views/system/codeGen/component/editCodeGenDialog.vue
+++ b/Web/src/views/system/codeGen/component/editCodeGenDialog.vue
@@ -3,8 +3,7 @@
-
-
+
{{ props.title }}
@@ -18,18 +17,14 @@
-
-
+
+
-
-
+
+
@@ -60,28 +55,21 @@
-
+
-
+
生成表
-
-
+
+
-
-
+
+
@@ -100,16 +88,21 @@
-
+
-
+ placeholder="请选择上级菜单"
+ :disabled="!state.ruleForm.generateMenu"
+ clearable
+ class="w100"
+ v-model="state.ruleForm.menuPid"
+ @change="menuChange"
+ >
{{ data.title }}
({{ data.children.length }})
@@ -118,13 +111,10 @@
-
+
-
-
+
+
@@ -141,8 +131,7 @@
-
+
@@ -151,11 +140,8 @@
接口模式
-
-
+
+
@@ -167,19 +153,15 @@
-
-
+
+
-
+
-
+
@@ -187,8 +169,7 @@
-
+
@@ -208,14 +189,14 @@