-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
using tauri http api run plugin to fixed cors in App #6
Conversation
}} | ||
></input> | ||
</ListItem> | ||
{!getClientConfig()?.isApp && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
APP端不显示 解决 cors的选项
app/store/plugin.ts
Outdated
@@ -61,6 +62,7 @@ export const FunctionToolService = { | |||
const api = new OpenAPIClientAxios({ | |||
definition: yaml.load(plugin.content) as any, | |||
axiosConfigDefaults: { | |||
adapter: adapter as any, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里使用自定义的adapter
@@ -285,3 +287,34 @@ export function showPlugins(provider: ServiceProvider, model: string) { | |||
} | |||
return false; | |||
} | |||
|
|||
export function fetch( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里尝试使用 @tauri-apps/api/http
内部的fetch,这个fetch支持跨域
@@ -50,6 +50,11 @@ | |||
}, | |||
"notification": { | |||
"all": true | |||
}, | |||
"http": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
启用 http api
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
📝 补充信息 | Additional Information