mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
fix(modules/web): 重构阅读API;封面图片优先使用源站资源
- 添加图片代理接口API;API地址测试(3s超时)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user