lihaodyx 3 years ago
parent
commit
5a39a6dce5

+ 39 - 0
source/gx_api/GxPress/.vscode/launch.json

@@ -0,0 +1,39 @@
+{
+    // 使用 IntelliSense 了解相关属性。 
+    // 悬停以查看现有属性的描述。
+    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "OS-COMMENT1": "Use IntelliSense to find out which attributes exist for C# debugging",
+            "OS-COMMENT2": "Use hover for the description of the existing attributes",
+            "OS-COMMENT3": "For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md",
+            "name": ".NET Core Launch (web)",
+            "type": "coreclr",
+            "request": "launch",
+            "preLaunchTask": "build",
+            "OS-COMMENT4": "If you have changed target frameworks, make sure to update the program path.",
+            "program": "${workspaceFolder}/Api/GxPress.Api/bin/Debug/netcoreapp3.0/GxPress.Api.dll",
+            "args": [],
+            "cwd": "${workspaceFolder}/Api/GxPress.Api",
+            "stopAtEntry": false,
+            "OS-COMMENT5": "Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser",
+            "serverReadyAction": {
+                "action": "openExternally",
+                "pattern": "\\\\bNow listening on:\\\\s+(https?://\\\\S+)"
+            },
+            "env": {
+                "ASPNETCORE_ENVIRONMENT": "Development"
+            },
+            "sourceFileMap": {
+                "/Views": "${workspaceFolder}/Views"
+            }
+        },
+        {
+            "name": ".NET Core Attach",
+            "type": "coreclr",
+            "request": "attach",
+            "processId": "${command:pickProcess}"
+        }
+    ]
+}

+ 42 - 0
source/gx_api/GxPress/.vscode/tasks.json

@@ -0,0 +1,42 @@
+{
+    "version": "2.0.0",
+    "tasks": [
+        {
+            "label": "build",
+            "command": "dotnet",
+            "type": "process",
+            "args": [
+                "build",
+                "${workspaceFolder}/Api/GxPress.Api/GxPress.Api.csproj",
+                "/property:GenerateFullPaths=true",
+                "/consoleloggerparameters:NoSummary"
+            ],
+            "problemMatcher": "$msCompile"
+        },
+        {
+            "label": "publish",
+            "command": "dotnet",
+            "type": "process",
+            "args": [
+                "publish",
+                "${workspaceFolder}/Api/GxPress.Api/GxPress.Api.csproj",
+                "/property:GenerateFullPaths=true",
+                "/consoleloggerparameters:NoSummary"
+            ],
+            "problemMatcher": "$msCompile"
+        },
+        {
+            "label": "watch",
+            "command": "dotnet",
+            "type": "process",
+            "args": [
+                "watch",
+                "run",
+                "${workspaceFolder}/Api/GxPress.Api/GxPress.Api.csproj",
+                "/property:GenerateFullPaths=true",
+                "/consoleloggerparameters:NoSummary"
+            ],
+            "problemMatcher": "$msCompile"
+        }
+    ]
+}

+ 7 - 7
source/gx_api/GxPress/Infrastructure/GxPress.Common/Tools/RandomGenerator.cs

@@ -24,13 +24,13 @@ namespace GxPress.Common.Tools
         /// <returns></returns>
         public static string GetNumberString(int length)
         {
-            // var code = new StringBuilder();
-            // var rd = new Random();
-            // var range = NumberArr.Length;
-            // for (var i = 0; i < length; i++)
-            //     code.Append(NumberArr[rd.Next(range)].ToString());
-            // return code.ToString();
-            return "123456";
+            var code = new StringBuilder();
+            var rd = new Random();
+            var range = NumberArr.Length;
+            for (var i = 0; i < length; i++)
+                code.Append(NumberArr[rd.Next(range)].ToString());
+            return code.ToString();
+            //return "123456";
         }
 
         /// <summary>