This commit is contained in:
Xwite
2024-10-12 18:24:08 +08:00
parent 59e75b3007
commit b95deeb607
3 changed files with 19 additions and 13 deletions
+7 -1
View File
@@ -85,6 +85,7 @@ import { useBookStore } from "@/store";
import githubUrl from "@/assets/imgs/github.png";
import { useLoading } from "@/hooks/loading";
import { Search as SearchIcon } from "@element-plus/icons-vue";
import {baseURL_localStorage_key} from "@/api/axios"
import API, {
legado_http_entry_point,
validatorHttpUrl,
@@ -203,7 +204,7 @@ export default defineComponent({
instance.confirmButtonLoading = true;
instance.confirmButtonText = "校验中……";
// instance.inputValue
const url = new URL(instance.inputValue);
const url = new URL(instance.inputValue).toString();
API.testLeagdoHttpUrlConnection(url)
//API.getBookShelf()
.then(function (configStr) {
@@ -213,6 +214,11 @@ export default defineComponent({
store.clearSearchBooks();
store.setNewConnect(false);
setLeagdoHttpUrl(url);
if (url === location.origin) {
localStorage.removeItem(baseURL_localStorage_key);
} else {
localStorage.setItem(baseURL_localStorage_key, url);
}
store.setConnectStatus("已连接 " + url.toString());
fetchBookShelfData();
done();