Ver código fonte

修复首页选择网站

chenlei1231 5 meses atrás
pai
commit
8c3f0b2e1d

+ 8 - 8
src/components/adweb/selectSite.vue

@@ -67,23 +67,23 @@ export default {
       let that = this
       getAction(that.siteListUrl).then(function (res) {
         if (res.code == 200) {
-          that.siteinfo = res.data
+          that.siteinfo = res.result
           let isInSite = false
-          for (let i in res.data) {
-            if (localStorage.getItem('siteCode') !== null && res.data[i].code === localStorage.getItem('siteCode')) {
+          for (let i in res.result) {
+            if (localStorage.getItem('siteCode') !== null && res.result[i].code === localStorage.getItem('siteCode')) {
               isInSite = true
-              that.selectSiteInfo = res.data[i]
+              that.selectSiteInfo = res.result[i]
             }
           }
           if (localStorage.getItem('siteCode') !== null && isInSite) {
             that.siteCode = localStorage.getItem("siteCode")
           } else {
-            that.siteCode = res.data[0].code
-            that.selectSiteInfo = res.data[0]
-            localStorage.setItem("siteCode", res.data[0].code)
+            that.siteCode = res.result[0].code
+            that.selectSiteInfo = res.result[0]
+            localStorage.setItem("siteCode", res.result[0].code)
           }
           that.$nextTick(() => {
-            that.$emit('setSiteInfo', res.data, that.selectSiteInfo)
+            that.$emit('setSiteInfo', res.result, that.selectSiteInfo)
           })
           // if(route == 'websiteManage-dashboard-analysis'){
           //   that.getPermissionList(that.siteCode)

+ 7 - 7
src/views/dashboard/Analysis/homePage/adweb3Home.vue

@@ -655,20 +655,20 @@ export default {
       let that = this
       getAction('/adweb/adwebSite/getSiteListByUid').then(function (res) {
         if (res.code == 200) {
-          that.siteinfo = res.data
+          that.siteinfo = res.result
           let isInSite = false
-          for (let i in res.data){
-            if(localStorage.getItem('siteCode') !== null && res.data[i].code === localStorage.getItem('siteCode')){
+          for (let i in res.result){
+            if(localStorage.getItem('siteCode') !== null && res.result[i].code === localStorage.getItem('siteCode')){
               isInSite = true
-              that.selectSiteInfo = res.data[i]
+              that.selectSiteInfo = res.result[i]
             }
           }
           if (localStorage.getItem('siteCode') !== null && isInSite) {
             that.siteCode = localStorage.getItem("siteCode")
           }else {
-            that.siteCode = res.data[0].code
-            that.selectSiteInfo = res.data[0]
-            localStorage.setItem("siteCode",res.data[0].code)
+            that.siteCode = res.result[0].code
+            that.selectSiteInfo = res.result[0]
+            localStorage.setItem("siteCode", res.result[0].code)
           }
           that.getAllInfo()
         } else {