Browse Source

修复登录页加载2遍bug

ming 2 years ago
parent
commit
acabea3b0f
2 changed files with 23 additions and 27 deletions
  1. 1 1
      src/App.vue
  2. 22 26
      src/pages/business/mhxf/informationSelect/index.vue

+ 1 - 1
src/App.vue

@@ -24,7 +24,7 @@ function initConfig() {
 
 function checkLogin() {
   if (!getToken()) {
-    proxy.$tab.reLaunch("/pages/login");
+    // proxy.$tab.reLaunch("/pages/login");
   }
 }
 

+ 22 - 26
src/pages/business/mhxf/informationSelect/index.vue

@@ -49,7 +49,7 @@ const current = ref(0);
 const classifyUrl = ref("");
 const classifyCode = ref("");
 const placeholderText = ref("");
-const dataRes = ref(0);
+const dataRes = ref(1);
 
 const list = ref([
   {
@@ -208,6 +208,7 @@ function tabsClick(e) {
   current.value = e.index;
   console.log(current.value);
   dataInput.value = "";
+  dataRes.value = 1;
 }
 
 function goSearch() {
@@ -286,40 +287,35 @@ async function classifySearch(URL, params) {
     if (res.status == "SUCCESS") {
 		
       if (current.value == 2) {
-		  if(res.data.length){
-		  	 dataRes.value = 1;
-		  }else{
-		  	dataRes.value = 0;
-		  }
-        var records = res.data[0][0];
-		
+          if(res.data.length){
+            dataRes.value = 1;
+          }else{
+            dataRes.value = 0;
+          }
+          var records = res.data[0][0];
+        
       } else if (current.value == 3) {
-		  if(res.data.length){
-		  	 dataRes.value = 1;
-		  }else{
-		  	dataRes.value = 0;
-		  }
+          if(res.data.length){
+            dataRes.value = 1;
+          }else{
+            dataRes.value = 0;
+          }
 
         var records = res.data[0];
       } else {
 		  //  console.log('111111111')
 		  // console.log(res.data.records.length)
 		  //  console.log('111222')
-		  if(res.data.records.length){
-		  	 dataRes.value = 1;
-		  }else{
-		  	dataRes.value = 0;
-		  }
-        var records = res.data.records[0];
+          if(res.data.total){
+            dataRes.value = 1;
+          }else{
+            dataRes.value = 0;
+          }
+            var records = res.data.records[0];
       }
 	  
-	  
-	  
-   //    if (!records) {
-   //      dataRes.value = 0;
-   //    } else {
-   //      dataRes.value = 1;
-   //    }
+      console.log(dataRes.value+'------1')
+  
 	  
       switch (current.value) {
         case 0: //警情查询