mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-05 00:21:38 +08:00
字体加载添加超时时间
This commit is contained in:
@@ -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)
|
||||
});
|
||||
|
Reference in New Issue
Block a user