1
0
mirror of https://gitee.com/bookshelfplus/bookshelfplus synced 2025-09-05 00:21:38 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

字体加载添加超时时间

This commit is contained in:
2022-04-15 14:46:28 +08:00
parent 9a19a99fd6
commit 1e8c25e9b4

View File

@@ -29,19 +29,19 @@
return res;
}
function fontmin(text) {
axios.post('../fontmin/getfont', { text: text, font: "" })
axios.post('../fontmin/getfont', { text: text, font: "" }, { timeout: 1000 })
.then(function (response) {
// 当接口成功返回时动态设置css
loadFont(response.data.url);
$("html,body").css("transition", ".05s");
setTimeout(()=>{
setTimeout(() => {
$("html,body").css("opacity", "1");
}, 100)
})
.catch(function (error) {
console.log("字体加载失败", error);
$("html,body").css("transition", ".05s");
setTimeout(()=>{
setTimeout(() => {
$("html,body").css("opacity", "1");
}, 100)
});