接入数字人和调整界面

This commit is contained in:
aixianling
2023-11-09 15:21:33 +08:00
parent 8eb0db8401
commit ad77470063
18 changed files with 290 additions and 115 deletions

View File

@@ -29,3 +29,17 @@ export function copyToClipboard(content) {
* @returns {any}
*/
export const scopy = (any = null) => JSON.parse(JSON.stringify(any))
export const load = (ctx, params = {c: 0, delay: 500}) => {
if (ctx) {
return Promise.resolve(ctx)
} else if (params.c < 10) {
return new Promise(resolve => setTimeout(() => resolve(load({...params, c: ++params.c}), params.delay)))
} else return Promise.reject("无法加载内容")
}
export const addJs = url => {
const script = document.createElement("script")
script.src = url
document.body.appendChild(script)
}