merge: 合入总仓库 weiyuan(bfdfb339) web/ 新功能,保留 ui-optimization 的 UI 重构
来源:luoguang/monkey-ai weiyuan@bfdfb339 的 web/(经 sync/main-weiyuan-web-bfdfb339 同步)
同步基准:总仓库 a2ca13cb = 本仓库初始导入 d8f3aee2
冲突处理原则:保留 ui-optimization 的 UI(样式/结构/组件),嫁接 weiyuan 的功能逻辑。
- i18n:按键三方合并;ours 的「令牌→密钥」改名键上移植 theirs 的术语修订
- task-logs / OrgLogs:ours 已手工移植同一功能(6ad95e2),保留 ours
- 删除:OrgCreate(theirs 下线 /org/create)、旧 image 组件与 VideoRegenerateModal(theirs 体验中心重写)、
OrgAvatarSection / PricingBentoPage / CommissionConsole(ours 重构中已移除)
- 测试:users-pagination 的 i18next mock 补 t();theirs 新增文件补 license header
This commit is contained in:
@@ -18,6 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import React, { useState, useCallback, useEffect } from 'react';
|
||||
import { API, showError, showSuccess } from '../../helpers';
|
||||
import i18next from 'i18next';
|
||||
|
||||
/**
|
||||
* 风控看板数据 Hook
|
||||
@@ -107,15 +108,15 @@ export const useRiskControlData = (active = true) => {
|
||||
try {
|
||||
const res = await API.post('/api/analytics/risk/rules', rule);
|
||||
if (res.data.success) {
|
||||
showSuccess('保存成功');
|
||||
showSuccess(i18next.t('保存成功'));
|
||||
// 阈值变化后,列表里"是否命中"的状态标签依赖新规则计算,需联动刷新
|
||||
await Promise.all([fetchRules(), fetchSuspects()]);
|
||||
return true;
|
||||
}
|
||||
showError(res.data.message || '保存失败');
|
||||
showError(res.data.message || i18next.t('保存失败'));
|
||||
return false;
|
||||
} catch (e) {
|
||||
showError(e?.message || '保存失败');
|
||||
showError(e?.message || i18next.t('保存失败'));
|
||||
return false;
|
||||
}
|
||||
},
|
||||
@@ -126,13 +127,13 @@ export const useRiskControlData = (active = true) => {
|
||||
try {
|
||||
const res = await API.post('/api/analytics/risk/rules/run-now');
|
||||
if (res.data.success) {
|
||||
showSuccess('已触发后台扫描');
|
||||
showSuccess(i18next.t('已触发后台扫描'));
|
||||
return true;
|
||||
}
|
||||
showError(res.data.message);
|
||||
return false;
|
||||
} catch (e) {
|
||||
showError(e?.message || '触发失败');
|
||||
showError(e?.message || i18next.t('触发失败'));
|
||||
return false;
|
||||
}
|
||||
}, []);
|
||||
@@ -179,7 +180,7 @@ export const useRiskControlData = (active = true) => {
|
||||
reason: reason || '',
|
||||
});
|
||||
if (res.data.success) {
|
||||
showSuccess('解封成功');
|
||||
showSuccess(i18next.t('解封成功'));
|
||||
// 解封会改变两个数据集的状态,并发刷新
|
||||
await Promise.all([fetchSuspects(), fetchBanLogs()]);
|
||||
return true;
|
||||
@@ -187,7 +188,7 @@ export const useRiskControlData = (active = true) => {
|
||||
showError(res.data.message);
|
||||
return false;
|
||||
} catch (e) {
|
||||
showError(e?.message || '解封失败');
|
||||
showError(e?.message || i18next.t('解封失败'));
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user