fix(微信账号详情): 将限制等级字段从字符串类型改为数字类型
修改微信账号详情页面的限制等级字段类型,从字符串类型改为数字类型以匹配后端数据格式。同时更新相关颜色和文本显示的判断逻辑。
This commit is contained in:
@@ -17,7 +17,7 @@ export interface WechatAccountSummary {
|
||||
};
|
||||
restrictions: {
|
||||
id: number;
|
||||
level: string;
|
||||
level: number;
|
||||
reason: string;
|
||||
date: string;
|
||||
}[];
|
||||
|
||||
@@ -193,11 +193,11 @@ const WechatAccountDetail: React.FC = () => {
|
||||
navigate("/scenarios");
|
||||
};
|
||||
|
||||
const getRestrictionLevelColor = (level: string) => {
|
||||
const getRestrictionLevelColor = (level: number) => {
|
||||
switch (level) {
|
||||
case "high":
|
||||
case 3:
|
||||
return "text-red-600";
|
||||
case "medium":
|
||||
case 2:
|
||||
return "text-yellow-600";
|
||||
default:
|
||||
return "text-gray-600";
|
||||
@@ -519,9 +519,9 @@ const WechatAccountDetail: React.FC = () => {
|
||||
<span
|
||||
className={`${style["restriction-detail-level"]} ${getRestrictionLevelColor(restriction.level)}`}
|
||||
>
|
||||
{restriction.level === "high"
|
||||
{restriction.level === 3
|
||||
? "高风险"
|
||||
: restriction.level === "medium"
|
||||
: restriction.level === 2
|
||||
? "中风险"
|
||||
: "低风险"}
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user