Merge remote-tracking branch 'origin/master'
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
|||||||
import{u as n,A as r}from"./index-cbd182e6.js";import"./vendor-8be1f5fb.js";const i=n();i.setMiniInterface(window.innerWidth<750);window.onresize=()=>{i.setMiniInterface(window.innerWidth<750)};r.getReadConfig().then(a=>{var e=a.data.data;if(e){const t=n();let o=JSON.parse(e),s=t.config;o=Object.assign(s,o),t.setConfig(o)}});
|
import{u as n,A as r}from"./index-ab2e286b.js";import"./vendor-8be1f5fb.js";const i=n();i.setMiniInterface(window.innerWidth<750);window.onresize=()=>{i.setMiniInterface(window.innerWidth<750)};r.getReadConfig().then(a=>{var e=a.data.data;if(e){const t=n();let o=JSON.parse(e),s=t.config;o=Object.assign(s,o),t.setConfig(o)}});
|
||||||
@@ -1 +0,0 @@
|
|||||||
const a='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"/></svg>';export{a as l};
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import{u}from"./index-ab2e286b.js";const f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;function D(t,n,e,a){let s=t<12?"AM":"PM";return a&&(s=s.split("").reduce((l,i)=>l+=`${i}.`,"")),e?s.toLowerCase():s}function L(t,n,e={}){var a;const s=t.getFullYear(),l=t.getMonth(),i=t.getDate(),o=t.getHours(),r=t.getMinutes(),g=t.getSeconds(),m=t.getMilliseconds(),d=t.getDay(),c=(a=e.customMeridiem)!=null?a:D,M={YY:()=>String(s).slice(-2),YYYY:()=>s,M:()=>l+1,MM:()=>`${l+1}`.padStart(2,"0"),MMM:()=>t.toLocaleDateString(e.locales,{month:"short"}),MMMM:()=>t.toLocaleDateString(e.locales,{month:"long"}),D:()=>String(i),DD:()=>`${i}`.padStart(2,"0"),H:()=>String(o),HH:()=>`${o}`.padStart(2,"0"),h:()=>`${o%12||12}`.padStart(1,"0"),hh:()=>`${o%12||12}`.padStart(2,"0"),m:()=>String(r),mm:()=>`${r}`.padStart(2,"0"),s:()=>String(g),ss:()=>`${g}`.padStart(2,"0"),SSS:()=>`${m}`.padStart(3,"0"),d:()=>d,dd:()=>t.toLocaleDateString(e.locales,{weekday:"narrow"}),ddd:()=>t.toLocaleDateString(e.locales,{weekday:"short"}),dddd:()=>t.toLocaleDateString(e.locales,{weekday:"long"}),A:()=>c(o,r),AA:()=>c(o,r,!1,!0),a:()=>c(o,r,!0),aa:()=>c(o,r,!0,!0)};return n.replace(f,(S,h)=>h||M[S]())}const w=t=>/,\s*\{/.test(t)||!(t.startsWith("http")||t.startsWith("data:")||t.startsWith("blob:"));function Y(t){return location.origin+"/image?path="+encodeURIComponent(t)+"&url="+encodeURIComponent(sessionStorage.getItem("bookUrl"))+"&width="+u().config.readWidth}const $=t=>{let n=new Date().getTime(),e=Math.floor((n-t)/1e3),a="";return e<=30?a="刚刚":e<60?a=e+"秒前":e<3600?a=Math.floor(e/60)+"分钟前":e<86400?a=Math.floor(e/3600)+"小时前":e<2592e3?a=Math.floor(e/86400)+"天前":a=L(new Date(t),"YYYY-MM-DD"),a},v='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"/></svg>';export{$ as d,Y as g,w as i,v as l};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
.el-link[data-v-aee57c78]{padding:4px}.el-text[data-v-aee57c78]{padding-top:20px}.error[data-v-d4c4e88b]{border-color:var(--el-color-error)!important;color:var(--el-color-error)!important;--el-checkbox-checked-text-color: var(--el-color-error);--el-checkbox-checked-bg-color: var(--el-color-error);--el-checkbox-checked-input-border-color: var(--el-color-error)}.tool[data-v-3d581419]{display:flex;margin:4px 0;justify-content:center}#source-list[data-v-3d581419]{margin-top:6px;height:calc(100vh - 119px)}#source-list[data-v-3d581419] .el-checkbox{margin-bottom:4px;width:100%}[data-v-fe904689] #debug-text{height:calc(100vh - 86px)}[data-v-7e91a802] .el-input{width:100%}[data-v-7e91a802] #source-json{height:calc(100vh - 50px)}[data-v-dcce2457] .el-tabs__header{margin-bottom:5px}.flex-space-between[data-v-dc7cd0f9]{display:flex;justify-content:space-between;align-items:baseline}.flex-column-center[data-v-dc7cd0f9]{display:flex;flex-direction:column;justify-content:center}.menu>.el-button[data-v-dc7cd0f9]{margin:4px;padding:1em;width:6em}.hotkeys-item .title[data-v-dc7cd0f9]{width:5em;display:flex;justify-content:flex-end;margin-right:1em}.hotkeys-item__content[data-v-dc7cd0f9]{display:flex;flex-wrap:wrap;flex:1}.hotkeys-item__content div[data-v-dc7cd0f9]{margin-bottom:1em}.hotkeys-item__content span[data-v-dc7cd0f9]{margin:.5em}[data-v-2cfb5302] .el-tab-pane{height:calc(100vh - 55px);padding-top:15px;padding-right:5px;overflow-y:auto}[data-v-2cfb5302] .el-tabs__header{margin:0}kbd{background-color:#fcfcfc;border-radius:3px;border:1px solid hsl(0deg,0%,80%);padding:4px 5px;font-weight:700}code{background-color:#f2f1f1;padding:.125rem .25rem;border-radius:.25rem;font-size:.835rem}body{padding:0;margin:0}.el-tabs__header{position:sticky;top:0px;z-index:2;background-color:#fff}.editor[data-v-e99e7704]{display:flex;height:100vh;overflow:hidden}.editor .left[data-v-e99e7704]{flex:1;margin-left:20px}.editor .right[data-v-e99e7704]{flex:1;width:360px;margin-right:20px}
|
||||||
@@ -1 +0,0 @@
|
|||||||
.el-link[data-v-aee57c78]{padding:4px}.el-text[data-v-aee57c78]{padding-top:20px}.error[data-v-4f0ba808]{border-color:var(--el-color-error)!important;color:var(--el-color-error)!important;--el-checkbox-checked-text-color: var(--el-color-error);--el-checkbox-checked-bg-color: var(--el-color-error);--el-checkbox-checked-input-border-color: var(--el-color-error)}.tool[data-v-794cdcb4]{display:flex;margin:4px 0;justify-content:center}#source-list[data-v-794cdcb4]{margin-top:6px;height:calc(100vh - 119px)}#source-list[data-v-794cdcb4] .el-checkbox{margin-bottom:4px;width:100%}[data-v-fe904689] #debug-text{height:calc(100vh - 86px)}[data-v-7e91a802] .el-input{width:100%}[data-v-7e91a802] #source-json{height:calc(100vh - 50px)}[data-v-dcce2457] .el-tabs__header{margin-bottom:5px}.flex-space-between[data-v-18524ea3]{display:flex;justify-content:space-between;align-items:baseline}.flex-column-center[data-v-18524ea3]{display:flex;flex-direction:column;justify-content:center}.menu>.el-button[data-v-18524ea3]{margin:4px;padding:1em;width:6em}.hotkeys-item .title[data-v-18524ea3]{width:5em;display:flex;justify-content:flex-end;margin-right:1em}.hotkeys-item__content[data-v-18524ea3]{display:flex;flex-wrap:wrap;flex:1}.hotkeys-item__content div[data-v-18524ea3]{margin-bottom:1em}.hotkeys-item__content span[data-v-18524ea3]{margin:.5em}[data-v-d4af52d7] .el-tab-pane{height:calc(100vh - 55px);padding-top:15px;padding-right:5px;overflow-y:auto}[data-v-d4af52d7] .el-tabs__header{margin:0}kbd{background-color:#fcfcfc;border-radius:3px;border:1px solid hsl(0deg,0%,80%);padding:4px 5px;font-weight:700}code{background-color:#f2f1f1;padding:.125rem .25rem;border-radius:.25rem;font-size:.835rem}body{padding:0;margin:0}.el-tabs__header{position:sticky;top:0px;z-index:2;background-color:#fff}.editor[data-v-ef32d41f]{display:flex;height:100vh;overflow:hidden}.editor .left[data-v-ef32d41f]{flex:1;margin-left:20px}.editor .right[data-v-ef32d41f]{flex:1;width:360px;margin-right:20px}.editor #loading[data-v-ef32d41f]{position:fixed;top:100px;left:90vw}
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -4,10 +4,10 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" href="./favicon.ico" />
|
<link rel="icon" href="./favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||||
<script type="module" crossorigin src="./assets/index-cbd182e6.js"></script>
|
<script type="module" crossorigin src="./assets/index-ab2e286b.js"></script>
|
||||||
<link rel="modulepreload" crossorigin href="./assets/vendor-8be1f5fb.js">
|
<link rel="modulepreload" crossorigin href="./assets/vendor-8be1f5fb.js">
|
||||||
<link rel="stylesheet" href="./assets/vendor-6f0d1692.css">
|
<link rel="stylesheet" href="./assets/vendor-6f0d1692.css">
|
||||||
<link rel="stylesheet" href="./assets/index-964f1746.css">
|
<link rel="stylesheet" href="./assets/index-71b7f9c4.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
"ComponentPublicInstance": true,
|
"ComponentPublicInstance": true,
|
||||||
"ComputedRef": true,
|
"ComputedRef": true,
|
||||||
"EffectScope": true,
|
"EffectScope": true,
|
||||||
|
"ElLoading": true,
|
||||||
"ElMessage": true,
|
"ElMessage": true,
|
||||||
"InjectionKey": true,
|
"InjectionKey": true,
|
||||||
"PropType": true,
|
"PropType": true,
|
||||||
|
|||||||
Vendored
+1
@@ -5,6 +5,7 @@
|
|||||||
export {}
|
export {}
|
||||||
declare global {
|
declare global {
|
||||||
const EffectScope: typeof import('vue')['EffectScope']
|
const EffectScope: typeof import('vue')['EffectScope']
|
||||||
|
const ElLoading: typeof import('element-plus/es')['ElLoading']
|
||||||
const ElMessage: typeof import('element-plus/es')['ElMessage']
|
const ElMessage: typeof import('element-plus/es')['ElMessage']
|
||||||
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
|
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
|
||||||
const computed: typeof import('vue')['computed']
|
const computed: typeof import('vue')['computed']
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div
|
<div
|
||||||
class="book"
|
class="book"
|
||||||
v-for="book in props.books"
|
v-for="book in books"
|
||||||
:key="book.bookUrl"
|
:key="book.bookUrl"
|
||||||
@click="handleClick(book)"
|
@click="handleClick(book)"
|
||||||
>
|
>
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
<div class="author">
|
<div class="author">
|
||||||
{{ book.author }}
|
{{ book.author }}
|
||||||
</div>
|
</div>
|
||||||
<div class="tags" v-show="props.isSearch">
|
<div class="tags" v-show="isSearch">
|
||||||
<el-tag
|
<el-tag
|
||||||
v-for="tag in book.kind?.split(',').slice(0, 2)"
|
v-for="tag in book.kind?.split(',').slice(0, 2)"
|
||||||
:key="tag"
|
:key="tag"
|
||||||
@@ -30,16 +30,16 @@
|
|||||||
{{ tag }}
|
{{ tag }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</div>
|
</div>
|
||||||
<div class="update-info" v-show="!props.isSearch">
|
<div class="update-info" v-show="!isSearch">
|
||||||
<div class="dot">•</div>
|
<div class="dot">•</div>
|
||||||
<div class="size">共{{ book.totalChapterNum }}章</div>
|
<div class="size">共{{ book.totalChapterNum }}章</div>
|
||||||
<div class="dot">•</div>
|
<div class="dot">•</div>
|
||||||
<div class="date">{{ dateFormat(book.lastCheckTime) }}</div>
|
<div class="date">{{ dateFormat(book.lastCheckTime) }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="intro" v-show="props.isSearch">{{ book.intro }}</div>
|
<div class="intro" v-show="isSearch">{{ book.intro }}</div>
|
||||||
|
|
||||||
<div class="dur-chapter" v-show="!props.isSearch">
|
<div class="dur-chapter" v-show="!isSearch">
|
||||||
已读:{{ book.durChapterTitle }}
|
已读:{{ book.durChapterTitle }}
|
||||||
</div>
|
</div>
|
||||||
<div class="last-chapter">最新:{{ book.latestChapterTitle }}</div>
|
<div class="last-chapter">最新:{{ book.latestChapterTitle }}</div>
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-for="(para, index) in props.carray" :key="index">
|
<div v-for="(para, index) in carray" :key="index">
|
||||||
<img
|
<img
|
||||||
class="full"
|
class="full"
|
||||||
v-if="/^\s*<img[^>]*src[^>]+>$/.test(para)"
|
v-if="/^\s*<img[^>]*src[^>]+>$/.test(para)"
|
||||||
:src="getImageSrc(para)"
|
:src="getImageSrc(para)"
|
||||||
|
@error.once="proxyImage"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
/>
|
/>
|
||||||
<p v-else :style="style" v-html="para" />
|
<p v-else :style="style" v-html="para" />
|
||||||
@@ -12,8 +13,10 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import config from "../plugins/config";
|
import config from "../plugins/config";
|
||||||
|
import { getImageFromLegado, isLegadoUrl } from "../plugins/utils";
|
||||||
|
|
||||||
const store = useBookStore();
|
const store = useBookStore();
|
||||||
const props = defineProps(["carray"]);
|
defineProps(["carray"]);
|
||||||
|
|
||||||
const fontFamily = computed(() => {
|
const fontFamily = computed(() => {
|
||||||
if (store.config.font >= 0) {
|
if (store.config.font >= 0) {
|
||||||
@@ -30,10 +33,15 @@ const style = computed(() => {
|
|||||||
return style;
|
return style;
|
||||||
});
|
});
|
||||||
|
|
||||||
function getImageSrc(content) {
|
const getImageSrc = (content) => {
|
||||||
const imgPattern = /<img[^>]*src="([^"]*(?:"[^>]+\})?)"[^>]*>/;
|
const imgPattern = /<img[^>]*src="([^"]*(?:"[^>]+\})?)"[^>]*>/;
|
||||||
return content.match(imgPattern)[1];
|
const src = content.match(imgPattern)[1];
|
||||||
}
|
if (isLegadoUrl(src)) return getImageFromLegado(src);
|
||||||
|
return src;
|
||||||
|
};
|
||||||
|
const proxyImage = (event) => {
|
||||||
|
event.target.src = getImageFromLegado(event.target.src);
|
||||||
|
};
|
||||||
|
|
||||||
watch(fontSize, () => {
|
watch(fontSize, () => {
|
||||||
store.setShowContent(false);
|
store.setShowContent(false);
|
||||||
|
|||||||
@@ -11,12 +11,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
const { source } = defineProps(['source'])
|
defineProps(["source"]);
|
||||||
const store = useSourceStore()
|
const store = useSourceStore();
|
||||||
const { errorPushSources } = storeToRefs(store)
|
const { errorPushSources } = storeToRefs(store);
|
||||||
const handleSourceClick = source => {
|
const handleSourceClick = (source) => {
|
||||||
store.changeCurrentSource(source)
|
store.changeCurrentSource(source);
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.error {
|
.error {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<el-checkbox-group id="source-list" v-model="sourceSelect">
|
<el-checkbox-group id="source-list" v-model="sourceSelect">
|
||||||
<virtual-list
|
<virtual-list
|
||||||
style="height: 100%; overflow-y: auto; overflow-x: hidden;"
|
style="height: 100%; overflow-y: auto; overflow-x: hidden"
|
||||||
:data-key="(source) => source.bookSourceUrl || source.sourceUrl"
|
:data-key="(source) => source.bookSourceUrl || source.sourceUrl"
|
||||||
:data-sources="sourcesFiltered"
|
:data-sources="sourcesFiltered"
|
||||||
:data-component="SourceItem"
|
:data-component="SourceItem"
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Folder, Delete, Download, Search } from "@element-plus/icons-vue";
|
import { Folder, Delete, Download, Search } from "@element-plus/icons-vue";
|
||||||
import { isSourceContains } from "../utils/souce";
|
import { isSourceContains } from "../utils/souce";
|
||||||
import VirtualList from 'vue3-virtual-scroll-list';
|
import VirtualList from "vue3-virtual-scroll-list";
|
||||||
import SourceItem from "./SourceItem.vue";
|
import SourceItem from "./SourceItem.vue";
|
||||||
|
|
||||||
const store = useSourceStore();
|
const store = useSourceStore();
|
||||||
@@ -98,7 +98,10 @@ const importSourceFile = () => {
|
|||||||
};
|
};
|
||||||
const outExport = () => {
|
const outExport = () => {
|
||||||
const exportFile = document.createElement("a");
|
const exportFile = document.createElement("a");
|
||||||
let sources = sourceSelect.value.length === 0 ? sourcesFiltered.value : sourceSelect.value,
|
let sources =
|
||||||
|
sourceSelect.value.length === 0
|
||||||
|
? sourcesFiltered.value
|
||||||
|
: sourceSelect.value,
|
||||||
sourceType = isBookSource.value ? "BookSource" : "RssSource";
|
sourceType = isBookSource.value ? "BookSource" : "RssSource";
|
||||||
|
|
||||||
exportFile.download = `${sourceType}_${Date()
|
exportFile.download = `${sourceType}_${Date()
|
||||||
@@ -129,5 +132,4 @@ const outExport = () => {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-tabs id="source-edit">
|
<el-tabs id="source-edit">
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
v-for="{ name, children } in tabsData"
|
v-for="{ name, children } in Object.values(config)"
|
||||||
:label="name"
|
:label="name"
|
||||||
:key="name"
|
:key="name"
|
||||||
>
|
>
|
||||||
@@ -59,11 +59,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
const store = useSourceStore();
|
const store = useSourceStore();
|
||||||
|
defineProps(["config"]);
|
||||||
const props = defineProps(["config"]);
|
|
||||||
|
|
||||||
const tabsData = Object.values(props.config);
|
|
||||||
|
|
||||||
const { currentSource } = storeToRefs(store);
|
const { currentSource } = storeToRefs(store);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -73,25 +73,27 @@ import { isInvaildSource } from "../utils/souce";
|
|||||||
const store = useSourceStore();
|
const store = useSourceStore();
|
||||||
const pull = () => {
|
const pull = () => {
|
||||||
const loadingMsg = ElMessage({
|
const loadingMsg = ElMessage({
|
||||||
message: '加载中……',
|
message: "加载中……",
|
||||||
showClose: true,
|
showClose: true,
|
||||||
duration: 0
|
duration: 0,
|
||||||
})
|
});
|
||||||
API.getSources().then(({ data }) => {
|
API.getSources()
|
||||||
if (data.isSuccess) {
|
.then(({ data }) => {
|
||||||
store.changeTabName("editList");
|
if (data.isSuccess) {
|
||||||
store.saveSources(data.data);
|
store.changeTabName("editList");
|
||||||
ElMessage({
|
store.saveSources(data.data);
|
||||||
message: `成功拉取${data.data.length}条源`,
|
ElMessage({
|
||||||
type: "success",
|
message: `成功拉取${data.data.length}条源`,
|
||||||
});
|
type: "success",
|
||||||
} else {
|
});
|
||||||
ElMessage({
|
} else {
|
||||||
message: data.errorMsg ?? "后端错误",
|
ElMessage({
|
||||||
type: "error",
|
message: data.errorMsg ?? "后端错误",
|
||||||
});
|
type: "error",
|
||||||
}
|
});
|
||||||
}).finally(() => loadingMsg.close());
|
}
|
||||||
|
})
|
||||||
|
.finally(() => loadingMsg.close());
|
||||||
};
|
};
|
||||||
|
|
||||||
const push = () => {
|
const push = () => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { formatDate } from "@vueuse/shared";
|
import { formatDate } from "@vueuse/shared";
|
||||||
|
|
||||||
export const isLegadoUrl = (/** @type {string} */ url) =>
|
export const isLegadoUrl = (/** @type {string} */ url) =>
|
||||||
/,\s*\s*\{/.test(url) ||
|
/,\s*\{/.test(url) ||
|
||||||
!(
|
!(
|
||||||
url.startsWith("http") ||
|
url.startsWith("http") ||
|
||||||
url.startsWith("data:") ||
|
url.startsWith("data:") ||
|
||||||
@@ -11,10 +11,6 @@ export const isLegadoUrl = (/** @type {string} */ url) =>
|
|||||||
* @param {string} src
|
* @param {string} src
|
||||||
*/
|
*/
|
||||||
export function getImageFromLegado(src) {
|
export function getImageFromLegado(src) {
|
||||||
//返回阅读代理的图片链接 已经代理的或者dataurl返回传入值
|
|
||||||
if (!isLegadoUrl(src)) {
|
|
||||||
return src;
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
(import.meta.env.VITE_API || location.origin) +
|
(import.meta.env.VITE_API || location.origin) +
|
||||||
"/image?path=" +
|
"/image?path=" +
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
<div class="title" :index="data.index" v-if="showContent">
|
<div class="title" :index="data.index" v-if="showContent">
|
||||||
{{ data.title }}
|
{{ data.title }}
|
||||||
</div>
|
</div>
|
||||||
<chapter-content :carray="data.content" v-if="showContent"/>
|
<chapter-content :carray="data.content" v-if="showContent" />
|
||||||
</div>
|
</div>
|
||||||
<div class="loading" ref="loading"></div>
|
<div class="loading" ref="loading"></div>
|
||||||
<div class="bottom-bar" ref="bottom"></div>
|
<div class="bottom-bar" ref="bottom"></div>
|
||||||
@@ -105,7 +105,7 @@ const loadingSerive = ref(null);
|
|||||||
const content = ref();
|
const content = ref();
|
||||||
|
|
||||||
watch(showLoading, (loading) => {
|
watch(showLoading, (loading) => {
|
||||||
if (!loading) return loadingSerive.value?.close();
|
if (!loading) return loadingSerive.value?.close();
|
||||||
loadingSerive.value = ElLoading.service({
|
loadingSerive.value = ElLoading.service({
|
||||||
target: content.value,
|
target: content.value,
|
||||||
spinner: loadingSvg,
|
spinner: loadingSvg,
|
||||||
@@ -139,15 +139,13 @@ const {
|
|||||||
showContent,
|
showContent,
|
||||||
} = storeToRefs(store);
|
} = storeToRefs(store);
|
||||||
|
|
||||||
const { chapterPos, index: chapterIndex} = toRefs(store.readingBook);
|
const { chapterPos, index: chapterIndex } = toRefs(store.readingBook);
|
||||||
|
|
||||||
const { theme, infiniteLoading } = toRefs(store.config);
|
const { theme, infiniteLoading } = toRefs(store.config);
|
||||||
|
|
||||||
// 主题部分
|
// 主题部分
|
||||||
const bodyColor = computed(() => settings.themes[theme.value].body);
|
const bodyColor = computed(() => settings.themes[theme.value].body);
|
||||||
const chapterColor = computed(
|
const chapterColor = computed(() => settings.themes[theme.value].content);
|
||||||
() => settings.themes[theme.value].content
|
|
||||||
);
|
|
||||||
const popupColor = computed(() => settings.themes[theme.value].popup);
|
const popupColor = computed(() => settings.themes[theme.value].popup);
|
||||||
|
|
||||||
const readWidth = computed(() => {
|
const readWidth = computed(() => {
|
||||||
@@ -215,7 +213,6 @@ watch(popupColor, (color) => {
|
|||||||
rightBarTheme.value.background = color;
|
rightBarTheme.value.background = color;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
if (chapterData.value.length > 0) {
|
if (chapterData.value.length > 0) {
|
||||||
store.setContentLoading(false);
|
store.setContentLoading(false);
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ const searchBook = () => {
|
|||||||
() => {
|
() => {
|
||||||
showLoading.value = false;
|
showLoading.value = false;
|
||||||
if (books.value.length == 0) {
|
if (books.value.length == 0) {
|
||||||
ElMessage.info("搜索结果为空")
|
ElMessage.info("搜索结果为空");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -224,7 +224,7 @@ const fetchBookShelfData = () => {
|
|||||||
showLoading.value = false;
|
showLoading.value = false;
|
||||||
store.setConnectType("danger");
|
store.setConnectType("danger");
|
||||||
store.setConnectStatus("连接失败");
|
store.setConnectStatus("连接失败");
|
||||||
ElMessage.error("后端连接失败")
|
ElMessage.error("后端连接失败");
|
||||||
store.setNewConnect(false);
|
store.setNewConnect(false);
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -34,10 +34,5 @@ if (/bookSource/i.test(location.href)) {
|
|||||||
width: 360px;
|
width: 360px;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
#loading {
|
|
||||||
position: fixed;
|
|
||||||
top: 100px;
|
|
||||||
left: 90vw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user