liyongli 5 месяцев назад
Родитель
Сommit
0631523772
4 измененных файлов с 16 добавлено и 7 удалено
  1. 2 2
      src/tool/adList.js
  2. 0 0
      src/tool/adList.min.js
  3. 3 2
      src/tool/index.html
  4. 11 3
      src/views/SitePage.vue

+ 2 - 2
src/tool/adList.js

@@ -359,8 +359,8 @@ document.addEventListener('DOMContentLoaded', function () {
     return carouselContainer
   }
   // 轮播End
-
-  const CFG = '__AD_CONFIG_URL__'
+  const script = document.querySelector('#sxtv-ad-id')
+  const CFG = 'http://cxzx.smcic.net/ad/catalog/' + script.getAttribute('ad_id') + '.json'
   try {
     fetch(CFG + '?' + Date.now())
       .then((res) => res.json())

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/tool/adList.min.js


+ 3 - 2
src/tool/index.html

@@ -5,11 +5,12 @@
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>Document</title>
-    <script src="./adList.js"></script>
+    <!-- <script id="sxtv-ad-id" src="./adList.js?a=009" ad_id="001"></script> -->
+    <script src="http://cxzx.smcic.net/ad/config/adList.min.js" ad_id="1020" id="sxtv-ad-id"></script>
 </head>
 
 <body>
-    <div id="sxtv-ad-120"></div>
+    <div id="sxtv-ad-122"></div>
 </body>
 
 </html>

+ 11 - 3
src/views/SitePage.vue

@@ -186,13 +186,21 @@ const saveEdit = (row: CatalogTreeOri) => {
 const copyCode = (row: CatalogTreeOri) => {
   const slots = row.slots || []
   const ele = document.createElement('script')
-  ele.src = `http://cxzx.smcic.net/ad/catalog/${row.catalogId}.js`
+  ele.src = `http://cxzx.smcic.net/ad/config/adList.min.js`
+  ele.setAttribute('ad_id', row.catalogId + '')
+  ele.id = 'sxtv-ad-id'
+  const elehttps = document.createElement('script')
+  elehttps.setAttribute('ad_id', row.catalogId + '')
+  elehttps.src = `https://cxzx.smcic.net/ad/config/adList.min.js`
+  elehttps.id = 'sxtv-ad-id'
   ElMessageBox({
     title: row.catalogName,
     message: h('div', null, [
-      h('h3', null, '代码'),
+      h('h3', { style: { 'font-weight': 'bold', padding: '5px 0' } }, '代码(http)'),
       h('div', null, ele.outerHTML),
-      h('h3', null, 'id:'),
+      h('h3', { style: { 'font-weight': 'bold', padding: '5px 0' } }, '代码(https)'),
+      h('div', null, elehttps.outerHTML),
+      h('h3', { style: { 'font-weight': 'bold', padding: '5px 0' } }, 'id:'),
       h('div', null, slots.map((v) => '#sxtv-ad-' + v.slotId).join(',')),
     ]),
   })

Некоторые файлы не были показаны из-за большого количества измененных файлов