StephenArk30 6 anos atrás
pai
commit
97e18536b7

+ 10 - 12
sourcecode/h5app/vue/src/connector/basic-service.js

@@ -120,9 +120,6 @@ var BasicFunction = new (function () {
         }
     };
 
-    this.get_data = function (url, callback, scope) {
-        console.log('----------using get_data()-----------');
-        BasicFunction.Queue.list.push({url: url, callback: callback, gid: -1, scope: scope});
     this.get_data = function (url, callback, data, scope) {
         BasicFunction.Queue.list.push({url: url, callback: callback, gid: -1, data:data, scope: scope});
     };
@@ -202,10 +199,10 @@ var BasicFunction = new (function () {
             data: data,
             sendTime: new Date()
         }).then(BasicFunction.checkStatus)
-          .then(BasicFunction.parseJson)
-          .then(function(response){return response.json()})
-          .then(callback)
-          .catch(BasicFunction.on_fail);
+            .then(BasicFunction.parseJson)
+            .then(function(response){return response.json()})
+            .then(callback)
+            .catch(BasicFunction.on_fail);
     }
 
     function g_request_data(url, callback, gid) {
@@ -216,11 +213,11 @@ var BasicFunction = new (function () {
             gid: gid,
             callme: callback
         }).then(BasicFunction.checkStatus)
-        .then(BasicFunction.parseJson)
-        .then(function(response){return response.json()})
-        .then(BasicFunction.onReqeustDataReceived)
-        .then(callback)
-        .catch(BasicFunction.on_fail);
+            .then(BasicFunction.parseJson)
+            .then(function(response){return response.json()})
+            .then(BasicFunction.onReqeustDataReceived)
+            .then(callback)
+            .catch(BasicFunction.on_fail);
     }
 
     this.on_gp_success = function(response) {
@@ -438,6 +435,7 @@ var BasicFunction = new (function () {
 
     this.get_server_url();
     //this.on_document_load();
+})();
 
 window.BasicFunction = BasicFunction;
 

+ 1 - 2
sourcecode/h5app/vue/src/connector/simple-demo.js

@@ -17,7 +17,7 @@ var test_vue_app = new Vue({
     }
 });
 
- /******************************************************************************
+/******************************************************************************
  //
  // To load directly from JS(jQuery)
  //
@@ -109,4 +109,3 @@ loader.loadOnce();
 
 //To auto-refresh
 // loader.loadOften();
-

+ 0 - 4
sourcecode/h5app/vue/src/views/login.vue

@@ -98,10 +98,6 @@
                 // }
                 // 检查手机号有无验证
                 BasicFunction.get_data("smartUsers/list", function(data) { console.log(data.model.list); } );
-                BasicFunction.get_data("smartUsers/list", function(response){
-                    console.log("------ Data Rcvd in Login --------");
-                    console.log(response.model.list);
-                });
                 BasicFunction.get_data("ajaxlogin", function(response){
                     console.log("------ Data Rcvd in Login --------");
                     console.log(response);