diff --git a/examples/components/header.vue b/examples/components/header.vue index 9729bff47..47c3348cc 100644 --- a/examples/components/header.vue +++ b/examples/components/header.vue @@ -380,7 +380,7 @@ import compoLang from '../i18n/component.json'; import Element from 'main/index.js'; import themeLoader from './theme/loader'; - import { getTestEle, getTestAli } from './theme/loader/api.js'; + import { getTestEle } from './theme/loader/api.js'; import bus from '../bus'; import { ACTION_USER_CONFIG_UPDATE } from './theme/constant.js'; @@ -434,15 +434,17 @@ ga('send', 'event', 'DocView', 'Ele', 'Outer'); console.error(err); }); - getTestAli() - .then(() => { - this.$isEle = true; - ga('send', 'event', 'DocView', 'Ali', 'Inner'); - }) - .catch((err) => { - ga('send', 'event', 'DocView', 'Ali', 'Outer'); - console.error(err); - }); + + const testInnerImg = new Image(); + testInnerImg.onload = () => { + this.$isEle = true; + ga('send', 'event', 'DocView', 'Ali', 'Inner'); + }; + testInnerImg.onerror = (err) => { + ga('send', 'event', 'DocView', 'Ali', 'Outer'); + console.error(err); + }; + testInnerImg.src = `https://private-alipayobjects.alipay.com/alipay-rmsdeploy-image/rmsportal/VmvVUItLdPNqKlNGuRHi.png?t=${Date.now()}`; }, methods: { switchVersion(version) { diff --git a/examples/components/theme/loader/api.js b/examples/components/theme/loader/api.js index 07a2cf4c6..450786d3c 100644 --- a/examples/components/theme/loader/api.js +++ b/examples/components/theme/loader/api.js @@ -19,10 +19,6 @@ export const getTestEle = () => { return get(`${hostList.alpha}getVariable`); }; -export const getTestAli = () => { - return get(`https://private-alipayobjects.alipay.com/alipay-rmsdeploy-image/rmsportal/VmvVUItLdPNqKlNGuRHi.png?t=${Date.now()}`); -}; - export const updateVars = (data, cb) => { return post(`${host}updateVariable?version=${version}`, data, cb); };