Browse Source

deng lu genggao

shengxuefei 4 years ago
parent
commit
b55aa9a863

+ 326 - 0
WebAPIBase.NetCore/Utils/Computer.cs

@@ -0,0 +1,326 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Management;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WebAPIBase.Utils
+{
+    public class Computer
+    {
+        /// <summary>
+        /// cpu序列号
+        /// </summary>
+        public static string CpuID; //1.cpu序列号
+        /// <summary>
+        /// mac序列号
+        /// </summary>
+        public static string MacAddress; //2.mac序列号
+        /// <summary>
+        /// 硬盘id
+        /// </summary>
+        public static string DiskID; //3.硬盘id
+        /// <summary>
+        /// .ip地址
+        /// </summary>
+        public static string IpAddress; //4.ip地址
+        /// <summary>
+        /// 内存量 单位:M
+        /// </summary>
+
+        public static string TotalPhysicalMemory; //8.内存量 单位:M
+        /// <summary>
+        /// 主板
+        /// </summary>
+
+        public static string MotherboardID;
+
+        static Computer()
+        {
+            CpuID = GetCpuID();
+            MacAddress = GetMacAddress();
+            DiskID = GetDiskID();
+            IpAddress = GetIPAddress();
+            MotherboardID = GetMotherboardID();
+            TotalPhysicalMemory = GetTotalPhysicalMemory();
+
+        }
+        /// <summary>
+        /// 获取CPU序列号代码 
+        /// </summary>
+        /// <returns></returns>
+
+        static string GetCpuID()
+        {
+            try
+            {
+                string cpuInfo = "";//cpu序列号 
+                ManagementClass mc = new ManagementClass("Win32_Processor");
+                ManagementObjectCollection moc = mc.GetInstances();
+                foreach (ManagementObject mo in moc)
+                {
+                    cpuInfo = mo.Properties["ProcessorId"].Value.ToString();
+                }
+                moc = null;
+                mc = null;
+                return cpuInfo;
+            }
+            catch
+            {
+                return "unknow";
+            }
+            finally
+            {
+            }
+
+        }
+
+        /// <summary>
+        /// 获取网卡硬件地址
+        /// </summary>
+        /// <returns></returns>
+
+        static string GetMacAddress()
+        {
+            try
+            {
+                string mac = "";
+                ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
+                ManagementObjectCollection moc = mc.GetInstances();
+                foreach (ManagementObject mo in moc)
+                {
+                    if ((bool)mo["IPEnabled"] == true)
+                    {
+                        mac = mo["MacAddress"].ToString();
+                        break;
+                    }
+                }
+                moc = null;
+                mc = null;
+                return mac;
+            }
+            catch
+            {
+                return "unknow";
+            }
+            finally
+            {
+            }
+
+        }
+
+        /// <summary>
+        /// 获取硬盘ID
+        /// </summary>
+        /// <returns></returns>
+        static string GetDiskID()
+        {
+            try
+            {
+                String HDid = "";
+                ManagementClass mc = new ManagementClass("Win32_DiskDrive");
+                ManagementObjectCollection moc = mc.GetInstances();
+                foreach (ManagementObject mo in moc)
+                {
+                    HDid = (string)mo.Properties["Model"].Value;
+                }
+                moc = null;
+                mc = null;
+                return HDid;
+            }
+            catch
+            {
+                return "unknow";
+            }
+            finally
+            {
+            }
+
+        }
+
+        /// <summary>
+        /// 获取主板序列号
+        /// </summary>
+        /// <returns></returns>
+        private static string GetMotherboardID()
+        {
+            var myMb = new ManagementClass("Win32_BaseBoard").GetInstances();
+            var serial = "";
+            foreach (ManagementObject mb in myMb)
+            {
+                var val = mb.Properties["SerialNumber"].Value;
+                serial += val == null ? "" : val.ToString();
+            }
+            return serial;
+        }
+
+
+        /// <summary>
+        /// 获取IP地址 
+        /// </summary>
+        /// <returns></returns>
+
+        static string GetIPAddress()
+        {
+            try
+            {
+                string st = "";
+                ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
+                ManagementObjectCollection moc = mc.GetInstances();
+                foreach (ManagementObject mo in moc)
+                {
+                    if ((bool)mo["IPEnabled"] == true)
+                    {
+                        //st=mo["IpAddress"].ToString(); 
+                        System.Array ar;
+                        ar = (System.Array)(mo.Properties["IpAddress"].Value);
+                        st = ar.GetValue(0).ToString();
+                        break;
+                    }
+                }
+                moc = null;
+                mc = null;
+                return st;
+            }
+            catch
+            {
+                return "unknow";
+            }
+            finally
+            {
+            }
+
+        }
+
+        /// <summary>
+        /// 操作系统的登录用户名 
+        /// </summary>
+        /// <returns></returns>
+        static string GetUserName()
+        {
+            try
+            {
+                string un = "";
+
+                un = Environment.UserName;
+                return un;
+            }
+            catch
+            {
+                return "unknow";
+            }
+            finally
+            {
+            }
+
+        }
+
+
+
+        /// <summary>
+        /// 获取计算机名
+        /// </summary>
+        /// <returns></returns>
+        static string GetComputerName()
+        {
+            try
+            {
+                return System.Environment.MachineName;
+
+            }
+            catch
+            {
+                return "unknow";
+            }
+            finally
+            {
+            }
+        }
+
+
+
+        /// <summary>
+        /// PC类型 
+        /// </summary>
+        /// <returns></returns>
+        static string GetSystemType()
+        {
+            try
+            {
+                string st = "";
+                ManagementClass mc = new ManagementClass("Win32_ComputerSystem");
+                ManagementObjectCollection moc = mc.GetInstances();
+                foreach (ManagementObject mo in moc)
+                {
+
+                    st = mo["SystemType"].ToString();
+
+                }
+                moc = null;
+                mc = null;
+                return st;
+            }
+            catch
+            {
+                return "unknow";
+            }
+            finally
+            {
+            }
+        }
+
+
+
+        /// <summary>
+        /// 物理内存
+        /// </summary>
+        /// <returns></returns>
+        static string GetTotalPhysicalMemory()
+        {
+            try
+            {
+
+                string st = "";
+                ManagementClass mc = new ManagementClass("Win32_ComputerSystem");
+                ManagementObjectCollection moc = mc.GetInstances();
+                foreach (ManagementObject mo in moc)
+                {
+
+                    st = mo["TotalPhysicalMemory"].ToString();
+
+                }
+                moc = null;
+                mc = null;
+                return st;
+            }
+            catch
+            {
+                return "unknow";
+            }
+            finally
+            {
+            }
+
+        }
+
+        /// <summary>
+        /// 根据cpu序列化,主板id及内存信息生成16为授权码(16位HASH代码)
+        /// </summary>
+        /// <returns></returns>
+        public static string AuthorizationCode(string cpu, string motherBoard, string physicalMemory)
+        {
+            string sensorID = string.Empty;
+            string basicID = cpu + motherBoard + physicalMemory;
+            System.Security.Cryptography.MD5CryptoServiceProvider mD5CryptoServiceProvider = new System.Security.Cryptography.MD5CryptoServiceProvider();
+            byte[] hashedBuff = mD5CryptoServiceProvider.ComputeHash(Encoding.UTF8.GetBytes(basicID));
+            for (int i = 4; i < 12; i++)
+            {
+                sensorID += hashedBuff[i].ToString("X2");
+            }
+            return sensorID;
+        }
+
+    }
+
+}

