修复: vite加@路径别名(解决linter改i18n为@/i18n后5文件import解析失败)+CR-08 P2-7 store error fallback i18n(projects/ideas/workflow/knowledge/tasks补err块+全局t)
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import { workflowApi } from '../../api'
|
||||
import i18n from '@/i18n'
|
||||
import { state, _eventUnlisten, setEventUnlisten } from './state'
|
||||
|
||||
// composable 外全局 i18n 实例(非 setup 上下文)
|
||||
const t = ((i18n as any).global.t as (k: string) => string).bind((i18n as any).global)
|
||||
|
||||
/**
|
||||
* 工作流 + 审批子 store(共享全局 state)。
|
||||
*
|
||||
@@ -16,7 +20,7 @@ export function createWorkflowStore() {
|
||||
try {
|
||||
state.workflowExecutions = await workflowApi.listExecutions()
|
||||
} catch (e: any) {
|
||||
state.error = e?.toString() ?? '加载工作流记录失败'
|
||||
state.error = e?.toString() ?? t('projects.err.loadWorkflowFailed')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user