Browse Source

将L1端口改成L1API地址

shuiping150 4 months ago
parent
commit
21affb34bf

+ 5 - 1
JLHHJSvr/BLL/HelperBase.cs

@@ -46,7 +46,11 @@ namespace JLHHJSvr.BLL
 
         public JObject DoExecute(string apiName, JObject request)
         {
-            var url = "http://127.0.0.1:" + GlobalVar.ERP_HTTPPort + "/api/common/" + apiName;
+            var url = GlobalVar.ERP_API_URL + "/api/common/" + apiName;
+            if (!url.StartsWith("http", StringComparison.OrdinalIgnoreCase))
+            {
+                url = "https://" + url;
+            }
             var rslt = LJHttpUtil.PostRequest(url, request);
 
             var errMsg = rslt.GetValue("ErrMsg");

+ 2 - 2
JLHHJSvr/GlobalVar/GlobalVar.cs

@@ -27,7 +27,7 @@ namespace JLHHJSvr
         /// <summary>
         /// L1业务后台-HTTP端口(HTTP协议)
         /// </summary>
-        public static int ERP_HTTPPort { get; set; }
+        public static string ERP_API_URL { get; set; }
         /// <summary>
         /// L1业务后台-登录账套名
         /// </summary>
@@ -83,7 +83,7 @@ namespace JLHHJSvr
 
                         string L1Password = xmlconfig.GetXmlFileValue(xmlfile, string.Empty, "L1Password", "");
                         GlobalVar.ERP_ACCOUNT_NAME = xmlconfig.GetXmlFileValue(xmlfile, string.Empty, "L1Server", "");
-                        GlobalVar.ERP_HTTPPort = Convert.ToInt32(xmlconfig.GetXmlFileValue(xmlfile, string.Empty, "L1Httpport", ""));
+                        GlobalVar.ERP_API_URL = xmlconfig.GetXmlFileValue(xmlfile, string.Empty, "L1API", "");
                         GlobalVar.ERP_ACCOUNT_USERNAME = xmlconfig.GetXmlFileValue(xmlfile, string.Empty, "L1Usercode", "");
                         GlobalVar.ERP_ACCOUNT_PASSWORD = DESEncrypt.Decrypt(L1Password, "4A61A8B51C3E42BCAE991F6C913A6A33");//DONE: 解密
 

+ 52 - 77
JLHHJSvr/JLHHJSvrConfig.Designer.cs

@@ -56,83 +56,74 @@
             // 
             // textBox1
             // 
-            this.textBox1.Location = new System.Drawing.Point(130, 46);
-            this.textBox1.Margin = new System.Windows.Forms.Padding(6);
+            this.textBox1.Location = new System.Drawing.Point(65, 23);
             this.textBox1.Name = "textBox1";
-            this.textBox1.Size = new System.Drawing.Size(322, 35);
+            this.textBox1.Size = new System.Drawing.Size(163, 21);
             this.textBox1.TabIndex = 0;
             // 
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(36, 54);
-            this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label1.Location = new System.Drawing.Point(18, 27);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(82, 24);
+            this.label1.Size = new System.Drawing.Size(41, 12);
             this.label1.TabIndex = 1;
             this.label1.Text = "服务器";
             // 
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(36, 112);
-            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label2.Location = new System.Drawing.Point(18, 56);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(82, 24);
+            this.label2.Size = new System.Drawing.Size(41, 12);
             this.label2.TabIndex = 2;
             this.label2.Text = "数据库";
             // 
             // textBox2
             // 
-            this.textBox2.Location = new System.Drawing.Point(130, 104);
-            this.textBox2.Margin = new System.Windows.Forms.Padding(6);
+            this.textBox2.Location = new System.Drawing.Point(65, 52);
             this.textBox2.Name = "textBox2";
-            this.textBox2.Size = new System.Drawing.Size(322, 35);
+            this.textBox2.Size = new System.Drawing.Size(163, 21);
             this.textBox2.TabIndex = 1;
             // 
             // label3
             // 
             this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(36, 170);
-            this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label3.Location = new System.Drawing.Point(18, 85);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(82, 24);
+            this.label3.Size = new System.Drawing.Size(41, 12);
             this.label3.TabIndex = 2;
             this.label3.Text = "用户名";
             // 
             // label4
             // 
             this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(60, 227);
-            this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label4.Location = new System.Drawing.Point(30, 114);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(58, 24);
+            this.label4.Size = new System.Drawing.Size(29, 12);
             this.label4.TabIndex = 2;
             this.label4.Text = "密码";
             // 
             // textBox3
             // 
-            this.textBox3.Location = new System.Drawing.Point(130, 162);
-            this.textBox3.Margin = new System.Windows.Forms.Padding(6);
+            this.textBox3.Location = new System.Drawing.Point(65, 81);
             this.textBox3.Name = "textBox3";
-            this.textBox3.Size = new System.Drawing.Size(322, 35);
+            this.textBox3.Size = new System.Drawing.Size(163, 21);
             this.textBox3.TabIndex = 2;
             // 
             // textBox4
             // 
-            this.textBox4.Location = new System.Drawing.Point(130, 221);
-            this.textBox4.Margin = new System.Windows.Forms.Padding(6);
+            this.textBox4.Location = new System.Drawing.Point(65, 110);
             this.textBox4.Name = "textBox4";
-            this.textBox4.Size = new System.Drawing.Size(322, 35);
+            this.textBox4.Size = new System.Drawing.Size(163, 21);
             this.textBox4.TabIndex = 3;
             this.textBox4.UseSystemPasswordChar = true;
             // 
             // button1
             // 
-            this.button1.Location = new System.Drawing.Point(870, 210);
-            this.button1.Margin = new System.Windows.Forms.Padding(6);
+            this.button1.Location = new System.Drawing.Point(435, 105);
             this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(150, 46);
+            this.button1.Size = new System.Drawing.Size(75, 23);
             this.button1.TabIndex = 4;
             this.button1.Text = "测试连接";
             this.button1.UseVisualStyleBackColor = true;
@@ -140,10 +131,9 @@
             // 
             // button2
             // 
-            this.button2.Location = new System.Drawing.Point(708, 477);
-            this.button2.Margin = new System.Windows.Forms.Padding(6);
+            this.button2.Location = new System.Drawing.Point(354, 238);
             this.button2.Name = "button2";
-            this.button2.Size = new System.Drawing.Size(150, 46);
+            this.button2.Size = new System.Drawing.Size(75, 23);
             this.button2.TabIndex = 5;
             this.button2.Text = "保存";
             this.button2.UseVisualStyleBackColor = true;
@@ -151,10 +141,9 @@
             // 
             // button3
             // 
-            this.button3.Location = new System.Drawing.Point(870, 477);
-            this.button3.Margin = new System.Windows.Forms.Padding(6);
+            this.button3.Location = new System.Drawing.Point(435, 238);
             this.button3.Name = "button3";
-            this.button3.Size = new System.Drawing.Size(150, 46);
+            this.button3.Size = new System.Drawing.Size(75, 23);
             this.button3.TabIndex = 6;
             this.button3.Text = "退出";
             this.button3.UseVisualStyleBackColor = true;
@@ -162,10 +151,9 @@
             // 
             // button4
             // 
-            this.button4.Location = new System.Drawing.Point(870, 45);
-            this.button4.Margin = new System.Windows.Forms.Padding(6);
+            this.button4.Location = new System.Drawing.Point(435, 22);
             this.button4.Name = "button4";
-            this.button4.Size = new System.Drawing.Size(150, 46);
+            this.button4.Size = new System.Drawing.Size(75, 23);
             this.button4.TabIndex = 7;
             this.button4.Text = "安装服务";
             this.button4.UseVisualStyleBackColor = true;
@@ -173,124 +161,112 @@
             // 
             // textBox5
             // 
-            this.textBox5.Location = new System.Drawing.Point(586, 162);
-            this.textBox5.Margin = new System.Windows.Forms.Padding(6);
+            this.textBox5.Location = new System.Drawing.Point(293, 81);
             this.textBox5.Name = "textBox5";
-            this.textBox5.Size = new System.Drawing.Size(152, 35);
+            this.textBox5.Size = new System.Drawing.Size(78, 21);
             this.textBox5.TabIndex = 3;
             this.textBox5.Text = "9075";
             // 
             // label5
             // 
             this.label5.AutoSize = true;
-            this.label5.Location = new System.Drawing.Point(483, 170);
-            this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label5.Location = new System.Drawing.Point(242, 85);
             this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(94, 24);
+            this.label5.Size = new System.Drawing.Size(47, 12);
             this.label5.TabIndex = 2;
             this.label5.Text = "TCP端口";
             // 
             // label6
             // 
             this.label6.AutoSize = true;
-            this.label6.Location = new System.Drawing.Point(471, 226);
-            this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label6.Location = new System.Drawing.Point(236, 113);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(106, 24);
+            this.label6.Size = new System.Drawing.Size(53, 12);
             this.label6.TabIndex = 8;
             this.label6.Text = "HTTP端口";
             // 
             // textBox6
             // 
-            this.textBox6.Location = new System.Drawing.Point(586, 219);
-            this.textBox6.Margin = new System.Windows.Forms.Padding(6);
+            this.textBox6.Location = new System.Drawing.Point(293, 110);
             this.textBox6.Name = "textBox6";
-            this.textBox6.Size = new System.Drawing.Size(152, 35);
+            this.textBox6.Size = new System.Drawing.Size(78, 21);
             this.textBox6.TabIndex = 9;
             this.textBox6.Text = "9076";
             // 
             // textBox7
             // 
-            this.textBox7.Location = new System.Drawing.Point(134, 302);
-            this.textBox7.Margin = new System.Windows.Forms.Padding(6);
+            this.textBox7.Location = new System.Drawing.Point(65, 180);
             this.textBox7.Name = "textBox7";
-            this.textBox7.Size = new System.Drawing.Size(322, 35);
+            this.textBox7.Size = new System.Drawing.Size(163, 21);
             this.textBox7.TabIndex = 10;
             // 
             // label7
             // 
             this.label7.AutoSize = true;
-            this.label7.Location = new System.Drawing.Point(40, 305);
-            this.label7.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label7.Location = new System.Drawing.Point(18, 181);
             this.label7.Name = "label7";
             this.label7.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
-            this.label7.Size = new System.Drawing.Size(82, 24);
+            this.label7.Size = new System.Drawing.Size(41, 12);
             this.label7.TabIndex = 11;
             this.label7.Text = "L1账套";
             // 
             // textBox8
             // 
-            this.textBox8.Location = new System.Drawing.Point(134, 359);
-            this.textBox8.Margin = new System.Windows.Forms.Padding(6);
+            this.textBox8.Location = new System.Drawing.Point(65, 209);
             this.textBox8.Name = "textBox8";
-            this.textBox8.Size = new System.Drawing.Size(322, 35);
+            this.textBox8.Size = new System.Drawing.Size(163, 21);
             this.textBox8.TabIndex = 12;
             // 
             // textBox9
             // 
-            this.textBox9.Location = new System.Drawing.Point(134, 418);
-            this.textBox9.Margin = new System.Windows.Forms.Padding(6);
+            this.textBox9.Location = new System.Drawing.Point(65, 238);
             this.textBox9.Name = "textBox9";
-            this.textBox9.Size = new System.Drawing.Size(322, 35);
+            this.textBox9.Size = new System.Drawing.Size(163, 21);
             this.textBox9.TabIndex = 13;
             this.textBox9.UseSystemPasswordChar = true;
             // 
             // label9
             // 
             this.label9.AutoSize = true;
-            this.label9.Location = new System.Drawing.Point(20, 362);
-            this.label9.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label9.Location = new System.Drawing.Point(8, 210);
             this.label9.Name = "label9";
             this.label9.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
-            this.label9.Size = new System.Drawing.Size(106, 24);
+            this.label9.Size = new System.Drawing.Size(53, 12);
             this.label9.TabIndex = 14;
             this.label9.Text = "账号名称";
             // 
             // label10
             // 
             this.label10.AutoSize = true;
-            this.label10.Location = new System.Drawing.Point(20, 423);
-            this.label10.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label10.Location = new System.Drawing.Point(8, 241);
             this.label10.Name = "label10";
             this.label10.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
-            this.label10.Size = new System.Drawing.Size(106, 24);
+            this.label10.Size = new System.Drawing.Size(53, 12);
             this.label10.TabIndex = 15;
             this.label10.Text = "账号密码";
             // 
             // textBox10
             // 
-            this.textBox10.Location = new System.Drawing.Point(590, 302);
-            this.textBox10.Margin = new System.Windows.Forms.Padding(6);
+            this.textBox10.Location = new System.Drawing.Point(295, 151);
             this.textBox10.Name = "textBox10";
-            this.textBox10.Size = new System.Drawing.Size(152, 35);
+            this.textBox10.Size = new System.Drawing.Size(215, 21);
             this.textBox10.TabIndex = 16;
-            this.textBox10.Text = "8080";
+            this.textBox10.Text = "https://www.example.com";
             // 
             // label11
             // 
             this.label11.AutoSize = true;
-            this.label11.Location = new System.Drawing.Point(475, 305);
-            this.label11.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label11.Location = new System.Drawing.Point(38, 156);
             this.label11.Name = "label11";
-            this.label11.Size = new System.Drawing.Size(106, 24);
+            this.label11.Size = new System.Drawing.Size(251, 12);
             this.label11.TabIndex = 17;
-            this.label11.Text = "HTTP端口";
+            this.label11.Text = "L1API地址(ie:\"https://test.longjoe.com\"):";
             // 
             // Form1
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1080, 552);
+            this.ClientSize = new System.Drawing.Size(540, 276);
             this.Controls.Add(this.label11);
             this.Controls.Add(this.textBox10);
             this.Controls.Add(this.label10);
