Skip to content

Commit

Permalink
Update Example
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed May 11, 2023
1 parent 9c08480 commit 721569e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/interfaces/utils/example.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// 原则上都用tauri提供的fetch发送请求,因为只要这样才能使软件内代理生效
// 实在不行就用axios吧
import { fetch } from '@tauri-apps/api/http';
import { get } from '../windows/main';

Expand Down Expand Up @@ -42,7 +44,7 @@ export async function translate(text, from, to) {
}
// 完成翻译过程
// ......
// 使用request发送请求 示例代码如下

let proxy = get('proxy') ?? '';
let res = await fetch(url, {
method: 'POST',
Expand Down

0 comments on commit 721569e

Please sign in to comment.