+ 2 - 1
WebAPIBase.NetCore/Utils/WebAPIBase.Utils.csproj

@@ -1,4 +1,4 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
@@ -16,6 +16,7 @@
     <PackageReference Include="Quartz" Version="3.2.3" />
     <PackageReference Include="System.Drawing.Common" Version="4.7.0" />
     <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.6.0" />
+    <PackageReference Include="System.Management" Version="5.0.0" />
   </ItemGroup>
 
 </Project>

BIN
WebAPIBase.NetCore/WebAPIBase.NetCore.BusinessCoreTests/obj/Debug/netcoreapp3.1/WebAPIBase.NetCore.BusinessCoreTests.assets.cache


BIN
WebAPIBase.NetCore/WebAPIBase.NetCore.BusinessCoreTests/obj/Debug/netcoreapp3.1/WebAPIBase.NetCore.BusinessCoreTests.csprojAssemblyReference.cache


BIN
WebAPIBase.NetCore/WebAPIBase.NetCore.BusinessCoreTests/obj/Release/netcoreapp3.1/WebAPIBase.NetCore.BusinessCoreTests.assets.cache


BIN
WebAPIBase.NetCore/WebAPIBase.NetCore.BusinessCoreTests/obj/Release/netcoreapp3.1/WebAPIBase.NetCore.BusinessCoreTests.csprojAssemblyReference.cache


+ 29 - 25
WebAPIBase.NetCore/WebAPIBase.NetCore.BusinessCoreTests/obj/WebAPIBase.NetCore.BusinessCoreTests.csproj.nuget.dgspec.json

