Compare commits

...

2 Commits

Author SHA1 Message Date
marco 3c757aa838 feat(debug-trace): 用户列表加「开/关调试链接」开关
- UserListItem 加 debug_trace_enabled
- 操作列加开关,调 POST /admin/api/users/{id}/debug-trace(operator 守卫、二次确认,仿封禁)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 15:31:27 +08:00
marco 45b9c7140d Merge pull request 'feat: 运营后台完善微信提现审核列表和批量处理' (#3) from feature/withdraw-review-ops into main
Reviewed-on: #3
2026-06-09 01:55:47 +08:00
2 changed files with 26 additions and 0 deletions
+24
View File
@@ -68,6 +68,25 @@ export default function UsersPage() {
});
};
const toggleDebugTrace = (u: UserListItem) => {
const next = !u.debug_trace_enabled;
Modal.confirm({
title: `确认${next ? '开启' : '关闭'}用户 ${u.phone} 的调试链接权限?`,
content: next
? '开启后,该用户在 App 比价结果页/记录页可复制 trace 调试链接发给开发排障'
: undefined,
onOk: async () => {
try {
await api.post(`/admin/api/users/${u.id}/debug-trace`, { enabled: next });
message.success('已更新调试链接权限');
reload();
} catch (e) {
message.error(errMsg(e));
}
},
});
};
const columns: ColumnsType<UserListItem> = [
{ title: 'ID', dataIndex: 'id', width: 70 },
{ title: '手机号', dataIndex: 'phone' },
@@ -94,6 +113,11 @@ export default function UsersPage() {
{canStatus && u.status !== 'deleted' && (
<a onClick={() => toggleStatus(u)}>{u.status === 'active' ? '封禁' : '解封'}</a>
)}
{canStatus && u.status !== 'deleted' && (
<a onClick={() => toggleDebugTrace(u)}>
{u.debug_trace_enabled ? '关调试链接' : '开调试链接'}
</a>
)}
</Space>
),
},
+2
View File
@@ -27,6 +27,8 @@ export interface UserListItem {
nickname: string | null;
register_channel: string;
status: string;
// 调试链接权限:开了的用户在 App 比价结果页/记录页可复制 price.shaguabijia.com 的 trace 调试链接
debug_trace_enabled: boolean;
wechat_openid: string | null;
created_at: string;
last_login_at: string;