xx 1 year ago
parent
commit
1081073f4c
2 changed files with 18 additions and 8 deletions
  1. 17 7
      assets/scene/test.ts
  2. 1 1
      assets/script/http.ts

+ 17 - 7
assets/scene/test.ts

@@ -10,13 +10,23 @@ export class test extends Component {
   protected start(): void {
     let self = this;
     this.btn_click.on(Node.EventType.TOUCH_END,()=>{
-        http.run_get_static(http.get_test_user_list(),(err,data)=>{
-            if(!err){
-               // let _data:getTestUserListMessage = JSON.parse(data)
-                self.lab_info.getComponent(Label).string = data;
-            }
-        })
-    })
+        // http.run_get_static(http.get_test_user_list(),(err,data)=>{
+        //     if(!err){
+        //         console.log(" -- -",http.static_domain+http.get_test_user_list())
+        //        // let _data:getTestUserListMessage = JSON.parse(data)
+        //         self.lab_info.getComponent(Label).string = data;
+        //     }
+        // })
+
+      http.run_get("https://static.hainanmlwl.com/smistatic/user_test.json",(err,data)=>{
+              if(!err){
+                  console.log(" -- -",http.static_domain+http.get_test_user_list())
+                // let _data:getTestUserListMessage = JSON.parse(data)
+                  self.lab_info.getComponent(Label).string = data;
+              }
+          })
+
+      })
   }
 }
 

+ 1 - 1
assets/script/http.ts

@@ -103,7 +103,7 @@ export class http {
 
     public static run_get(url, call_back) {
         var xml = new XMLHttpRequest()
-        xml.open('GET', http.domain + url)
+        xml.open('GET',  url)
         xml.setRequestHeader('Content-Type', 'application/json');
         xml.send();