Kaynağa Gözat

优化与适配新前端

zuohuaijun 3 yıl önce
ebeveyn
işleme
ed7395cf60

+ 4 - 4
Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj

@@ -24,9 +24,9 @@
 
   <ItemGroup>
     <PackageReference Include="AspNetCoreRateLimit" Version="4.0.2" />
-    <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.5.6" />
-    <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.5.6" />
-    <PackageReference Include="Furion.Pure" Version="4.5.6" />
+    <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.5.7.1" />
+    <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.5.7.1" />
+    <PackageReference Include="Furion.Pure" Version="4.5.7.1" />
     <PackageReference Include="Magicodes.IE.Excel" Version="2.6.4" />
     <PackageReference Include="Magicodes.IE.Pdf" Version="2.6.4" />
     <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.9" />
@@ -40,7 +40,7 @@
     <PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.20" />
     <PackageReference Include="UAParser" Version="3.1.47" />
     <PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
-    <PackageReference Include="Masuit.Tools.Core" Version="2.5.5" />
+    <PackageReference Include="Masuit.Tools.Core" Version="2.5.5.1" />
   </ItemGroup>
 
   <ItemGroup>

+ 12 - 2
Admin.NET/Admin.NET.Core/Admin.NET.Core.xml

@@ -5270,6 +5270,16 @@
             </summary>
             <returns></returns>
         </member>
+        <member name="P:Admin.NET.Core.Service.MenuInput.Title">
+            <summary>
+            标题
+            </summary>
+        </member>
+        <member name="P:Admin.NET.Core.Service.MenuInput.Type">
+            <summary>
+            菜单类型(1目录 2菜单 3按钮)
+            </summary>
+        </member>
         <member name="P:Admin.NET.Core.Service.AddMenuInput.Title">
             <summary>
             名称
@@ -5428,11 +5438,11 @@
             <param name="input"></param>
             <returns></returns>
         </member>
-        <member name="M:Admin.NET.Core.Service.SysMenuService.CheckMenuParam(Admin.NET.Core.Service.MenuInput)">
+        <member name="M:Admin.NET.Core.Service.SysMenuService.CheckMenuParam(Admin.NET.Core.SysMenu)">
             <summary>
             增加和编辑时检查菜单数据
             </summary>
-            <param name="input"></param>
+            <param name="menu"></param>
         </member>
         <member name="M:Admin.NET.Core.Service.SysMenuService.GetPermCodeList">
             <summary>

+ 2 - 6
Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs

@@ -86,9 +86,7 @@ public class SysAuthService : IDynamicApiController, ITransient
         var refreshToken = JWTEncryption.GenerateRefreshToken(accessToken, _refreshTokenOptions.ExpiredTime);
 
         // 设置响应报文头
-        // _httpContextAccessor.HttpContext.SetTokensOfResponseHeaders(accessToken, refreshToken);
-        _httpContextAccessor.HttpContext.Response.Headers["access-token"] = accessToken;
-        _httpContextAccessor.HttpContext.Response.Headers["x-access-token"] = refreshToken;
+        _httpContextAccessor.HttpContext.SetTokensOfResponseHeaders(accessToken, refreshToken);
 
         // Swagger Knife4UI-AfterScript登录脚本
         // ke.global.setAllHeader('Authorization', 'Bearer ' + ke.response.headers['access-token']);
@@ -176,9 +174,7 @@ public class SysAuthService : IDynamicApiController, ITransient
             throw Oops.Oh(ErrorCodeEnum.D1011);
 
         // 设置响应报文头
