diff --git a/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs b/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs index 752cac3f..d2eaf090 100644 --- a/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs +++ b/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs @@ -133,7 +133,7 @@ namespace Yi.Abp.Web //采用furion格式的规范化api,默认不开启,使用abp优雅的方式 //前置:需要将管道工作单元前加上app.Properties.Add("_AbpExceptionHandlingMiddleware_Added",false); //你没看错。。。 - //service.AddFurionUnifyResultApi(); + service.AddFurionUnifyResultApi(); //配置错误处理显示详情 Configure(options => { options.SendExceptionsDetailsToClients = true; }); @@ -272,6 +272,7 @@ namespace Yi.Abp.Web { options.TokenValidationParameters = new TokenValidationParameters { + RoleClaimType = "Roles", ClockSkew = TimeSpan.Zero, ValidateIssuerSigningKey = true, ValidIssuer = jwtOptions.Issuer, @@ -290,7 +291,8 @@ namespace Yi.Abp.Web } else { - if (messageContext.Request.Cookies.TryGetValue("Token", out var cookiesToken)) + if (!messageContext.Request.Headers.ContainsKey("Authorization") && + messageContext.Request.Cookies.TryGetValue("Token", out var cookiesToken)) { messageContext.Token = cookiesToken; } @@ -395,7 +397,7 @@ namespace Yi.Abp.Web app.UseDefaultFiles(); app.UseDirectoryBrowser("/api/app/wwwroot"); - //app.Properties.Add("_AbpExceptionHandlingMiddleware_Added",false); + app.Properties.Add("_AbpExceptionHandlingMiddleware_Added",false); //工作单元 app.UseUnitOfWork(); diff --git a/Yi.Vben5.Vue3/apps/web-antd/.env.development b/Yi.Vben5.Vue3/apps/web-antd/.env.development index 435f9410..bf40e3e6 100644 --- a/Yi.Vben5.Vue3/apps/web-antd/.env.development +++ b/Yi.Vben5.Vue3/apps/web-antd/.env.development @@ -10,8 +10,7 @@ VITE_DEVTOOLS=false VITE_INJECT_APP_LOADING=true # 后台请求路径 具体在vite.config.mts配置代理 -# VITE_GLOB_API_URL=http://101.37.70.137:19001/api/app -VITE_GLOB_API_URL=http://192.168.1.101:19001/api/app +VITE_GLOB_API_URL=http://localhost:19001/api/app # 全局加密开关(即开启了加解密功能才会生效 不是全部接口加密 需要和后端对应) VITE_GLOB_ENABLE_ENCRYPT=false @@ -22,4 +21,4 @@ VITE_GLOB_RSA_PRIVATE_KEY=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3CuP # 客户端id VITE_GLOB_APP_CLIENT_ID=e5cd7e4891bf95d1d19206ce24a7b32e -VITE_GLOB_DEMO_MODE=false \ No newline at end of file +VITE_GLOB_DEMO_MODE=false diff --git a/Yi.Vben5.Vue3/apps/web-antd/vite.config.mts b/Yi.Vben5.Vue3/apps/web-antd/vite.config.mts index b99db54c..0d69a721 100644 --- a/Yi.Vben5.Vue3/apps/web-antd/vite.config.mts +++ b/Yi.Vben5.Vue3/apps/web-antd/vite.config.mts @@ -27,7 +27,7 @@ export default defineConfig(async () => { changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ''), // mock代理目标地址 - target: 'http://101.37.70.137:19001/api/app', + target: 'http://localhost:19001/api/app', ws: true, }, },