feat: 新增xq0031_xq0032 ERP报表导出插件,完成功能与基建更新
1. 新增xq0031_xq0032插件:包含前后端源码、打包脚本、配置文件与插件元数据 2. 新增内网文件服务器组件:exe、启停脚本、打包脚本与配置 3. 新增敏感凭证RSA加密下发能力与存储结构 4. 新增大文件源管理表与相关API 5. 优化登录流程与会话管理,新增Chrome自动化安装工具链 6. 清理废弃插件与示例代码 7. 更新版本号至1.1.3,完善安装包与.gitignore配置
This commit is contained in:
@@ -5,7 +5,17 @@ async function req(url, opts) {
|
||||
const res = await fetch(url, opts)
|
||||
if (!res.ok) {
|
||||
let msg = `HTTP ${res.status}`
|
||||
try { msg = (await res.json()).detail || msg } catch (_) {}
|
||||
try {
|
||||
const detail = (await res.json()).detail
|
||||
// FastAPI 422 的 detail 是 [{loc,msg,type},…] 数组;普通错误是字符串/含 msg 的对象
|
||||
if (typeof detail === 'string') msg = detail
|
||||
else if (Array.isArray(detail)) {
|
||||
msg = detail.map((d) => {
|
||||
const where = Array.isArray(d.loc) ? d.loc.filter((p) => p !== 'body').join('.') : ''
|
||||
return where ? `${where}: ${d.msg}` : (d.msg || JSON.stringify(d))
|
||||
}).join(';')
|
||||
} else if (detail && typeof detail === 'object') msg = detail.msg || JSON.stringify(detail)
|
||||
} catch (_) { /* 非 JSON 响应,保留 HTTP 状态码提示 */ }
|
||||
throw new Error(msg)
|
||||
}
|
||||
return res.json()
|
||||
@@ -114,6 +124,40 @@ export async function adminReports(limit = 300) {
|
||||
export async function adminStats() {
|
||||
return req('/api/admin/stats', { headers: adminHeaders() })
|
||||
}
|
||||
export async function adminCredsList() {
|
||||
return req('/api/admin/creds/manage', { headers: adminHeaders() })
|
||||
}
|
||||
export async function adminCredsSeed(body) {
|
||||
return req('/api/admin/creds/seed', {
|
||||
method: 'POST',
|
||||
headers: adminHeaders({ 'Content-Type': 'application/json' }),
|
||||
body: JSON.stringify(body)
|
||||
})
|
||||
}
|
||||
export async function adminFileSources(category = '') {
|
||||
const qs = category ? '?category=' + encodeURIComponent(category) : ''
|
||||
return req('/api/admin/file-sources' + qs, { headers: adminHeaders() })
|
||||
}
|
||||
export async function adminFileSourceCreate(body) {
|
||||
return req('/api/admin/file-sources', {
|
||||
method: 'POST',
|
||||
headers: adminHeaders({ 'Content-Type': 'application/json' }),
|
||||
body: JSON.stringify(body)
|
||||
})
|
||||
}
|
||||
export async function adminFileSourcePatch(id, body) {
|
||||
return req(`/api/admin/file-sources/${id}`, {
|
||||
method: 'PATCH',
|
||||
headers: adminHeaders({ 'Content-Type': 'application/json' }),
|
||||
body: JSON.stringify(body)
|
||||
})
|
||||
}
|
||||
export async function adminFileSourceDelete(id) {
|
||||
return req(`/api/admin/file-sources/${id}`, {
|
||||
method: 'DELETE',
|
||||
headers: adminHeaders({ 'Content-Type': 'application/json' })
|
||||
})
|
||||
}
|
||||
export async function adminUpload(pluginId, name, version, file) {
|
||||
const fd = new FormData()
|
||||
fd.append('upload', file)
|
||||
|
||||
Reference in New Issue
Block a user