-        // _httpContextAccessor.HttpContext.SetTokensOfResponseHeaders("invalid_token", "invalid_token");
-        _httpContextAccessor.HttpContext.Response.Headers["access-token"] = "invalid_token";
-        _httpContextAccessor.HttpContext.Response.Headers["x-access-token"] = "invalid_token";
+        _httpContextAccessor.HttpContext.SetTokensOfResponseHeaders(null, null);
 
         // 退出日志
         await _eventPublisher.PublishAsync("Add:VisLog", new SysLogVis

+ 10 - 3
Admin.NET/Admin.NET.Core/Service/Menu/Dto/MenuInput.cs

@@ -1,13 +1,20 @@
 namespace Admin.NET.Core.Service;
 
-[NotTable]
-public class MenuInput : SysMenu
+public class MenuInput
 {
+    /// <summary>
+    /// 标题
+    /// </summary>
+    public string Title { get; set; }
 
+    /// <summary>
+    /// 菜单类型(1目录 2菜单 3按钮)
+    /// </summary>
+    public MenuTypeEnum Type { get; set; }
 }
 
 [NotTable]
-public class AddMenuInput : MenuInput
+public class AddMenuInput : SysMenu
 {
     /// <summary>
     /// 名称

+ 6 - 6
Admin.NET/Admin.NET.Core/Service/Menu/SysMenuService.cs

@@ -92,7 +92,7 @@ public class SysMenuService : IDynamicApiController, ITransient
             throw Oops.Oh(ErrorCodeEnum.D4000);
 
         // 校验菜单参数
-        CheckMenuParam(input.Adapt<MenuInput>());
+        CheckMenuParam(input.Adapt<SysMenu>());
 
         await _sysMenuRep.InsertAsync(input.Adapt<SysMenu>());
 
@@ -115,7 +115,7 @@ public class SysMenuService : IDynamicApiController, ITransient
             throw Oops.Oh(ErrorCodeEnum.D4000);
 
         // 校验菜单参数
-        CheckMenuParam(input.Adapt<MenuInput>());
+        CheckMenuParam(input.Adapt<SysMenu>());
 
         await _sysMenuRep.AsUpdateable(input.Adapt<SysMenu>()).IgnoreColumns(true).ExecuteCommandAsync();
 
@@ -147,12 +147,12 @@ public class SysMenuService : IDynamicApiController, ITransient
     /// <summary>
     /// 增加和编辑时检查菜单数据
     /// </summary>
-    /// <param name="input"></param>
-    private static void CheckMenuParam(MenuInput input)
+    /// <param name="menu"></param>
+    private static void CheckMenuParam(SysMenu menu)
     {
-        var type = input.Type;
+        var type = menu.Type;
         //var component = input.Component;
-        var permission = input.Permission;
+        var permission = menu.Permission;
         //if (type == (int)MenuTypeEnum.Dir || type == (int)MenuTypeEnum.Menu)
         //{
         //    if (string.IsNullOrEmpty(component))

+ 77 - 0
vue-next-admin/src/api-services/apis/sys-cache-api.ts

@@ -18,6 +18,7 @@ import { Configuration } from '../configuration';
 import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
 import { AdminResultInt32 } from '../models';
 import { AdminResultListString } from '../models';
+import { AdminResultObject } from '../models';
 import { TimeSpan } from '../models';
 /**
  * SysCacheApi - axios parameter creator
@@ -163,6 +164,47 @@ export const SysCacheApiAxiosParamCreator = function (configuration?: Configurat
                 options: localVarRequestOptions,
             };
         },
+        /**
+         * 
+         * @summary 获取缓存
+         * @param {string} [cacheKey] 
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        sysCacheDetailGet: async (cacheKey?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+            const localVarPath = `/sysCache/detail`;
+            // 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
+
+            if (cacheKey !== undefined) {
+                localVarQueryParameter['cacheKey'] = cacheKey;
+            }
+
+            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,
+            };
+        },
         /**
          * 
          * @summary 获取所有缓存键名
@@ -294,6 +336,20 @@ export const SysCacheApiFp = function(configuration?: Configuration) {
                 return axios.request(axiosRequestArgs);
             };
         },
+        /**
+         * 
+         * @summary 获取缓存
+         * @param {string} [cacheKey] 
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        async sysCacheDetailGet(cacheKey?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultObject>>> {
+            const localVarAxiosArgs = await SysCacheApiAxiosParamCreator(configuration).sysCacheDetailGet(cacheKey, options);
+            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
+                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
+                return axios.request(axiosRequestArgs);
+            };
+        },
         /**
          * 
          * @summary 获取所有缓存键名
@@ -363,6 +419,16 @@ export const SysCacheApiFactory = function (configuration?: Configuration, baseP
         async sysCacheDelByParentKeyGet(prefixKey?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultInt32>> {
             return SysCacheApiFp(configuration).sysCacheDelByParentKeyGet(prefixKey, options).then((request) => request(axios, basePath));
         },
+        /**
+         * 
+         * @summary 获取缓存
+         * @param {string} [cacheKey] 
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        async sysCacheDetailGet(cacheKey?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> {
+            return SysCacheApiFp(configuration).sysCacheDetailGet(cacheKey, options).then((request) => request(axios, basePath));
+        },
         /**
          * 
          * @summary 获取所有缓存键名
@@ -428,6 +494,17 @@ export class SysCacheApi extends BaseAPI {
     public async sysCacheDelByParentKeyGet(prefixKey?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultInt32>> {
         return SysCacheApiFp(this.configuration).sysCacheDelByParentKeyGet(prefixKey, options).then((request) => request(this.axios, this.basePath));
     }
+    /**
+     * 
+     * @summary 获取缓存
+     * @param {string} [cacheKey] 
+     * @param {*} [options] Override http request option.
+     * @throws {RequiredError}
+     * @memberof SysCacheApi
+     */
+    public async sysCacheDetailGet(cacheKey?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> {
+        return SysCacheApiFp(this.configuration).sysCacheDetailGet(cacheKey, options).then((request) => request(this.axios, this.basePath));
+    }
     /**
      * 
      * @summary 获取所有缓存键名

+ 14 - 121
vue-next-admin/src/api-services/apis/sys-menu-api.ts

@@ -21,6 +21,7 @@ import { AdminResultListMenuOutput } from '../models';
 import { AdminResultListString } from '../models';
 import { AdminResultListSysMenu } from '../models';
 import { DeleteMenuInput } from '../models';
+import { MenuTypeEnum } from '../models';
 import { UpdateMenuInput } from '../models';
 /**
  * SysMenuApi - axios parameter creator
@@ -185,29 +186,12 @@ export const SysMenuApiAxiosParamCreator = function (configuration?: Configurati
         /**
          * 
          * @summary 获取菜单列表
-         * @param {number} id 主键Id
-         * @param {number} [pid] 父Id
-         * @param {number} [type] 菜单类型(1目录 2菜单 3按钮)
-         * @param {string} [name] 名称
-         * @param {string} [path] 路由地址
-         * @param {string} [component] 组件路径
-         * @param {string} [permission] 权限标识
-         * @param {string} [redirect] 跳转地址
-         * @param {string} [frameSrc] 内嵌地址
          * @param {string} [title] 标题
-         * @param {string} [icon] 图标
-         * @param {number} [orderNo] 排序
-         * @param {boolean} [hideMenu] 是否显示
-         * @param {boolean} [ignoreKeepAlive] 是否忽略KeepAlive缓存
-         * @param {string} [currentActiveMenu] 当前激活的菜单-用于配置详情页时左侧激活的菜单路径
+         * @param {MenuTypeEnum} [type] 菜单类型(1目录 2菜单 3按钮)
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        sysMenuListGet: async (id: number, pid?: number, type?: number, name?: string, path?: string, component?: string, permission?: string, redirect?: string, frameSrc?: string, title?: string, icon?: string, orderNo?: number, hideMenu?: boolean, ignoreKeepAlive?: boolean, currentActiveMenu?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
-            // verify required parameter 'id' is not null or undefined
-            if (id === null || id === undefined) {
-                throw new RequiredError('id','Required parameter id was null or undefined when calling sysMenuListGet.');
-            }
+        sysMenuListGet: async (title?: string, type?: MenuTypeEnum, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
             const localVarPath = `/sysMenu/list`;
             // use dummy base URL string because the URL constructor only accepts absolute URLs.
             const localVarUrlObj = new URL(localVarPath, 'https://example.com');
@@ -221,64 +205,12 @@ export const SysMenuApiAxiosParamCreator = function (configuration?: Configurati
 
             // authentication Bearer required
 
-            if (pid !== undefined) {
-                localVarQueryParameter['Pid'] = pid;
-            }
-
-            if (type !== undefined) {
-                localVarQueryParameter['Type'] = type;
-            }
-
-            if (name !== undefined) {
-                localVarQueryParameter['Name'] = name;
-            }
-
-            if (path !== undefined) {
-                localVarQueryParameter['Path'] = path;
-            }
-
-            if (component !== undefined) {
-                localVarQueryParameter['Component'] = component;
-            }
-
-            if (permission !== undefined) {
-                localVarQueryParameter['Permission'] = permission;
-            }
-
-            if (redirect !== undefined) {
-                localVarQueryParameter['Redirect'] = redirect;
-            }
-
-            if (frameSrc !== undefined) {
-                localVarQueryParameter['FrameSrc'] = frameSrc;
-            }
-
             if (title !== undefined) {
                 localVarQueryParameter['Title'] = title;
             }
 
-            if (icon !== undefined) {
-                localVarQueryParameter['Icon'] = icon;
-            }
-
-            if (orderNo !== undefined) {
-                localVarQueryParameter['OrderNo'] = orderNo;
-            }
-
-            if (hideMenu !== undefined) {
-                localVarQueryParameter['HideMenu'] = hideMenu;
-            }
-
-            if (ignoreKeepAlive !== undefined) {
-                localVarQueryParameter['IgnoreKeepAlive'] = ignoreKeepAlive;
-            }
-
-            if (currentActiveMenu !== undefined) {
-                localVarQueryParameter['CurrentActiveMenu'] = currentActiveMenu;
-            }
-
-            if (id !== undefined) {
-                localVarQueryParameter['Id'] = id;
+            if (type !== undefined) {
+                localVarQueryParameter['Type'] = type;
             }
 
             const query = new URLSearchParams(localVarUrlObj.search);
@@ -404,26 +336,13 @@ export const SysMenuApiFp = function(configuration?: Configuration) {
         /**
          * 
          * @summary 获取菜单列表
-         * @param {number} id 主键Id
-         * @param {number} [pid] 父Id
-         * @param {number} [type] 菜单类型(1目录 2菜单 3按钮)
-         * @param {string} [name] 名称
-         * @param {string} [path] 路由地址
-         * @param {string} [component] 组件路径
-         * @param {string} [permission] 权限标识
-         * @param {string} [redirect] 跳转地址
-         * @param {string} [frameSrc] 内嵌地址
          * @param {string} [title] 标题
-         * @param {string} [icon] 图标
-         * @param {number} [orderNo] 排序
-         * @param {boolean} [hideMenu] 是否显示
-         * @param {boolean} [ignoreKeepAlive] 是否忽略KeepAlive缓存
-         * @param {string} [currentActiveMenu] 当前激活的菜单-用于配置详情页时左侧激活的菜单路径
+         * @param {MenuTypeEnum} [type] 菜单类型(1目录 2菜单 3按钮)
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async sysMenuListGet(id: number, pid?: number, type?: number, name?: string, path?: string, component?: string, permission?: string, redirect?: string, frameSrc?: string, title?: string, icon?: string, orderNo?: number, hideMenu?: boolean, ignoreKeepAlive?: boolean, currentActiveMenu?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListSysMenu>>> {
-            const localVarAxiosArgs = await SysMenuApiAxiosParamCreator(configuration).sysMenuListGet(id, pid, type, name, path, component, permission, redirect, frameSrc, title, icon, orderNo, hideMenu, ignoreKeepAlive, currentActiveMenu, options);
+        async sysMenuListGet(title?: string, type?: MenuTypeEnum, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListSysMenu>>> {
+            const localVarAxiosArgs = await SysMenuApiAxiosParamCreator(configuration).sysMenuListGet(title, type, options);
             return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                 const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                 return axios.request(axiosRequestArgs);
@@ -493,26 +412,13 @@ export const SysMenuApiFactory = function (configuration?: Configuration, basePa
         /**
          * 
          * @summary 获取菜单列表
-         * @param {number} id 主键Id
-         * @param {number} [pid] 父Id
-         * @param {number} [type] 菜单类型(1目录 2菜单 3按钮)
-         * @param {string} [name] 名称
-         * @param {string} [path] 路由地址
-         * @param {string} [component] 组件路径
-         * @param {string} [permission] 权限标识
-         * @param {string} [redirect] 跳转地址
-         * @param {string} [frameSrc] 内嵌地址
          * @param {string} [title] 标题
-         * @param {string} [icon] 图标
-         * @param {number} [orderNo] 排序
-         * @param {boolean} [hideMenu] 是否显示
-         * @param {boolean} [ignoreKeepAlive] 是否忽略KeepAlive缓存
-         * @param {string} [currentActiveMenu] 当前激活的菜单-用于配置详情页时左侧激活的菜单路径
+         * @param {MenuTypeEnum} [type] 菜单类型(1目录 2菜单 3按钮)
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async sysMenuListGet(id: number, pid?: number, type?: number, name?: string, path?: string, component?: string, permission?: string, redirect?: string, frameSrc?: string, title?: string, icon?: string, orderNo?: number, hideMenu?: boolean, ignoreKeepAlive?: boolean, currentActiveMenu?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListSysMenu>> {
-            return SysMenuApiFp(configuration).sysMenuListGet(id, pid, type, name, path, component, permission, redirect, frameSrc, title, icon, orderNo, hideMenu, ignoreKeepAlive, currentActiveMenu, options).then((request) => request(axios, basePath));
+        async sysMenuListGet(title?: string, type?: MenuTypeEnum, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListSysMenu>> {
+            return SysMenuApiFp(configuration).sysMenuListGet(title, type, options).then((request) => request(axios, basePath));
         },
         /**
          * 
@@ -579,27 +485,14 @@ export class SysMenuApi extends BaseAPI {
     /**
      * 
      * @summary 获取菜单列表
-     * @param {number} id 主键Id
-     * @param {number} [pid] 父Id
-     * @param {number} [type] 菜单类型(1目录 2菜单 3按钮)
-     * @param {string} [name] 名称
-     * @param {string} [path] 路由地址
-     * @param {string} [component] 组件路径
-     * @param {string} [permission] 权限标识
-     * @param {string} [redirect] 跳转地址
-     * @param {string} [frameSrc] 内嵌地址
      * @param {string} [title] 标题
-     * @param {string} [icon] 图标
-     * @param {number} [orderNo] 排序
-     * @param {boolean} [hideMenu] 是否显示
-     * @param {boolean} [ignoreKeepAlive] 是否忽略KeepAlive缓存
-     * @param {string} [currentActiveMenu] 当前激活的菜单-用于配置详情页时左侧激活的菜单路径
+     * @param {MenuTypeEnum} [type] 菜单类型(1目录 2菜单 3按钮)
      * @param {*} [options] Override http request option.
      * @throws {RequiredError}
      * @memberof SysMenuApi
      */
-    public async sysMenuListGet(id: number, pid?: number, type?: number, name?: string, path?: string, component?: string, permission?: string, redirect?: string, frameSrc?: string, title?: string, icon?: string, orderNo?: number, hideMenu?: boolean, ignoreKeepAlive?: boolean, currentActiveMenu?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListSysMenu>> {
-        return SysMenuApiFp(this.configuration).sysMenuListGet(id, pid, type, name, path, component, permission, redirect, frameSrc, title, icon, orderNo, hideMenu, ignoreKeepAlive, currentActiveMenu, options).then((request) => request(this.axios, this.basePath));
+    public async sysMenuListGet(title?: string, type?: MenuTypeEnum, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListSysMenu>> {
+        return SysMenuApiFp(this.configuration).sysMenuListGet(title, type, options).then((request) => request(this.axios, this.basePath));
     }
     /**
      * 

+ 79 - 22
vue-next-admin/src/api-services/models/add-menu-input.ts

@@ -11,6 +11,9 @@
  * https://github.com/swagger-api/swagger-codegen.git
  * Do not edit the class manually.
  */
+import { MenuTypeEnum } from './menu-type-enum';
+import { StatusEnum } from './status-enum';
+import { SysMenu } from './sys-menu';
 /**
  * 
  * @export
@@ -18,11 +21,41 @@
  */
 export interface AddMenuInput {
     /**
-     * 主键Id
+     * 雪花Id
      * @type {number}
      * @memberof AddMenuInput
      */
-    id: number;
+    id?: number;
+    /**
+     * 创建时间
+     * @type {Date}
+     * @memberof AddMenuInput
+     */
+    createTime?: Date | null;
+    /**
+     * 更新时间
+     * @type {Date}
+     * @memberof AddMenuInput
+     */
+    updateTime?: Date | null;
+    /**
+     * 创建者Id
+     * @type {number}
+     * @memberof AddMenuInput
+     */
+    createUserId?: number | null;
+    /**
+     * 修改者Id
+     * @type {number}
+     * @memberof AddMenuInput
+     */
+    updateUserId?: number | null;
+    /**
+     * 软删除
+     * @type {boolean}
+     * @memberof AddMenuInput
+     */
+    isDelete?: boolean;
     /**
      * 父Id
      * @type {number}
@@ -30,11 +63,11 @@ export interface AddMenuInput {
      */
     pid?: number;
     /**
-     * 菜单类型(1目录 2菜单 3按钮)
-     * @type {number}
+     * 
+     * @type {MenuTypeEnum}
      * @memberof AddMenuInput
      */
-    type?: number;
+    type?: MenuTypeEnum;
     /**
      * 名称
      * @type {string}
@@ -53,6 +86,12 @@ export interface AddMenuInput {
      * @memberof AddMenuInput
      */
     component?: string | null;
+    /**
+     * 重定向
+     * @type {string}
+     * @memberof AddMenuInput
+     */
+    redirect?: string | null;
     /**
      * 权限标识
      * @type {string}
@@ -60,49 +99,67 @@ export interface AddMenuInput {
      */
     permission?: string | null;
     /**
-     * 跳转地址
+     * 图标
      * @type {string}
      * @memberof AddMenuInput
      */
-    redirect?: string | null;
+    icon?: string | null;
     /**
-     * 内嵌地址
-     * @type {string}
+     * 是否内嵌
+     * @type {boolean}
      * @memberof AddMenuInput
      */
-    frameSrc?: string | null;
+    isIframe?: boolean;
     /**
-     * 图标
+     * 外链链接
      * @type {string}
      * @memberof AddMenuInput
      */
-    icon?: string | null;
+    outLink?: string | null;
     /**
-     * 排序
-     * @type {number}
+     * 是否隐藏
+     * @type {boolean}
      * @memberof AddMenuInput
      */
-    orderNo?: number;
+    isHide?: boolean;
     /**
-     * 是否显示
+     * 是否缓存
      * @type {boolean}
      * @memberof AddMenuInput
      */
-    hideMenu?: boolean;
+    isKeepAlive?: boolean;
     /**
-     * 是否忽略KeepAlive缓存
+     * 是否固定
      * @type {boolean}
      * @memberof AddMenuInput
      */
-    ignoreKeepAlive?: boolean;
+    isAffix?: boolean;
+    /**
+     * 排序
+     * @type {number}
+     * @memberof AddMenuInput
+     */
+    orderNo?: number;
+    /**
+     * 
+     * @type {StatusEnum}
+     * @memberof AddMenuInput
+     */
+    status?: StatusEnum;
     /**
-     * 当前激活的菜单-用于配置详情页时左侧激活的菜单路径
+     * 备注
      * @type {string}
      * @memberof AddMenuInput
      */
-    currentActiveMenu?: string | null;
+    remark?: string | null;
+    /**
+     * 菜单子项
+     * @type {Array<SysMenu>}
+     * @memberof AddMenuInput
+     */
+    children?: Array<SysMenu> | null;
     /**
-     * 标题
+     * 名称
      * @type {string}
      * @memberof AddMenuInput
      */

+ 6 - 0
vue-next-admin/src/api-services/models/file-output.ts

@@ -23,6 +23,12 @@ export interface FileOutput {
      * @memberof FileOutput
      */
     id?: number;
+    /**
+     * 提供者
+     * @type {string}
+     * @memberof FileOutput
+     */
+    provider?: string | null;
     /**
      * 名称
      * @type {string}

+ 0 - 6
vue-next-admin/src/api-services/models/menu-output.ts

@@ -68,12 +68,6 @@ export interface MenuOutput {
      * @memberof MenuOutput
      */
     redirect?: string | null;
-    /**
-     * 是否可用
-     * @type {boolean}
-     * @memberof MenuOutput
-     */
-    disabled?: boolean;
     /**
      * 
      * @type {SysMenuMeta}

+ 6 - 0
vue-next-admin/src/api-services/models/sys-file.ts

@@ -53,6 +53,12 @@ export interface SysFile {
      * @memberof SysFile
      */
     isDelete?: boolean;
+    /**
+     * 提供者
+     * @type {string}
+     * @memberof SysFile
+     */
+    provider?: string | null;
     /**
      * 仓储名称
      * @type {string}

+ 30 - 11
vue-next-admin/src/api-services/models/sys-menu-meta.ts

@@ -11,6 +11,7 @@
  * https://github.com/swagger-api/swagger-codegen.git
  * Do not edit the class manually.
  */
+import { StatusEnum } from './status-enum';
 /**
  * 菜单Meta配置
  * @export
@@ -30,33 +31,51 @@ export interface SysMenuMeta {
      */
     icon?: string | null;
     /**
-     * 内嵌地址
+     * 是否内嵌
+     * @type {boolean}
+     * @memberof SysMenuMeta
+     */
+    isIframe?: boolean;
+    /**
+     * 外链链接
      * @type {string}
      * @memberof SysMenuMeta
      */
-    frameSrc?: string | null;
+    isLink?: string | null;
     /**
-     * 排序
-     * @type {number}
+     * 是否隐藏
+     * @type {boolean}
      * @memberof SysMenuMeta
      */
-    orderNo?: number;
+    isHide?: boolean;
     /**
-     * 是否显示
+     * 是否缓存
      * @type {boolean}
      * @memberof SysMenuMeta
      */
-    hideMenu?: boolean;
+    isKeepAlive?: boolean;
     /**
-     * 是否忽略KeepAlive缓存
+     * 是否固定
      * @type {boolean}
      * @memberof SysMenuMeta
      */
-    ignoreKeepAlive?: boolean;
+    isAffix?: boolean;
+    /**
+     * 排序
+     * @type {number}
+     * @memberof SysMenuMeta
+     */
+    orderNo?: number;
+    /**
+     * 
+     * @type {StatusEnum}
+     * @memberof SysMenuMeta
+     */
+    status?: StatusEnum;
     /**
-     * 当前激活的菜单-用于配置详情页时左侧激活的菜单路径
+     * 备注
      * @type {string}
      * @memberof SysMenuMeta
      */
-    currentActiveMenu?: string | null;
+    remark?: string | null;
 }

+ 34 - 15
vue-next-admin/src/api-services/models/sys-menu.ts

@@ -12,6 +12,7 @@
  * Do not edit the class manually.
  */
 import { MenuTypeEnum } from './menu-type-enum';
+import { StatusEnum } from './status-enum';
 import { SysMenu } from './sys-menu';
 /**
  * 系统菜单表
@@ -85,12 +86,6 @@ export interface SysMenu {
      * @memberof SysMenu
      */
     component?: string | null;
-    /**
-     * 权限标识
-     * @type {string}
-     * @memberof SysMenu
-     */
-    permission?: string | null;
     /**
      * 重定向
      * @type {string}
@@ -98,11 +93,11 @@ export interface SysMenu {
      */
     redirect?: string | null;
     /**
-     * 内嵌地址
+     * 权限标识
      * @type {string}
      * @memberof SysMenu
      */
-    frameSrc?: string | null;
+    permission?: string | null;
     /**
      * 标题
      * @type {string}
@@ -116,29 +111,53 @@ export interface SysMenu {
      */
     icon?: string | null;
     /**
-     * 隐藏菜单
+     * 是否内嵌
      * @type {boolean}
      * @memberof SysMenu
      */
-    hideMenu?: boolean;
+    isIframe?: boolean;
+    /**
+     * 外链链接
+     * @type {string}
+     * @memberof SysMenu
+     */
+    outLink?: string | null;
     /**
-     * 忽略缓存
+     * 是否隐藏
      * @type {boolean}
      * @memberof SysMenu
      */
-    ignoreKeepAlive?: boolean;
+    isHide?: boolean;
     /**
-     * 当前激活的菜单-用于配置详情页时左侧激活的菜单路径
-     * @type {string}
+     * 是否缓存
+     * @type {boolean}
      * @memberof SysMenu
      */
-    currentActiveMenu?: string | null;
+    isKeepAlive?: boolean;
+    /**
+     * 是否固定
+     * @type {boolean}
+     * @memberof SysMenu
+     */
+    isAffix?: boolean;
     /**
      * 排序
      * @type {number}
      * @memberof SysMenu
      */
     orderNo?: number;
+    /**
+     * 
+     * @type {StatusEnum}
+     * @memberof SysMenu
+     */
+    status?: StatusEnum;
+    /**
+     * 备注
+     * @type {string}
+     * @memberof SysMenu
+     */
+    remark?: string | null;
     /**
      * 菜单子项
      * @type {Array<SysMenu>}

+ 79 - 22
vue-next-admin/src/api-services/models/update-menu-input.ts

@@ -11,6 +11,9 @@
  * https://github.com/swagger-api/swagger-codegen.git
  * Do not edit the class manually.
  */
+import { MenuTypeEnum } from './menu-type-enum';
+import { StatusEnum } from './status-enum';
+import { SysMenu } from './sys-menu';
 /**
  * 
  * @export
@@ -18,11 +21,41 @@
  */
 export interface UpdateMenuInput {
     /**
-     * 主键Id
+     * 雪花Id
      * @type {number}
      * @memberof UpdateMenuInput
      */
-    id: number;
+    id?: number;
+    /**
+     * 创建时间
+     * @type {Date}
+     * @memberof UpdateMenuInput
+     */
+    createTime?: Date | null;
+    /**
+     * 更新时间
+     * @type {Date}
+     * @memberof UpdateMenuInput
+     */
+    updateTime?: Date | null;
+    /**
+     * 创建者Id
+     * @type {number}
+     * @memberof UpdateMenuInput
+     */
+    createUserId?: number | null;
+    /**
+     * 修改者Id
+     * @type {number}
+     * @memberof UpdateMenuInput
+     */
+    updateUserId?: number | null;
+    /**
+     * 软删除
+     * @type {boolean}
+     * @memberof UpdateMenuInput
+     */
+    isDelete?: boolean;
     /**
      * 父Id
      * @type {number}
@@ -30,11 +63,11 @@ export interface UpdateMenuInput {
      */
     pid?: number;
     /**
-     * 菜单类型(1目录 2菜单 3按钮)
-     * @type {number}
+     * 
+     * @type {MenuTypeEnum}
      * @memberof UpdateMenuInput
      */
-    type?: number;
+    type?: MenuTypeEnum;
     /**
      * 名称
      * @type {string}
@@ -53,6 +86,12 @@ export interface UpdateMenuInput {
      * @memberof UpdateMenuInput
      */
     component?: string | null;
+    /**
+     * 重定向
+     * @type {string}
+     * @memberof UpdateMenuInput
+     */
+    redirect?: string | null;
     /**
      * 权限标识
      * @type {string}
@@ -60,49 +99,67 @@ export interface UpdateMenuInput {
      */
     permission?: string | null;
     /**
-     * 跳转地址
+     * 图标
      * @type {string}
      * @memberof UpdateMenuInput
      */
-    redirect?: string | null;
+    icon?: string | null;
     /**
-     * 内嵌地址
-     * @type {string}
+     * 是否内嵌
+     * @type {boolean}
      * @memberof UpdateMenuInput
      */
-    frameSrc?: string | null;
+    isIframe?: boolean;
     /**
-     * 图标
+     * 外链链接
      * @type {string}
      * @memberof UpdateMenuInput
      */
-    icon?: string | null;
+    outLink?: string | null;
     /**
-     * 排序
-     * @type {number}
+     * 是否隐藏
+     * @type {boolean}
      * @memberof UpdateMenuInput
      */
-    orderNo?: number;
+    isHide?: boolean;
     /**
-     * 是否显示
+     * 是否缓存
      * @type {boolean}
      * @memberof UpdateMenuInput
      */
-    hideMenu?: boolean;
+    isKeepAlive?: boolean;
     /**
-     * 是否忽略KeepAlive缓存
+     * 是否固定
      * @type {boolean}
      * @memberof UpdateMenuInput
      */
-    ignoreKeepAlive?: boolean;
+    isAffix?: boolean;
+    /**
+     * 排序
+     * @type {number}
+     * @memberof UpdateMenuInput
+     */
+    orderNo?: number;
+    /**
+     * 
+     * @type {StatusEnum}
+     * @memberof UpdateMenuInput
+     */
+    status?: StatusEnum;
     /**
-     * 当前激活的菜单-用于配置详情页时左侧激活的菜单路径
+     * 备注
      * @type {string}
      * @memberof UpdateMenuInput
      */
-    currentActiveMenu?: string | null;
+    remark?: string | null;
+    /**
+     * 菜单子项
+     * @type {Array<SysMenu>}
+     * @memberof UpdateMenuInput
+     */
+    children?: Array<SysMenu> | null;
     /**
-     * 标题
+     * 名称
      * @type {string}
      * @memberof UpdateMenuInput
      */

+ 4 - 3
vue-next-admin/src/utils/axios-utils.ts

@@ -35,11 +35,11 @@ const clearAccessTokens = () => {
 	Local.remove(accessTokenKey);
 	Local.remove(refreshAccessTokenKey);
 
-	// 刷新浏览器
-	window.location.reload();
-
 	// 清除其他
 	Session.clear();
+
+	// 刷新浏览器
+	window.location.reload();
 };
 
 /**
@@ -81,6 +81,7 @@ axiosInstance.interceptors.request.use(
 	(error) => {
 		// 处理请求错误
 		if (error.request) {
+			ElMessage.error(error);
 		}
 
 		// 这里编写请求错误代码

+ 166 - 103
vue-next-admin/src/views/system/menu/index.vue

@@ -1,114 +1,177 @@
 <template>
-	<div class="system-menu-container">
-		<el-card shadow="hover">
-			<div class="system-menu-search mb15">
-				<el-input size="default" placeholder="请输入菜单名称" style="max-width: 180px"> </el-input>
-				<el-button size="default" type="primary" class="ml10">
-					<el-icon>
-						<ele-Search />
-					</el-icon>
-					查询
-				</el-button>
-				<el-button size="default" type="success" class="ml10" @click="onOpenAddMenu">
-					<el-icon>
-						<ele-FolderAdd />
-					</el-icon>
-					新增菜单
-				</el-button>
-			</div>
-			<el-table :data="menuTableData" style="width: 100%" row-key="path" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
-				<el-table-column label="菜单名称" show-overflow-tooltip>
-					<template #default="scope">
-						<SvgIcon :name="scope.row.meta.icon" />
-						<span class="ml10">{{ $t(scope.row.meta.title) }}</span>
-					</template>
-				</el-table-column>
-				<el-table-column prop="path" label="路由路径" show-overflow-tooltip></el-table-column>
-				<el-table-column label="组件路径" show-overflow-tooltip>
-					<template #default="scope">
-						<span>{{ scope.row.component }}</span>
-					</template>
-				</el-table-column>
-				<el-table-column label="权限标识" show-overflow-tooltip>
-					<template #default="scope">
-						<span>{{ scope.row.meta.roles }}</span>
-					</template>
-				</el-table-column>
-				<el-table-column label="排序" show-overflow-tooltip width="80">
-					<template #default="scope">
-						{{ scope.$index }}
-					</template>
-				</el-table-column>
-				<el-table-column label="类型" show-overflow-tooltip width="80">
-					<template #default="scope">
-						<el-tag type="success" size="small">{{ scope.row.xx }}菜单</el-tag>
-					</template>
-				</el-table-column>
-				<el-table-column label="操作" show-overflow-tooltip width="140">
-					<template #default="scope">
-						<el-button size="small" text type="primary" @click="onOpenAddMenu">新增</el-button>
-						<el-button size="small" text type="primary" @click="onOpenEditMenu(scope.row)">修改</el-button>
-						<el-button size="small" text type="primary" @click="onTabelRowDel(scope.row)">删除</el-button>
-					</template>
-				</el-table-column>
-			</el-table>
-		</el-card>
-		<AddMenu ref="addMenuRef" />
-		<EditMenu ref="editMenuRef" />
-	</div>
+  <div class="page-container">
+    <el-card shadow="hover">
+      <el-form :model="queryParams" ref="queryForm" :inline="true">
+        <el-form-item label="菜单名称" prop="title">
+          <el-input placeholder="菜单名称" clearable @keyup.enter="handleQuery" v-model="queryParams.title" />
+        </el-form-item>
+        <el-form-item label="类型" prop="type">
+          <el-select v-model="queryParams.type" placeholder="类型" clearable>
+            <el-option v-for="dict in statusOptions" :key="dict.value" :label="dict.label" :value="dict.value" />
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button @click="resetQuery">
+            <el-icon>
+              <ele-Refresh />
+            </el-icon>
+            重置
+          </el-button>
+          <el-button type="primary" @click="handleQuery">
+            <el-icon>
+              <ele-Search />
+            </el-icon>
+            查询
+          </el-button>
+          <el-button @click="onOpenAddMenu">
+            <el-icon>
+              <ele-Plus />
+            </el-icon>
+            新增
+          </el-button>
+        </el-form-item>
+      </el-form>
+    </el-card>
+
+    <el-card shadow="hover" style="margin-top: 5px;">
+      <el-table :data="menuData" v-loading="loading" row-key="id"
+        :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
+        <el-table-column label="菜单名称" show-overflow-tooltip>
+          <template #default="scope">
+            <SvgIcon :name="scope.row.icon" />
+            <span class="ml10">{{ $t(scope.row.title) }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="类型" show-overflow-tooltip width="80" align="center">
+          <template #default="scope">
+            <el-tag type="warning" v-if="scope.row.type === 1">目录</el-tag>
+            <el-tag v-else-if="scope.row.type === 2">菜单</el-tag>
+            <el-tag type="info" v-else>按钮</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column prop="path" label="路由路径" show-overflow-tooltip></el-table-column>
+        <el-table-column label="组件路径" show-overflow-tooltip>
+          <template #default="scope">
+            <span>{{ scope.row.component }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="权限标识" show-overflow-tooltip>
+          <template #default="scope">
+            <span>{{ scope.row.permission }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="排序" show-overflow-tooltip width="80" align="center">
+          <template #default="scope">
+            {{ scope.row.orderNo }}
+          </template>
+        </el-table-column>
+        <el-table-column label="状态" show-overflow-tooltip width="80" align="center">
+          <template #default="scope">
+            <el-tag type="success" v-if="scope.row.status === 1">启用</el-tag>
+            <el-tag type="danger" v-else>禁用</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column label="修改时间" show-overflow-tooltip align="center">
+          <template #default="scope">
+            {{ scope.row.createTime }}
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" show-overflow-tooltip width="80" fixed="right" align="center">
+          <template #default="scope">
+            <el-button size="small" text type="primary" @click="onOpenEditMenu(scope.row)">
+              <el-icon>
+                <ele-Edit />
+              </el-icon>
+            </el-button>
+            <el-button size="small" text type="primary" @click="onTabelRowDel(scope.row)">
+              <el-icon>
+                <ele-Delete />
+              </el-icon>
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-card>
+    <AddMenu ref="addMenuRef" />
+    <EditMenu ref="editMenuRef" />
+  </div>
 </template>
 
 <script lang="ts">
-import { ref, toRefs, reactive, computed, defineComponent } from 'vue';
-import { RouteRecordRaw } from 'vue-router';
+import { ref, toRefs, reactive, defineComponent, onMounted } from 'vue';
 import { ElMessageBox, ElMessage } from 'element-plus';
-import { storeToRefs } from 'pinia';
-import { useRoutesList } from '/@/stores/routesList';
 import AddMenu from '/@/views/system/menu/component/addMenu.vue';
 import EditMenu from '/@/views/system/menu/component/editMenu.vue';
 
+import { SysMenuApi } from '/@/api-services';
+import { getAPI } from '/@/utils/axios-utils';
+
 export default defineComponent({
-	name: 'systemMenu',
-	components: { AddMenu, EditMenu },
-	setup() {
-		const stores = useRoutesList();
-		const { routesList } = storeToRefs(stores);
-		const addMenuRef = ref();
-		const editMenuRef = ref();
-		const state = reactive({});
-		// 获取 vuex 中的路由
-		const menuTableData = computed(() => {
-			return routesList.value;
-		});
-		// 打开新增菜单弹窗
-		const onOpenAddMenu = () => {
-			addMenuRef.value.openDialog();
-		};
-		// 打开编辑菜单弹窗
-		const onOpenEditMenu = (row: RouteRecordRaw) => {
-			editMenuRef.value.openDialog(row);
-		};
-		// 删除当前行
-		const onTabelRowDel = (row: RouteRecordRaw) => {
-			ElMessageBox.confirm(`此操作将永久删除路由:${row.path}, 是否继续?`, '提示', {
-				confirmButtonText: '删除',
-				cancelButtonText: '取消',
-				type: 'warning',
-			})
-				.then(() => {
-					ElMessage.success('删除成功');
-				})
-				.catch(() => {});
-		};
-		return {
-			addMenuRef,
-			editMenuRef,
-			onOpenAddMenu,
-			onOpenEditMenu,
-			menuTableData,
-			onTabelRowDel,
-			...toRefs(state),
-		};
-	},
+  name: 'systemMenu',
+  components: { AddMenu, EditMenu },
+  setup() {
+    const addMenuRef = ref();
+    const editMenuRef = ref();
+    const state: any = reactive({
+      // 遮罩层
+      loading: true,
+      // 菜单数据
+      menuData: [],
+      // 查询参数
+      queryParams: {
+        title: undefined,
+        type: undefined,
+      },
+      // 菜单状态数据字典
+      statusOptions: [{ value: 1, label: "目录" }, { value: 2, label: "菜单" }, { value: 3, label: "按钮" }],
+    });
+    onMounted(async () => {
+      handleQuery();
+    });
+    // 查询操作
+    const handleQuery = async () => {
+      state.loading = true;
+      var res = await getAPI(SysMenuApi).sysMenuListGet(state.queryParams.title, state.queryParams.type);
+      state.menuData = res.data.result;
+      state.loading = false;
+    };
+    // 重置操作
+    const resetQuery = () => {
+      state.queryParams.title = undefined;
+      state.queryParams.type = undefined;
+      handleQuery();
+    };
+    // 打开新增页面
+    const onOpenAddMenu = () => {
+      addMenuRef.value.openDialog();
+    };
+    // 打开编辑页面
+    const onOpenEditMenu = (row: any) => {
+      editMenuRef.value.openDialog(row);
+    };
+    // 删除当前行
+    const onTabelRowDel = (row: any) => {
+      ElMessageBox.confirm(`确定删除菜单:【${row.title}】?`, '提示', {
+        confirmButtonText: '删除',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(async () => {
+          await getAPI(SysMenuApi).sysMenuDeletePost({ id: row.id });
+          ElMessage.success('删除成功');
+        })
+        .catch(() => { });
+    };
+    return {
+      handleQuery,
+      resetQuery,
+      addMenuRef,
+      editMenuRef,
+      onOpenAddMenu,
+      onOpenEditMenu,
+      onTabelRowDel,
+      ...toRefs(state),
+    };
+  },
 });
 </script>