修复规划页错误展示和迁移发布包

This commit is contained in:
2026-07-21 22:30:08 +08:00
parent 7d4c7539e2
commit 0965a35ed7
8 changed files with 64 additions and 15 deletions
+16 -1
View File
@@ -1,6 +1,16 @@
const planningApi = require('../../api/planning')
const dateUtil = require('../../utils/date')
const CALENDAR_ERROR_FALLBACK_MESSAGE = '规划数据暂时不可用,请稍后重试'
const TECHNICAL_ERROR_PATTERNS = [
/###\s*Error/i,
/SQLSyntaxErrorException/i,
/bad\s+SQL\s+grammar/i,
/Unknown\s+column/i,
/mapper\//i,
/java\./i
]
function canCreateAppointment() {
const app = getApp()
const userInfo = app.globalData.userInfo || {}
@@ -8,7 +18,12 @@ function canCreateAppointment() {
}
function resolveCalendarErrorMessage(error) {
return error && error.message ? error.message : '规划数据加载失败'
const message = error && error.message ? String(error.message).trim() : ''
if (!message) {
return CALENDAR_ERROR_FALLBACK_MESSAGE
}
const hasTechnicalMessage = TECHNICAL_ERROR_PATTERNS.some(pattern => pattern.test(message))
return hasTechnicalMessage ? CALENDAR_ERROR_FALLBACK_MESSAGE : message
}
function toLocalDate(value) {