@@ -1,17 +1,17 @@
 {
   "format": 1,
   "restore": {
-    "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\WebAPIBase.NetCore.BusinessCoreTests.csproj": {}
+    "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\WebAPIBase.NetCore.BusinessCoreTests.csproj": {}
   },
   "projects": {
-    "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\Utils\\WebAPIBase.Utils.csproj": {
+    "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\Utils\\WebAPIBase.Utils.csproj": {
       "version": "1.0.0",
       "restore": {
-        "projectUniqueName": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\Utils\\WebAPIBase.Utils.csproj",
+        "projectUniqueName": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\Utils\\WebAPIBase.Utils.csproj",
         "projectName": "WebAPIBase.Utils",
-        "projectPath": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\Utils\\WebAPIBase.Utils.csproj",
+        "projectPath": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\Utils\\WebAPIBase.Utils.csproj",
         "packagesPath": "C:\\Users\\1\\.nuget\\packages\\",
-        "outputPath": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\Utils\\obj\\",
+        "outputPath": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\Utils\\obj\\",
         "projectStyle": "PackageReference",
         "fallbackFolders": [
           "D:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
@@ -93,6 +93,10 @@
             "System.IdentityModel.Tokens.Jwt": {
               "target": "Package",
               "version": "[5.6.0, )"
+            },
+            "System.Management": {
+              "target": "Package",
+              "version": "[5.0.0, )"
             }
           },
           "imports": [
@@ -109,14 +113,14 @@
         }
       }
     },
-    "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\WebAPIBase.NetCore.BusinessCoreTests.csproj": {
+    "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\WebAPIBase.NetCore.BusinessCoreTests.csproj": {
       "version": "1.0.0",
       "restore": {
-        "projectUniqueName": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\WebAPIBase.NetCore.BusinessCoreTests.csproj",
+        "projectUniqueName": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\WebAPIBase.NetCore.BusinessCoreTests.csproj",
         "projectName": "WebAPIBase.NetCore.BusinessCoreTests",
-        "projectPath": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\WebAPIBase.NetCore.BusinessCoreTests.csproj",
+        "projectPath": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\WebAPIBase.NetCore.BusinessCoreTests.csproj",
         "packagesPath": "C:\\Users\\1\\.nuget\\packages\\",
-        "outputPath": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\obj\\",
+        "outputPath": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\obj\\",
         "projectStyle": "PackageReference",
         "fallbackFolders": [
           "D:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
@@ -137,8 +141,8 @@
           "netcoreapp3.1": {
             "targetAlias": "netcoreapp3.1",
             "projectReferences": {
-              "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCore\\WebAPIBase.NetCore.BusinessCore.csproj": {
-                "projectPath": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCore\\WebAPIBase.NetCore.BusinessCore.csproj"
+              "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCore\\WebAPIBase.NetCore.BusinessCore.csproj": {
+                "projectPath": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCore\\WebAPIBase.NetCore.BusinessCore.csproj"
               }
             }
           }
@@ -189,14 +193,14 @@
         }
       }
     },
-    "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCore\\WebAPIBase.NetCore.BusinessCore.csproj": {
+    "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCore\\WebAPIBase.NetCore.BusinessCore.csproj": {
       "version": "1.0.0",
       "restore": {
-        "projectUniqueName": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCore\\WebAPIBase.NetCore.BusinessCore.csproj",
+        "projectUniqueName": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCore\\WebAPIBase.NetCore.BusinessCore.csproj",
         "projectName": "WebAPIBase.NetCore.BusinessCore",
-        "projectPath": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCore\\WebAPIBase.NetCore.BusinessCore.csproj",
+        "projectPath": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCore\\WebAPIBase.NetCore.BusinessCore.csproj",
         "packagesPath": "C:\\Users\\1\\.nuget\\packages\\",
-        "outputPath": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCore\\obj\\",
+        "outputPath": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCore\\obj\\",
         "projectStyle": "PackageReference",
         "fallbackFolders": [
           "D:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
@@ -217,11 +221,11 @@
           "netstandard2.1": {
             "targetAlias": "netstandard2.1",
             "projectReferences": {
-              "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\Utils\\WebAPIBase.Utils.csproj": {
-                "projectPath": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\Utils\\WebAPIBase.Utils.csproj"
+              "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\Utils\\WebAPIBase.Utils.csproj": {
+                "projectPath": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\Utils\\WebAPIBase.Utils.csproj"
               },
-              "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.Enties\\WebAPIBase.NetCore.Enties.csproj": {
-                "projectPath": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.Enties\\WebAPIBase.NetCore.Enties.csproj"
+              "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.Enties\\WebAPIBase.NetCore.Enties.csproj": {
+                "projectPath": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.Enties\\WebAPIBase.NetCore.Enties.csproj"
               }
             }
           }
@@ -288,14 +292,14 @@
         }
       }
     },
-    "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.Enties\\WebAPIBase.NetCore.Enties.csproj": {
+    "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.Enties\\WebAPIBase.NetCore.Enties.csproj": {
       "version": "1.0.0",
       "restore": {
-        "projectUniqueName": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.Enties\\WebAPIBase.NetCore.Enties.csproj",
+        "projectUniqueName": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.Enties\\WebAPIBase.NetCore.Enties.csproj",
         "projectName": "WebAPIBase.NetCore.Enties",
-        "projectPath": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.Enties\\WebAPIBase.NetCore.Enties.csproj",
+        "projectPath": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.Enties\\WebAPIBase.NetCore.Enties.csproj",
         "packagesPath": "C:\\Users\\1\\.nuget\\packages\\",
-        "outputPath": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.Enties\\obj\\",
+        "outputPath": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.Enties\\obj\\",
         "projectStyle": "PackageReference",
         "fallbackFolders": [
           "D:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
@@ -316,8 +320,8 @@
           "netstandard2.1": {
             "targetAlias": "netstandard2.1",
             "projectReferences": {
-              "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\Utils\\WebAPIBase.Utils.csproj": {
-                "projectPath": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\Utils\\WebAPIBase.Utils.csproj"
+              "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\Utils\\WebAPIBase.Utils.csproj": {
+                "projectPath": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\Utils\\WebAPIBase.Utils.csproj"
               }
             }
           }

+ 118 - 38
WebAPIBase.NetCore/WebAPIBase.NetCore.BusinessCoreTests/obj/project.assets.json

@@ -547,7 +547,7 @@
       "Microsoft.NETCore.Jit/2.0.8": {
         "type": "package"
       },
-      "Microsoft.NETCore.Platforms/3.1.1": {
+      "Microsoft.NETCore.Platforms/5.0.0": {
         "type": "package",
         "compile": {
           "lib/netstandard1.0/_._": {}
@@ -824,12 +824,11 @@
           "ref/netstandard1.3/Microsoft.Win32.Primitives.dll": {}
         }
       },
-      "Microsoft.Win32.Registry/4.4.0": {
+      "Microsoft.Win32.Registry/5.0.0": {
         "type": "package",
         "dependencies": {
-          "Microsoft.NETCore.Platforms": "2.0.0",
-          "System.Security.AccessControl": "4.4.0",
-          "System.Security.Principal.Windows": "4.4.0"
+          "System.Security.AccessControl": "5.0.0",
+          "System.Security.Principal.Windows": "5.0.0"
         },
         "compile": {
           "ref/netstandard2.0/_._": {}
@@ -838,11 +837,7 @@
           "lib/netstandard2.0/Microsoft.Win32.Registry.dll": {}
         },
         "runtimeTargets": {
-          "runtimes/unix/lib/netcoreapp2.0/Microsoft.Win32.Registry.dll": {
-            "assetType": "runtime",
-            "rid": "unix"
-          },
-          "runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.Registry.dll": {
+          "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll": {
             "assetType": "runtime",
             "rid": "win"
           }
@@ -1431,6 +1426,15 @@
           "lib/netstandard1.1/System.Buffers.dll": {}
         }
       },
+      "System.CodeDom/5.0.0": {
+        "type": "package",
+        "compile": {
+          "ref/netstandard2.0/System.CodeDom.dll": {}
+        },
+        "runtime": {
+          "lib/netstandard2.0/System.CodeDom.dll": {}
+        }
+      },
       "System.Collections/4.3.0": {
         "type": "package",
         "dependencies": {
@@ -1971,6 +1975,26 @@
           "lib/netstandard1.6/System.Linq.Expressions.dll": {}
         }
       },
+      "System.Management/5.0.0": {
+        "type": "package",
+        "dependencies": {
+          "Microsoft.NETCore.Platforms": "5.0.0",
+          "Microsoft.Win32.Registry": "5.0.0",
+          "System.CodeDom": "5.0.0"
+        },
+        "compile": {
+          "ref/netstandard2.0/System.Management.dll": {}
+        },
+        "runtime": {
+          "lib/netstandard2.0/System.Management.dll": {}
+        },
+        "runtimeTargets": {
+          "runtimes/win/lib/netcoreapp2.0/System.Management.dll": {
+            "assetType": "runtime",
+            "rid": "win"
+          }
+        }
+      },
       "System.Net.Http/4.3.0": {
         "type": "package",
         "dependencies": {
@@ -2384,11 +2408,11 @@
           "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": {}
         }
       },
-      "System.Security.AccessControl/4.7.0": {
+      "System.Security.AccessControl/5.0.0": {
         "type": "package",
         "dependencies": {
-          "Microsoft.NETCore.Platforms": "3.1.0",
-          "System.Security.Principal.Windows": "4.7.0"
+          "Microsoft.NETCore.Platforms": "5.0.0",
+          "System.Security.Principal.Windows": "5.0.0"
         },
         "compile": {
           "ref/netstandard2.0/System.Security.AccessControl.dll": {}
@@ -2634,7 +2658,7 @@
           "lib/netcoreapp3.0/System.Security.Permissions.dll": {}
         }
       },
-      "System.Security.Principal.Windows/4.7.0": {
+      "System.Security.Principal.Windows/5.0.0": {
         "type": "package",
         "compile": {
           "ref/netcoreapp3.0/System.Security.Principal.Windows.dll": {}
@@ -2970,7 +2994,8 @@
           "NLog.Web.AspNetCore": "4.9.3",
           "Quartz": "3.2.3",
           "System.Drawing.Common": "4.7.0",
-          "System.IdentityModel.Tokens.Jwt": "5.6.0"
+          "System.IdentityModel.Tokens.Jwt": "5.6.0",
+          "System.Management": "5.0.0"
         },
         "compile": {
           "bin/placeholder/WebAPIBase.Utils.dll": {}
@@ -3777,10 +3802,10 @@
         "version.txt"
       ]
     },
-    "Microsoft.NETCore.Platforms/3.1.1": {
-      "sha512": "RmINcaqiEkawM9C8oxFMN/CZmn1fGKWVsosbSY/8ARUNdHqV47hqhPVbrG3qUqLaRQI5w4HuqFOqrbhoSWcH6w==",
+    "Microsoft.NETCore.Platforms/5.0.0": {
+      "sha512": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==",
       "type": "package",
-      "path": "microsoft.netcore.platforms/3.1.1",
+      "path": "microsoft.netcore.platforms/5.0.0",
       "files": [
         ".nupkg.metadata",
         ".signature.p7s",
@@ -3788,7 +3813,7 @@
         "LICENSE.TXT",
         "THIRD-PARTY-NOTICES.TXT",
         "lib/netstandard1.0/_._",
-        "microsoft.netcore.platforms.3.1.1.nupkg.sha512",
+        "microsoft.netcore.platforms.5.0.0.nupkg.sha512",
         "microsoft.netcore.platforms.nuspec",
         "runtime.json",
         "useSharedDesignerContext.txt",
@@ -4085,20 +4110,23 @@
         "ref/xamarinwatchos10/_._"
       ]
     },
-    "Microsoft.Win32.Registry/4.4.0": {
-      "sha512": "dA36TlNVn/XfrZtmf0fiI/z1nd3Wfp2QVzTdj26pqgP9LFWq0i1hYEUAW50xUjGFYn1+/cP3KGuxT2Yn1OUNBQ==",
+    "Microsoft.Win32.Registry/5.0.0": {
+      "sha512": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
       "type": "package",
-      "path": "microsoft.win32.registry/4.4.0",
+      "path": "microsoft.win32.registry/5.0.0",
       "files": [
         ".nupkg.metadata",
         ".signature.p7s",
+        "Icon.png",
         "LICENSE.TXT",
         "THIRD-PARTY-NOTICES.TXT",
         "lib/net46/Microsoft.Win32.Registry.dll",
         "lib/net461/Microsoft.Win32.Registry.dll",
+        "lib/net461/Microsoft.Win32.Registry.xml",
         "lib/netstandard1.3/Microsoft.Win32.Registry.dll",
         "lib/netstandard2.0/Microsoft.Win32.Registry.dll",
-        "microsoft.win32.registry.4.4.0.nupkg.sha512",
+        "lib/netstandard2.0/Microsoft.Win32.Registry.xml",
+        "microsoft.win32.registry.5.0.0.nupkg.sha512",
         "microsoft.win32.registry.nuspec",
         "ref/net46/Microsoft.Win32.Registry.dll",
         "ref/net461/Microsoft.Win32.Registry.dll",
@@ -4116,11 +4144,12 @@
         "ref/netstandard1.3/zh-hant/Microsoft.Win32.Registry.xml",
         "ref/netstandard2.0/Microsoft.Win32.Registry.dll",
         "ref/netstandard2.0/Microsoft.Win32.Registry.xml",
-        "runtimes/unix/lib/netcoreapp2.0/Microsoft.Win32.Registry.dll",
         "runtimes/win/lib/net46/Microsoft.Win32.Registry.dll",
         "runtimes/win/lib/net461/Microsoft.Win32.Registry.dll",
-        "runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.Registry.dll",
+        "runtimes/win/lib/net461/Microsoft.Win32.Registry.xml",
         "runtimes/win/lib/netstandard1.3/Microsoft.Win32.Registry.dll",
+        "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll",
+        "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.xml",
         "useSharedDesignerContext.txt",
         "version.txt"
       ]
@@ -5050,6 +5079,30 @@
         "system.buffers.nuspec"
       ]
     },
+    "System.CodeDom/5.0.0": {
+      "sha512": "JPJArwA1kdj8qDAkY2XGjSWoYnqiM7q/3yRNkt6n28Mnn95MuEGkZXUbPBf7qc3IjwrGY5ttQon7yqHZyQJmOQ==",
+      "type": "package",
+      "path": "system.codedom/5.0.0",
+      "files": [
+        ".nupkg.metadata",
+        ".signature.p7s",
+        "Icon.png",
+        "LICENSE.TXT",
+        "THIRD-PARTY-NOTICES.TXT",
+        "lib/net461/System.CodeDom.dll",
+        "lib/net461/System.CodeDom.xml",
+        "lib/netstandard2.0/System.CodeDom.dll",
+        "lib/netstandard2.0/System.CodeDom.xml",
+        "ref/net461/System.CodeDom.dll",
+        "ref/net461/System.CodeDom.xml",
+        "ref/netstandard2.0/System.CodeDom.dll",
+        "ref/netstandard2.0/System.CodeDom.xml",
+        "system.codedom.5.0.0.nupkg.sha512",
+        "system.codedom.nuspec",
+        "useSharedDesignerContext.txt",
+        "version.txt"
+      ]
+    },
     "System.Collections/4.3.0": {
       "sha512": "3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==",
       "type": "package",
@@ -6733,6 +6786,31 @@
         "system.linq.expressions.nuspec"
       ]
     },
+    "System.Management/5.0.0": {
+      "sha512": "MF1CHaRcC+MLFdnDthv4/bKWBZnlnSpkGqa87pKukQefgEdwtb9zFW6zs0GjPp73qtpYYg4q6PEKbzJbxCpKfw==",
+      "type": "package",
+      "path": "system.management/5.0.0",
+      "files": [
+        ".nupkg.metadata",
+        ".signature.p7s",
+        "Icon.png",
+        "LICENSE.TXT",
+        "THIRD-PARTY-NOTICES.TXT",
+        "lib/net45/_._",
+        "lib/netstandard2.0/System.Management.dll",
+        "lib/netstandard2.0/System.Management.xml",
+        "ref/net45/_._",
+        "ref/netstandard2.0/System.Management.dll",
+        "ref/netstandard2.0/System.Management.xml",
+        "runtimes/win/lib/net45/_._",
+        "runtimes/win/lib/netcoreapp2.0/System.Management.dll",
+        "runtimes/win/lib/netcoreapp2.0/System.Management.xml",
+        "system.management.5.0.0.nupkg.sha512",
+        "system.management.nuspec",
+        "useSharedDesignerContext.txt",
+        "version.txt"
+      ]
+    },
     "System.Net.Http/4.3.0": {
       "sha512": "sYg+FtILtRQuYWSIAuNOELwVuVsxVyJGWQyOnlAzhV4xvhyFnON1bAzYYC+jjRW8JREM45R0R5Dgi8MTC5sEwA==",
       "type": "package",
@@ -8207,13 +8285,14 @@
         "system.runtime.serialization.primitives.nuspec"
       ]
     },
-    "System.Security.AccessControl/4.7.0": {
-      "sha512": "JECvTt5aFF3WT3gHpfofL2MNNP6v84sxtXxpqhLBCcDRzqsPBmHhQ6shv4DwwN2tRlzsUxtb3G9M3763rbXKDg==",
+    "System.Security.AccessControl/5.0.0": {
+      "sha512": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==",
       "type": "package",
-      "path": "system.security.accesscontrol/4.7.0",
+      "path": "system.security.accesscontrol/5.0.0",
       "files": [
         ".nupkg.metadata",
         ".signature.p7s",
+        "Icon.png",
         "LICENSE.TXT",
         "THIRD-PARTY-NOTICES.TXT",
         "lib/net46/System.Security.AccessControl.dll",
@@ -8247,7 +8326,7 @@
         "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.xml",
         "runtimes/win/lib/netstandard1.3/System.Security.AccessControl.dll",
         "runtimes/win/lib/uap10.0.16299/_._",
-        "system.security.accesscontrol.4.7.0.nupkg.sha512",
+        "system.security.accesscontrol.5.0.0.nupkg.sha512",
         "system.security.accesscontrol.nuspec",
         "useSharedDesignerContext.txt",
         "version.txt"
@@ -8603,13 +8682,14 @@
         "version.txt"
       ]
     },
-    "System.Security.Principal.Windows/4.7.0": {
-      "sha512": "ojD0PX0XhneCsUbAZVKdb7h/70vyYMDYs85lwEI+LngEONe/17A0cFaRFqZU+sOEidcVswYWikYOQ9PPfjlbtQ==",
+    "System.Security.Principal.Windows/5.0.0": {
+      "sha512": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==",
       "type": "package",
-      "path": "system.security.principal.windows/4.7.0",
+      "path": "system.security.principal.windows/5.0.0",
       "files": [
         ".nupkg.metadata",
         ".signature.p7s",
+        "Icon.png",
         "LICENSE.TXT",
         "THIRD-PARTY-NOTICES.TXT",
         "lib/net46/System.Security.Principal.Windows.dll",
@@ -8651,7 +8731,7 @@
         "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.xml",
         "runtimes/win/lib/netstandard1.3/System.Security.Principal.Windows.dll",
         "runtimes/win/lib/uap10.0.16299/_._",
-        "system.security.principal.windows.4.7.0.nupkg.sha512",
+        "system.security.principal.windows.5.0.0.nupkg.sha512",
         "system.security.principal.windows.nuspec",
         "useSharedDesignerContext.txt",
         "version.txt"
@@ -9600,11 +9680,11 @@
   "project": {
     "version": "1.0.0",
     "restore": {
-      "projectUniqueName": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\WebAPIBase.NetCore.BusinessCoreTests.csproj",
+      "projectUniqueName": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\WebAPIBase.NetCore.BusinessCoreTests.csproj",
       "projectName": "WebAPIBase.NetCore.BusinessCoreTests",
-      "projectPath": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\WebAPIBase.NetCore.BusinessCoreTests.csproj",
+      "projectPath": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\WebAPIBase.NetCore.BusinessCoreTests.csproj",
       "packagesPath": "C:\\Users\\1\\.nuget\\packages\\",
-      "outputPath": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\obj\\",
+      "outputPath": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\obj\\",
       "projectStyle": "PackageReference",
       "fallbackFolders": [
         "D:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
@@ -9625,8 +9705,8 @@
         "netcoreapp3.1": {
           "targetAlias": "netcoreapp3.1",
           "projectReferences": {
-            "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCore\\WebAPIBase.NetCore.BusinessCore.csproj": {
-              "projectPath": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCore\\WebAPIBase.NetCore.BusinessCore.csproj"
+            "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCore\\WebAPIBase.NetCore.BusinessCore.csproj": {
+              "projectPath": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCore\\WebAPIBase.NetCore.BusinessCore.csproj"
             }
           }
         }

+ 8 - 6
WebAPIBase.NetCore/WebAPIBase.NetCore.BusinessCoreTests/obj/project.nuget.cache

@@ -1,8 +1,8 @@
 {
   "version": 2,
-  "dgSpecHash": "zG9gjv+ljo2OapCOa/OI/C/um7B9PXI26Js5FD6ftSp1oM+1QlpnS7axfSyjhc46K3d9DCPyUXpHjY1XSyrxIg==",
+  "dgSpecHash": "I1izAYQppi0XpRfpJLrNfmfvolB7BCG/IdxlEvYVs3RoFgJSt8E1t6rWM6gzJ79YWalDQxNjjq6JU/2+QeapTQ==",
   "success": true,
-  "projectFilePath": "D:\\路涛科技\\源代码\\dccloud\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\WebAPIBase.NetCore.BusinessCoreTests.csproj",
+  "projectFilePath": "D:\\路涛科技\\源代码\\dccloud 工程云\\WebAPIBase.NetCore\\WebAPIBase.NetCore.BusinessCoreTests\\WebAPIBase.NetCore.BusinessCoreTests.csproj",
   "expectedPackageFiles": [
     "C:\\Users\\1\\.nuget\\packages\\coverlet.collector\\1.2.0\\coverlet.collector.1.2.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\google.protobuf\\3.5.1\\google.protobuf.3.5.1.nupkg.sha512",
@@ -48,13 +48,13 @@
     "C:\\Users\\1\\.nuget\\packages\\microsoft.identitymodel.tokens\\5.6.0\\microsoft.identitymodel.tokens.5.6.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\microsoft.net.test.sdk\\16.5.0\\microsoft.net.test.sdk.16.5.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\microsoft.netcore.jit\\2.0.8\\microsoft.netcore.jit.2.0.8.nupkg.sha512",
-    "C:\\Users\\1\\.nuget\\packages\\microsoft.netcore.platforms\\3.1.1\\microsoft.netcore.platforms.3.1.1.nupkg.sha512",
+    "C:\\Users\\1\\.nuget\\packages\\microsoft.netcore.platforms\\5.0.0\\microsoft.netcore.platforms.5.0.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\microsoft.netcore.runtime.coreclr\\2.0.8\\microsoft.netcore.runtime.coreclr.2.0.8.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\microsoft.netcore.targets\\1.1.0\\microsoft.netcore.targets.1.1.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\microsoft.testplatform.objectmodel\\16.5.0\\microsoft.testplatform.objectmodel.16.5.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\microsoft.testplatform.testhost\\16.5.0\\microsoft.testplatform.testhost.16.5.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\microsoft.win32.primitives\\4.3.0\\microsoft.win32.primitives.4.3.0.nupkg.sha512",
-    "C:\\Users\\1\\.nuget\\packages\\microsoft.win32.registry\\4.4.0\\microsoft.win32.registry.4.4.0.nupkg.sha512",
+    "C:\\Users\\1\\.nuget\\packages\\microsoft.win32.registry\\5.0.0\\microsoft.win32.registry.5.0.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\microsoft.win32.systemevents\\4.7.0\\microsoft.win32.systemevents.4.7.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\mstest.testadapter\\2.1.0\\mstest.testadapter.2.1.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\mstest.testframework\\2.1.0\\mstest.testframework.2.1.0.nupkg.sha512",
@@ -98,6 +98,7 @@
     "C:\\Users\\1\\.nuget\\packages\\sqlsugarcore\\5.0.0.18\\sqlsugarcore.5.0.0.18.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.appcontext\\4.3.0\\system.appcontext.4.3.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.buffers\\4.3.0\\system.buffers.4.3.0.nupkg.sha512",
+    "C:\\Users\\1\\.nuget\\packages\\system.codedom\\5.0.0\\system.codedom.5.0.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.collections\\4.3.0\\system.collections.4.3.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.collections.concurrent\\4.3.0\\system.collections.concurrent.4.3.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.collections.immutable\\1.7.1\\system.collections.immutable.1.7.1.nupkg.sha512",
@@ -130,6 +131,7 @@
     "C:\\Users\\1\\.nuget\\packages\\system.io.filesystem.primitives\\4.3.0\\system.io.filesystem.primitives.4.3.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.linq\\4.3.0\\system.linq.4.3.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.linq.expressions\\4.3.0\\system.linq.expressions.4.3.0.nupkg.sha512",
+    "C:\\Users\\1\\.nuget\\packages\\system.management\\5.0.0\\system.management.5.0.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.net.http\\4.3.0\\system.net.http.4.3.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.net.http.winhttphandler\\4.4.0\\system.net.http.winhttphandler.4.4.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.net.primitives\\4.3.0\\system.net.primitives.4.3.0.nupkg.sha512",
@@ -156,7 +158,7 @@
     "C:\\Users\\1\\.nuget\\packages\\system.runtime.numerics\\4.3.0\\system.runtime.numerics.4.3.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.runtime.serialization.formatters\\4.3.0\\system.runtime.serialization.formatters.4.3.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.runtime.serialization.primitives\\4.3.0\\system.runtime.serialization.primitives.4.3.0.nupkg.sha512",
-    "C:\\Users\\1\\.nuget\\packages\\system.security.accesscontrol\\4.7.0\\system.security.accesscontrol.4.7.0.nupkg.sha512",
+    "C:\\Users\\1\\.nuget\\packages\\system.security.accesscontrol\\5.0.0\\system.security.accesscontrol.5.0.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.security.cryptography.algorithms\\4.3.1\\system.security.cryptography.algorithms.4.3.1.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.security.cryptography.cng\\4.5.0\\system.security.cryptography.cng.4.5.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.security.cryptography.csp\\4.3.0\\system.security.cryptography.csp.4.3.0.nupkg.sha512",
@@ -166,7 +168,7 @@
     "C:\\Users\\1\\.nuget\\packages\\system.security.cryptography.protecteddata\\4.7.0\\system.security.cryptography.protecteddata.4.7.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.security.cryptography.x509certificates\\4.3.0\\system.security.cryptography.x509certificates.4.3.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.security.permissions\\4.7.0\\system.security.permissions.4.7.0.nupkg.sha512",
-    "C:\\Users\\1\\.nuget\\packages\\system.security.principal.windows\\4.7.0\\system.security.principal.windows.4.7.0.nupkg.sha512",
+    "C:\\Users\\1\\.nuget\\packages\\system.security.principal.windows\\5.0.0\\system.security.principal.windows.5.0.0.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.servicemodel.duplex\\4.4.4\\system.servicemodel.duplex.4.4.4.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.servicemodel.http\\4.4.4\\system.servicemodel.http.4.4.4.nupkg.sha512",
     "C:\\Users\\1\\.nuget\\packages\\system.servicemodel.nettcp\\4.4.4\\system.servicemodel.nettcp.4.4.4.nupkg.sha512",

+ 15 - 0
WebAPIBase.NetCore/WebAPIBase.NetCore/Controllers/UserController.cs

@@ -25,6 +25,10 @@ namespace WebAPIBase.API.Controllers
     public class UserController : BaseController
     {
         private string webserviceUrl;
+        /// <summary>
+        /// 授权校验服务地址
+        /// </summary>
+        private string validServiceUrl;
         private static Logger Logger = NLog.LogManager.GetCurrentClassLogger();
         private readonly IHttpClientFactory _httpclientfactory;
         private IMemoryCache _memoryCache;
@@ -45,6 +49,7 @@ namespace WebAPIBase.API.Controllers
 
 
             webserviceUrl = Configuration["Logging:AppSettings:webserviceUrl"];
+            validServiceUrl = Configuration["Logging:AppSettings:validServiceUrl"];
 
             _userManager = userManager;
             _signInManager = signInManager;
@@ -58,6 +63,16 @@ namespace WebAPIBase.API.Controllers
         public JsonResult ValidateUser([FromBody] UserLogin request)
         {
             Console.WriteLine("request:" + JsonConvert.SerializeObject(request));
+
+            #region 授权
+            NameValueCollection values1 = new NameValueCollection();
+            values1.Add("cpu", Computer.CpuID);
+            values1.Add("motherBoard", Computer.MotherboardID);
+            values1.Add("physicalMemory", Computer.TotalPhysicalMemory);
+            var validateResult = WebClientHelper.ClientPost(validServiceUrl + "/api/user", values1);
+            logger.Info($"【validateResult】:{validateResult}");
+            #endregion
+
             NameValueCollection values = new NameValueCollection();
             values.Add("userid", request.UserName);
             values.Add("password", request.Password);

+ 1 - 1
WebAPIBase.NetCore/WebAPIBase.NetCore/Properties/PublishProfiles/FolderProfile.pubxml.user

@@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
     <_PublishTargetUrl>D:\路涛科技\源代码\dccloud\WebAPIBase.NetCore\WebAPIBase.NetCore\bin\Release\netcoreapp3.1\publish\</_PublishTargetUrl>
-    <History>True|2021-04-12T10:19:00.1228169Z;True|2021-04-12T18:12:05.3147749+08:00;True|2021-04-12T18:11:43.1605397+08:00;True|2021-04-12T16:56:13.5039693+08:00;True|2021-04-12T16:48:46.9171692+08:00;True|2021-04-12T16:31:29.7391069+08:00;True|2021-04-12T16:22:03.8910986+08:00;True|2021-04-12T13:46:12.9084815+08:00;</History>
+    <History>True|2021-04-14T08:26:59.6188401Z;True|2021-04-12T18:19:00.1228169+08:00;True|2021-04-12T18:12:05.3147749+08:00;True|2021-04-12T18:11:43.1605397+08:00;True|2021-04-12T16:56:13.5039693+08:00;True|2021-04-12T16:48:46.9171692+08:00;True|2021-04-12T16:31:29.7391069+08:00;True|2021-04-12T16:22:03.8910986+08:00;True|2021-04-12T13:46:12.9084815+08:00;</History>
   </PropertyGroup>
   <ItemGroup>
     <File Include="appsettings.json">

+ 5 - 16
WebAPIBase.NetCore/WebAPIBase.NetCore/Startup.cs

@@ -3,7 +3,6 @@ using Microsoft.AspNetCore.Authentication.JwtBearer;
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Mvc;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
@@ -122,9 +121,7 @@ namespace WebAPIBase.API
                 //c.IncludeXmlComments(xmlPath);
 
             });
-            services
-                .AddMvc(options => options.AllowEmptyInputInBodyModelBinding = false)
-                .SetCompatibilityVersion(CompatibilityVersion.Latest);
+
             //services.AddOpenApiDocument(); // registers a OpenAPI v3.0 document with the name "v1" (default)
             //services.AddSwaggerDocument(configure)
         }
@@ -180,25 +177,17 @@ namespace WebAPIBase.API
 
                 app.UseSwaggerUI(c =>
                 {
-                    c.SwaggerEndpoint("swagger/v1/swagger.json", "ForSignAPIClient v1");
+                    c.SwaggerEndpoint("/swagger/v1/swagger.json", "ForSignAPIClient v1");
                 });
             }
             else   //若是IIS部署,并且是虚拟目录部署
             {
                 logger.Info($"isIIS:{isIIS}");
-
-                //app.UseSwagger(c =>
-                //{
-                //    //Change the path of the end point , should also update UI middle ware for this change                
-                //    c.RouteTemplate = $"swagger/v1/swagger.json";
-                //    logger.Info($"RouteTemplate:{c.RouteTemplate}");
-                //});
+                //var documentName = "v1";
+                app.UseSwagger();
                 app.UseSwaggerUI(c =>
                 {
-                    //c.RoutePrefix = $"{virtualPath}/swagger";
-                    //logger.Info($"RoutePrefix:{c.RoutePrefix}");
-                    c.SwaggerEndpoint($"v1/swagger.json", "ForSignAPIClient v1");
-
+                    c.SwaggerEndpoint($"{virtualPath}/swagger/v1/swagger.json", "My API V1");
                 });
 
             }

+ 0 - 1
WebAPIBase.NetCore/WebAPIBase.NetCore/WebAPIBase.API.csproj

@@ -27,7 +27,6 @@
     <PackageReference Include="NLog" Version="4.7.5" />
     <PackageReference Include="NLog.Extensions.Logging" Version="1.6.5" />
     <PackageReference Include="NLog.Web.AspNetCore" Version="4.9.3" />
-    <PackageReference Include="NSwag.Core" Version="13.10.9" />
     <PackageReference Include="Swashbuckle.AspNetCore" Version="6.1.2" />
     <PackageReference Include="System.Drawing.Common" Version="4.7.0" />
     <PackageReference Include="System.Net.Http" Version="4.3.4" />

+ 4 - 3
WebAPIBase.NetCore/WebAPIBase.NetCore/appsettings.json

@@ -1,6 +1,6 @@
 {
-  "isIIS": true,
-  "virtualPath": "eq",
+  "isIIS": false,
+  "virtualPath": "/eq",
   "Logging": {
     "IncludeScopes": false,
     "Debug": {
@@ -13,7 +13,8 @@
     "AppSettings": {
       "ConnectionString": "server=(local);uid=sa;pwd=sa;database=HAODE;",
       "NlogConfigFile": "nlog.config",
-      "webserviceUrl": "http://1.193.162.246:18402/WorkFlowWebService60NodeJS/query.asmx"
+      "webserviceUrl": "http://1.193.162.246:18402/WorkFlowWebService60NodeJS/query.asmx",
+      "validServiceUrl": "http://localhost:8082"
     },
     "Console": {
       "LogLevel": {