@@ -315,7 +291,6 @@
             this.Controls.Add(this.textBox3);
             this.Controls.Add(this.textBox2);
             this.Controls.Add(this.textBox1);
-            this.Margin = new System.Windows.Forms.Padding(6);
             this.Name = "Form1";
             this.Text = "数据库连接设置";
             this.ResumeLayout(false);

+ 1 - 1
JLHHJSvr/JLHHJSvrConfig.cs

@@ -85,7 +85,7 @@ namespace JLHHJSvr
                 xmlconfig.SetXmlFileValue(configFile, string.Empty, "port", textBox5.Text);
                 xmlconfig.SetXmlFileValue(configFile, string.Empty, "httpport", textBox6.Text);
                 xmlconfig.SetXmlFileValue(configFile, string.Empty, "L1Server", textBox7.Text);
-                xmlconfig.SetXmlFileValue(configFile, string.Empty, "L1Httpport", textBox10.Text);
+                xmlconfig.SetXmlFileValue(configFile, string.Empty, "L1API", textBox10.Text);
                 xmlconfig.SetXmlFileValue(configFile, string.Empty, "L1Usercode", textBox8.Text);
                 xmlconfig.SetXmlFileValue(configFile, string.Empty, "L1Password", DESEncrypt.Encrypt(textBox9.Text, "4A61A8B51C3E42BCAE991F6C913A6A33"));