fix(modules/web): 重构阅读API;封面图片优先使用源站资源

- 添加图片代理接口API;API地址测试(3s超时)
This commit is contained in:
Xwite
2024-09-29 18:05:04 +08:00
parent ed5d13f455
commit bf91a6f206
12 changed files with 222 additions and 176 deletions

View File

@@ -1,5 +1,4 @@
import { formatDate } from "@vueuse/shared";
import { baseUrl } from "@/api/axios.js";
export const isLegadoUrl = (/** @type {string} */ url) =>
/,\s*\{/.test(url) ||
@@ -8,20 +7,7 @@ export const isLegadoUrl = (/** @type {string} */ url) =>
url.startsWith("data:") ||
url.startsWith("blob:")
);
/**
* @param {string} src
*/
export function getImageFromLegado(src) {
return (
baseUrl() +
"/image?path=" +
encodeURIComponent(src) +
"&url=" +
encodeURIComponent(sessionStorage.getItem("bookUrl")) +
"&width=" +
useBookStore().config.readWidth
);
}
// @ts-ignore
export const dateFormat = (/** @type {number} */ t) => {
let time = new Date().getTime();