Skip to content

Commit 7adf065

Browse files
committed
fix: 修改 api 参数的传递方式
1 parent 8364710 commit 7adf065

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

code.editor.fpk

-1.11 KB
Binary file not shown.

frontend/src/hooks/useCode.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ export default function useCode(option: { path: string; confirm: () => boolean }
2424
}
2525

2626
const { data } = await axios.get(HOST, {
27-
params: { path },
27+
params: { _api: 'read', path },
2828
responseType: 'blob',
29-
headers: { 'api-path': 'read' },
3029
})
3130

3231
code.blob = data
@@ -72,9 +71,7 @@ export default function useCode(option: { path: string; confirm: () => boolean }
7271
value: code.value,
7372
path: option.path,
7473
},
75-
{
76-
headers: { 'api-path': 'save' },
77-
},
74+
{ params: { _api: 'save' } },
7875
)
7976

8077
if (value.code === 200) {

0 commit comments

Comments
 (0)