♻️ 姑且能跑 dev,尚需调试功能

This commit is contained in:
目棃
2024-07-02 23:05:33 +08:00
parent 1214501691
commit 367307029b
66 changed files with 12626 additions and 2887 deletions

View File

@@ -28,8 +28,7 @@
</TOverlay>
</template>
<script setup lang="ts">
import { http } from "@tauri-apps/api";
import { ResponseType } from "@tauri-apps/api/http";
import { fetch } from "@tauri-apps/plugin-http";
import { computed, onMounted, ref, watch } from "vue";
import { xml2json } from "xml-js";
@@ -166,11 +165,10 @@ async function loadText(): Promise<void> {
async function parseXml(link: string) {
try {
const res = await http.fetch<string>(link, {
method: "GET",
responseType: ResponseType.Text,
});
return JSON.parse(xml2json(res.data));
const response = await fetch(link, { method: "GET" });
const data = await response.arrayBuffer();
const xml = new TextDecoder("utf-8").decode(data);
return JSON.parse(xml2json(xml));
} catch (error) {
console.error(error);
return false;