feat(diy): add in-page error prompt for diy data loading failure

1. add multi-language error copy for api request and network exceptions
2. add fixed top error banner component for index page
3. rewrite diy data request error handling: replace toast with reliable in-page prompt with retry button
4. add detailed error reason and request url display in error prompt
This commit is contained in:
2026-07-18 15:58:40 +08:00
parent 5831189e5e
commit c8d92d8100
4 changed files with 147 additions and 7 deletions

View File

@@ -68,6 +68,14 @@ export const lang = {
retry: '重试',
noDiyData: '未配置自定义页面数据',
locationNotAvailable: '未获取到定位',
// 数据加载失败详细文案
loadFailTpl: '页面数据加载失败:{reason},请稍后重试',
errNotFound: '接口不存在',
errServer: '服务器异常',
errAuth: '无访问权限',
errRequest: '请求失败',
errTimeout: '请求超时',
errNetwork: '网络连接失败',
},
// 客服服务
@@ -142,6 +150,8 @@ export const lang = {
serverError: '服务暂时不可用,请稍后重试',
// 请求被中断
aborted: '请求已取消',
// 未知错误(errorType 分类兜底,如非 5xx 的 HTTP 状态码 404 等)
unknown: '请求失败,请稍后重试',
// 未知错误
unknownError: '请求失败,请稍后重试',
},