commit remaining frontend updates
This commit is contained in:
@@ -11,7 +11,7 @@ async function doExport(format) {
|
||||
closeExportModal();
|
||||
showToast('正在导出...');
|
||||
try {
|
||||
const res = await fetch(API + '/api/export?format=' + format, { headers: headers() });
|
||||
const res = await apiFetch(API + '/api/export?format=' + format);
|
||||
if (!res.ok) {
|
||||
const err = await res.json();
|
||||
showToast(err.error || '导出失败');
|
||||
@@ -88,9 +88,9 @@ async function confirmImport() {
|
||||
if (!pendingImportContent) return;
|
||||
showToast('正在导入...');
|
||||
try {
|
||||
const res = await fetch(API + '/api/import', {
|
||||
const res = await apiFetch(API + '/api/import', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'text/plain; charset=utf-8', 'Authorization': 'Bearer ' + token },
|
||||
headers: { 'Content-Type': 'text/plain; charset=utf-8' },
|
||||
body: pendingImportContent
|
||||
});
|
||||
const data = await res.json();
|
||||
|
||||
Reference in New Issue
Block a user