全局中文化
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { usePermission } from "../utils/permission";
|
||||
import { canDoAction, type StateMachine } from "../state-machine";
|
||||
import { TEXT } from "../locales";
|
||||
|
||||
export interface ActionContext {
|
||||
actorRole?: string | null;
|
||||
@@ -27,7 +28,7 @@ export const evaluateAction = (context: ActionContext): ActionDecision => {
|
||||
return {
|
||||
allowed: false,
|
||||
severity: "violation",
|
||||
reason: "无权限执行该操作",
|
||||
reason: TEXT.common.messages.noPermission,
|
||||
auditType: "UNAUTHORIZED_ACTION_ATTEMPT",
|
||||
};
|
||||
}
|
||||
@@ -36,7 +37,7 @@ export const evaluateAction = (context: ActionContext): ActionDecision => {
|
||||
return {
|
||||
allowed: false,
|
||||
severity: "warning",
|
||||
reason: "当前状态不允许该操作",
|
||||
reason: TEXT.common.messages.invalidStateAction,
|
||||
auditType: "INVALID_STATE_TRANSITION_ATTEMPT",
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user