2024-06-27 22:39:41 +08:00
|
|
|
import {dicts} from "@/utils/dicts";
|
|
|
|
|
import axios from 'axios'
|
|
|
|
|
|
|
|
|
|
window.axios = axios
|
2024-06-21 11:51:14 +08:00
|
|
|
const KENGEE_CDN_BASE = "http://10.0.97.209/presource/datascreen/"
|
|
|
|
|
const libs = [`${KENGEE_CDN_BASE}/js/pinyin.min.js`]
|
2024-06-27 22:39:41 +08:00
|
|
|
window.$glob = {}
|
|
|
|
|
window.$dicts = dicts
|
|
|
|
|
window.$waitFor = (target, t = 500) => new Promise(resolve => {
|
|
|
|
|
const interval = setInterval(() => {
|
|
|
|
|
if (target) {
|
|
|
|
|
clearInterval(interval)
|
|
|
|
|
resolve(target)
|
|
|
|
|
}
|
|
|
|
|
}, t)
|
|
|
|
|
if (target) {
|
|
|
|
|
clearInterval(interval)
|
|
|
|
|
resolve(target)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
export default Promise.all([
|
2024-06-21 11:51:14 +08:00
|
|
|
import("./fetch"),
|
|
|
|
|
...libs.map(url => new Promise(resolve => {
|
|
|
|
|
const script = document.createElement("script")
|
|
|
|
|
script.src = url
|
|
|
|
|
document.head.appendChild(script)
|
|
|
|
|
script.onload = () => resolve()
|
|
|
|
|
})),
|
|
|
|
|
])
|