Kaynağa Gözat

修正装配结果提交功能

SunYaLong 1 yıl önce
ebeveyn
işleme
3e72ab7888

+ 2 - 0
ZrAdminNetCore-net7.0/ZR.Admin.WebApi/Controllers/OutStore/OutAssembleRecordController.cs

@@ -18,6 +18,7 @@ using ZR.Service.Business.IBusinessService.Balance;
 using Aliyun.OSS;
 using ZR.Model.Dto.InStore;
 using ZR.Model.Models.InStore;
+using NLog;
 
 namespace ZR.Admin.WebApi.Controllers.OutStore
 {
@@ -32,6 +33,7 @@ namespace ZR.Admin.WebApi.Controllers.OutStore
     [Route("business/OutAssembleRecord")]
     public class OutAssembleRecordController : BaseController
     {
+        static readonly Logger logger = LogManager.GetCurrentClassLogger();
         /// <summary>
         /// 接口
         /// </summary>

+ 0 - 2
ZrAdminNetCore-net7.0/ZR.Admin.WebApi/Filters/VerifyAttribute.cs

@@ -40,10 +40,8 @@ namespace ZR.Admin.WebApi.Filters
             string ip = HttpContextExtension.GetClientUserIp(context.HttpContext);
             string url = context.HttpContext.Request.Path;
             var isAuthed = context.HttpContext.User.Identity.IsAuthenticated;
-
             //使用jwt token校验2020-11-21
             LoginUser info = JwtUtil.GetLoginUser(context.HttpContext);
-
             if (info == null || !isAuthed)
             {
                 string msg = $"请求访问[{url}]失败,无法访问系统资源";

+ 4 - 3
ZrAdminNetCore-net7.0/ZR.Admin.WebApi/NLog.config

@@ -3,7 +3,8 @@
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
       autoReload="true"
-      internalLogLevel="Info"
+	  throwConfigExceptions="true"
+      internalLogLevel="off"
       internalLogFile="nlog-internal.log">
 
 	<!--Nlog 文档参考地址:https://github.com/NLog/NLog/wiki/Getting-started-with-ASP.NET-Core-2-->
@@ -70,9 +71,9 @@
 		<!-- Quartz -->
 		<logger name="Quartz*" minlevel="Trace" maxlevel="Info" final="true" />
 		<logger name="ZR.Admin.WebApi.Extensions.DbExtension" final="true" writeTo="consoleSql,sqlfile"/>
-		<logger name="*" final="true" writeTo="console"/>
+		<!--<logger name="*" final="true" writeTo="console"/>-->
 		
-		<logger name="*" minLevel="Trace" writeTo="allfile" />
+		<logger name="*" final="true" writeTo="console,allfile" />
 		<!--Skip non-critical Microsoft logs and so log only own logs-->
 		<logger name="Microsoft.*,Quartz.Core.QuartzSchedulerThread" maxlevel="Info" final="true" />
 	</rules>

+ 4 - 0
ZrAdminNetCore-net7.0/ZR.Admin.WebApi/Program.cs

@@ -8,9 +8,13 @@ using ZR.Admin.WebApi.Extensions;
 using ZR.Admin.WebApi.Filters;
 using ZR.Admin.WebApi.Middleware;
 using ZR.Admin.WebApi.Hubs;
+using NLog.Web;
 
 var builder = WebApplication.CreateBuilder(args);
 
+
+builder.Host.UseNLog();
+
 // Add services to the container.
 
 builder.Services.AddControllers();

+ 2 - 1
ZrAdminNetCore-net7.0/ZR.Admin.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml → ZrAdminNetCore-net7.0/ZR.Admin.WebApi/Properties/PublishProfiles/FolderProfile.pubxml

@@ -10,8 +10,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
     <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
     <LastUsedPlatform>Any CPU</LastUsedPlatform>
     <PublishProvider>FileSystem</PublishProvider>
-    <PublishUrl>bin\Release\net6.0\publish\</PublishUrl>
+    <PublishUrl>bin\Release\net7.0\publish\</PublishUrl>
     <WebPublishMethod>FileSystem</WebPublishMethod>
+    <_TargetId>Folder</_TargetId>
     <SiteUrlToLaunchAfterPublish />
     <TargetFramework>net7.0</TargetFramework>
     <RuntimeIdentifier>win-x64</RuntimeIdentifier>

+ 5 - 5
ZrAdminNetCore-net7.0/ZR.Admin.WebApi/appsettings.json

@@ -7,12 +7,12 @@
     }
   },
   "ConnectionStrings": {
-    //"conn_db": "Data Source=localhost;port=3306;User ID=sa;Password=sa123456;Database=mytest_db;CharSet=utf8;sslmode=none;",
+    "conn_db": "Data Source=localhost;port=3306;User ID=sa;Password=sa123456;Database=mytest_db;CharSet=utf8;sslmode=none;",
     //"conn_db": "Data Source=39.106.7.239;port=3306;User ID=sa;Password=123456;Database=mytest_db;CharSet=utf8;sslmode=none;",
-    "conn_db": "Data Source=192.168.0.1;port=3306;User ID=sa;Password=123456;Database=mytest_db;CharSet=utf8;sslmode=none;",
+    //"conn_db": "Data Source=192.168.0.1;port=3306;User ID=sa;Password=123456;Database=mytest_db;CharSet=utf8;sslmode=none;",
     "conn_db_type": "0" //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3
   },
-  "urls": "http://localhost:8888", //项目启动url,如果改动端口前端对应devServer也需要进行修改
+  "urls": "http://localhost:8888;http://192.168.137.1:8888", //项目启动url,如果改动端口前端对应devServer也需要进行修改
   "corsUrls": "http://localhost:8887", //跨域地址(前端启动项目,前后端分离单独部署需要设置),多个用","隔开
   "JwtSettings": {
     "Issuer": "ZRAdmin.NET",
@@ -45,9 +45,9 @@
     "SendUser": "@all"
   },
   "gen": {
-    //"conn": "Data Source=localhost;port=3306;User ID=sa;Password=sa123456;Database=mytest_db;CharSet=utf8;sslmode=none;",
+    "conn": "Data Source=localhost;port=3306;User ID=sa;Password=sa123456;Database=mytest_db;CharSet=utf8;sslmode=none;",
     //"conn": "Data Source=39.106.7.239;port=3306;User ID=sa;Password=123456;Database=mytest_db;CharSet=utf8;sslmode=none;",
-    "conn": "Data Source=192.168.0.1;port=3306;User ID=sa;Password=123456;Database=mytest_db;CharSet=utf8;sslmode=none;",
+    //"conn": "Data Source=192.168.0.1;port=3306;User ID=sa;Password=123456;Database=mytest_db;CharSet=utf8;sslmode=none;",
     "dbType": 0, //MySql = 0, SqlServer = 1
     "autoPre": true, //自动去除表前缀
     "author": "admin",