[Update] update tauri v1-> v2 (development)

This commit is contained in:
Sakamoto Shiina
2025-05-03 08:47:02 +09:00
parent c6f669336a
commit 3210d5c898
26 changed files with 9570 additions and 7229 deletions

View File

@@ -1,18 +1,24 @@
import { fetch as tauriFetch, ResponseType } from "@tauri-apps/api/http";
import { fetch as tauriFetch } from "@tauri-apps/plugin-http";
export const useFetch = () => {
const asyncTauriFetchGithub = async (url) => {
const asyncTauriFetchGithub = async (url, {return_row = false} = {}) => {
console.log("tauriFetch", url);
const release_response = await tauriFetch(url, {
const response = await tauriFetch(url, {
method: "GET",
responseType: ResponseType.Json,
headers: {
"Accept": "application/vnd.github+json",
"User-Agent": "VRCTPluginApp"
}
});
return release_response;
if (response.status !== 200) {
throw new Error(url, "Failed to fetch, response: " + response);
}
if (return_row === true) return await response;
return await response.json();
};
return {