Skip to content

Commit

Permalink
fix(frontend): 账号创建不允许特殊账号名 TencentBlueKing#8162
Browse files Browse the repository at this point in the history
  • Loading branch information
3octaves committed Nov 29, 2024
1 parent 3b40afa commit 5f2f4ea
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,13 @@
[AccountTypes.MONGODB]: MongoConfig.special_account,
[AccountTypes.SQLSERVER]: SqlserverConfig.special_account,
};
return !specialAccountMap[props.accountType].includes(value);
const validValue = props.accountType === AccountTypes.MONGODB ? value.split('.')[1] : value;
// 不能直接返回message?
if (specialAccountMap[props.accountType].includes(validValue)) {
return t('不允许使用特殊账号名称n', { n: validValue });
}
return true;
},
message: t('不允许使用特殊账号名称n', { n: state.formdata.user }),
},
],
password: [
Expand Down

0 comments on commit 5f2f4ea

Please sign in to comment.