Browse Source

新安装的计量云版第一次登录会遇到网络错误。

Chenshilong 8 years ago
parent
commit
b599fa7eb0
1 changed files with 10 additions and 10 deletions
  1. 10 10
      Forms/IPFrm.pas

+ 10 - 10
Forms/IPFrm.pas

@@ -64,6 +64,16 @@ begin
   if Pos('http://', sIP) =1 then
     Delete(sIP, 1, 7);
 
+  ini := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'Cloud.ini');
+  try
+    ini.WriteString('URL', 'Server', sIP);
+    ini.WriteString('URL', 'CompanyName', sN);
+    ini.WriteString('URL', 'LoginCloudURL', 'http://' + sIP);
+    PHPWeb.LoginCloudURL := 'http://' + sIP;
+  finally
+    ini.Free;
+  end;
+
   iResult := PHPWeb.ConnectServer(sIP, sN);
   if iResult = 1 then
   begin
@@ -75,16 +85,6 @@ begin
 
     G_Server := sIP;
     G_CompanyName := sN;
-
-    ini := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'Cloud.ini');
-    try
-      ini.WriteString('URL', 'Server', sIP);
-      ini.WriteString('URL', 'CompanyName', sN);
-      ini.WriteString('URL', 'LoginCloudURL', 'http://' + sIP);
-      PHPWeb.LoginCloudURL := 'http://' + sIP;
-    finally
-      ini.Free;
-    end;
   end
   else
   begin