|
@@ -10,7 +10,9 @@
|
|
|
* @param {string[]} ad_cover 广告图片
|
|
|
*/
|
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
|
- const base = 'http://10.30.160.129:8082/'
|
|
|
+ const agreement =
|
|
|
+ location.origin === 'http://' ? 'http:' : location.origin === 'https://' ? 'https:' : 'http://'
|
|
|
+ const base = agreement + '10.30.160.129:8082/'
|
|
|
/**
|
|
|
* 广告初始化
|
|
|
* @param config 广告配置
|
|
@@ -361,7 +363,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
|
}
|
|
|
// 轮播End
|
|
|
const script = document.querySelector('#sxtv-ad-id')
|
|
|
- const CFG = 'http://cxzx.smcic.net/ad/catalog/' + script.getAttribute('ad_id') + '.json'
|
|
|
+ const CFG = agreement + 'cxzx.smcic.net/ad/catalog/' + script.getAttribute('ad_id') + '.json'
|
|
|
try {
|
|
|
fetch(CFG + '?' + Date.now())
|
|
|
.then((res) => res.json())
|