Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3c757aa838 | |||
| 45b9c7140d |
@@ -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> = [
|
const columns: ColumnsType<UserListItem> = [
|
||||||
{ title: 'ID', dataIndex: 'id', width: 70 },
|
{ title: 'ID', dataIndex: 'id', width: 70 },
|
||||||
{ title: '手机号', dataIndex: 'phone' },
|
{ title: '手机号', dataIndex: 'phone' },
|
||||||
@@ -94,6 +113,11 @@ export default function UsersPage() {
|
|||||||
{canStatus && u.status !== 'deleted' && (
|
{canStatus && u.status !== 'deleted' && (
|
||||||
<a onClick={() => toggleStatus(u)}>{u.status === 'active' ? '封禁' : '解封'}</a>
|
<a onClick={() => toggleStatus(u)}>{u.status === 'active' ? '封禁' : '解封'}</a>
|
||||||
)}
|
)}
|
||||||
|
{canStatus && u.status !== 'deleted' && (
|
||||||
|
<a onClick={() => toggleDebugTrace(u)}>
|
||||||
|
{u.debug_trace_enabled ? '关调试链接' : '开调试链接'}
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ export interface UserListItem {
|
|||||||
nickname: string | null;
|
nickname: string | null;
|
||||||
register_channel: string;
|
register_channel: string;
|
||||||
status: string;
|
status: string;
|
||||||
|
// 调试链接权限:开了的用户在 App 比价结果页/记录页可复制 price.shaguabijia.com 的 trace 调试链接
|
||||||
|
debug_trace_enabled: boolean;
|
||||||
wechat_openid: string | null;
|
wechat_openid: string | null;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
last_login_at: string;
|
last_login_at: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user