using tauri http api run plugin to fixed cors in App

This commit is contained in:
lloydzhou
2024-09-04 21:04:13 +08:00
parent 04e1ab63bb
commit f9a047aad4
9 changed files with 75 additions and 20 deletions

View File

@@ -4,6 +4,7 @@ import { StoreKey } from "../constant";
import { nanoid } from "nanoid";
import { createPersistStore } from "../utils/store";
import yaml from "js-yaml";
import { adapter } from "../utils";
export type Plugin = {
id: string;
@@ -61,6 +62,7 @@ export const FunctionToolService = {
const api = new OpenAPIClientAxios({
definition: yaml.load(plugin.content) as any,
axiosConfigDefaults: {
adapter: adapter as any,
baseURL,
headers,
},