fix(agent): allow super admins to manage agents

This commit is contained in:
2026-09-11 11:38:15 +08:00
parent f29a94339b
commit 6eee55860f
4 changed files with 10 additions and 6 deletions
@@ -46,6 +46,7 @@
"API": {
"SUCCESS_MESSAGE": "Agent added successfully",
"EXIST_MESSAGE": "Agent email already in use, Please try another email address",
"PERMISSION_MESSAGE": "Administrator permission is required to add an agent.",
"LIMIT_MESSAGE": "Agent limit reached. Please upgrade your plan or add more seats.",
"ERROR_MESSAGE": "Could not connect to Woot Server, Please try again later"
}
@@ -46,6 +46,7 @@
"API": {
"SUCCESS_MESSAGE": "添加客服成功",
"EXIST_MESSAGE": "该邮箱已被注册,请输入新的电子邮箱",
"PERMISSION_MESSAGE": "需要管理员权限才能添加客服",
"LIMIT_MESSAGE": "客服数量已达到上限,请升级套餐或增加客服名额",
"ERROR_MESSAGE": "无法连接服务器,请稍后再试"
}
@@ -96,6 +96,8 @@ const addAgent = async () => {
if (status === 422 && !attributes.includes('base')) {
useAlert(t('AGENT_MGMT.ADD.API.EXIST_MESSAGE'));
} else if (status === 403 || data?.error?.code === 'FORBIDDEN') {
useAlert(t('AGENT_MGMT.ADD.API.PERMISSION_MESSAGE'));
} else if (status === 402 || data?.error?.code === 'PAYMENT_REQUIRED') {
useAlert(t('AGENT_MGMT.ADD.API.LIMIT_MESSAGE'));
} else {