diff --git a/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj b/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj index 63eb54fc..0d9d77e1 100644 --- a/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj +++ b/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj @@ -52,7 +52,7 @@ - + diff --git a/Admin.NET/Admin.NET.Core/Service/Common/SysCommonService.cs b/Admin.NET/Admin.NET.Core/Service/Common/SysCommonService.cs index 95a5ae7a..8f90f7e7 100644 --- a/Admin.NET/Admin.NET.Core/Service/Common/SysCommonService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Common/SysCommonService.cs @@ -78,7 +78,7 @@ public class SysCommonService : IDynamicApiController, ITransient /// /// [DisplayName("获取所有接口/动态API")] - public List GetSysAllApiList() + public List GetAllSysApiList() { return _sysCacheService.GetOrAdd(CacheConst.KeyAllApi, _ => { @@ -162,7 +162,7 @@ public class SysCommonService : IDynamicApiController, ITransient return _sysCacheService.GetOrAdd(CacheConst.KeyAppApi, _ => { List appApiList = []; - var allApiList = GetSysAllApiList(); + var allApiList = GetAllSysApiList(); foreach (var apiOutput in allApiList) { foreach (var controller in apiOutput.Children) @@ -184,7 +184,7 @@ public class SysCommonService : IDynamicApiController, ITransient var defaultRoutePrefix = App.GetOptions().DefaultRoutePrefix; var apiPath = Path.Combine(App.WebHostEnvironment.ContentRootPath, @"App\api"); - var allApiList = GetSysAllApiList(); + var allApiList = GetAllSysApiList(); foreach (var apiOutput in allApiList) { foreach (var controller in apiOutput.Children) diff --git a/Admin.NET/Admin.NET.Core/Service/Role/SysRoleService.cs b/Admin.NET/Admin.NET.Core/Service/Role/SysRoleService.cs index 4ac9f4d3..c6ecdee0 100644 --- a/Admin.NET/Admin.NET.Core/Service/Role/SysRoleService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Role/SysRoleService.cs @@ -412,7 +412,7 @@ public class SysRoleService : IDynamicApiController, ITransient // 超管账号获取所有接口 if (_userManager.SuperAdmin) { - var allApiList = _sysCommonService.GetSysAllApiList(); + var allApiList = _sysCommonService.GetAllSysApiList(); foreach (var apiOutput in allApiList) { foreach (var controller in apiOutput.Children) diff --git a/Web/package.json b/Web/package.json index fbfba2e7..b518fcf6 100644 --- a/Web/package.json +++ b/Web/package.json @@ -99,7 +99,7 @@ "@vitejs/plugin-vue-jsx": "^5.1.1", "@vue/compiler-sfc": "^3.5.21", "cli-progress": "^3.12.0", - "code-inspector-plugin": "^1.2.8", + "code-inspector-plugin": "^1.2.10", "colors": "^1.4.0", "dotenv": "^17.2.1", "eslint": "^9.35.0", @@ -155,4 +155,4 @@ "vue-next-admin", "next-admin" ] -} +} \ No newline at end of file diff --git a/Web/src/api-services/system/apis/sys-common-api.ts b/Web/src/api-services/system/apis/sys-common-api.ts index 4d0e5753..df50e148 100644 --- a/Web/src/api-services/system/apis/sys-common-api.ts +++ b/Web/src/api-services/system/apis/sys-common-api.ts @@ -30,6 +30,49 @@ import { StressTestInput } from '../models'; */ export const SysCommonApiAxiosParamCreator = function (configuration?: Configuration) { return { + /** + * + * @summary 获取所有接口/动态API 🔖 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysCommonAllSysApiListGet: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysCommon/allSysApiList`; + // 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, + }; + }, /** * * @summary 获取所有移动端接口 🔖 @@ -456,49 +499,6 @@ export const SysCommonApiAxiosParamCreator = function (configuration?: Configura const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 获取所有接口/动态API 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysCommonSysAllApiListGet: async (options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysCommon/sysAllApiList`; - // 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, @@ -513,6 +513,19 @@ export const SysCommonApiAxiosParamCreator = function (configuration?: Configura */ export const SysCommonApiFp = function(configuration?: Configuration) { return { + /** + * + * @summary 获取所有接口/动态API 🔖 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCommonAllSysApiListGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCommonApiAxiosParamCreator(configuration).apiSysCommonAllSysApiListGet(options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, /** * * @summary 获取所有移动端接口 🔖 @@ -638,19 +651,6 @@ export const SysCommonApiFp = function(configuration?: Configuration) { return axios.request(axiosRequestArgs); }; }, - /** - * - * @summary 获取所有接口/动态API 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCommonSysAllApiListGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysCommonApiAxiosParamCreator(configuration).apiSysCommonSysAllApiListGet(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, } }; @@ -660,6 +660,15 @@ export const SysCommonApiFp = function(configuration?: Configuration) { */ export const SysCommonApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { + /** + * + * @summary 获取所有接口/动态API 🔖 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCommonAllSysApiListGet(options?: AxiosRequestConfig): Promise> { + return SysCommonApiFp(configuration).apiSysCommonAllSysApiListGet(options).then((request) => request(axios, basePath)); + }, /** * * @summary 获取所有移动端接口 🔖 @@ -749,15 +758,6 @@ export const SysCommonApiFactory = function (configuration?: Configuration, base async apiSysCommonStressTestPost(body?: StressTestInput, options?: AxiosRequestConfig): Promise> { return SysCommonApiFp(configuration).apiSysCommonStressTestPost(body, options).then((request) => request(axios, basePath)); }, - /** - * - * @summary 获取所有接口/动态API 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCommonSysAllApiListGet(options?: AxiosRequestConfig): Promise> { - return SysCommonApiFp(configuration).apiSysCommonSysAllApiListGet(options).then((request) => request(axios, basePath)); - }, }; }; @@ -768,6 +768,16 @@ export const SysCommonApiFactory = function (configuration?: Configuration, base * @extends {BaseAPI} */ export class SysCommonApi extends BaseAPI { + /** + * + * @summary 获取所有接口/动态API 🔖 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysCommonApi + */ + public async apiSysCommonAllSysApiListGet(options?: AxiosRequestConfig) : Promise> { + return SysCommonApiFp(this.configuration).apiSysCommonAllSysApiListGet(options).then((request) => request(this.axios, this.basePath)); + } /** * * @summary 获取所有移动端接口 🔖 @@ -866,14 +876,4 @@ export class SysCommonApi extends BaseAPI { public async apiSysCommonStressTestPost(body?: StressTestInput, options?: AxiosRequestConfig) : Promise> { return SysCommonApiFp(this.configuration).apiSysCommonStressTestPost(body, options).then((request) => request(this.axios, this.basePath)); } - /** - * - * @summary 获取所有接口/动态API 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysCommonApi - */ - public async apiSysCommonSysAllApiListGet(options?: AxiosRequestConfig) : Promise> { - return SysCommonApiFp(this.configuration).apiSysCommonSysAllApiListGet(options).then((request) => request(this.axios, this.basePath)); - } } diff --git a/Web/src/views/system/role/component/grantApi.vue b/Web/src/views/system/role/component/grantApi.vue index c1b4b4f6..7116a7f5 100644 --- a/Web/src/views/system/role/component/grantApi.vue +++ b/Web/src/views/system/role/component/grantApi.vue @@ -98,7 +98,7 @@ watch(filterText, (val) => { // 初始化树 const initTreeData = async () => { state.loading = true; - var res = await getAPI(SysCommonApi).apiSysCommonSysAllApiListGet(); + var res = await getAPI(SysCommonApi).apiSysCommonAllSysApiListGet(); var tData = res.data.result ?? []; treeRef.value?.setCheckedKeys([]); // 清空选中值 state.allApiData = tData;