feat(huya): 合并外部单协作 CK 权限
This commit is contained in:
@@ -345,7 +345,7 @@ export const huyaApi = {
|
||||
'/huya/external-orders/ck/export',
|
||||
{ ids },
|
||||
),
|
||||
/** 单行复制 CK(仅超级管理员;后端再次校验角色) */
|
||||
/** 单行复制 CK(与批量导出共用 huya:collab:ck_export 权限) */
|
||||
copyCollabOrderCk: (id: number) =>
|
||||
api.post<HuyaCollabCkExportResult, HuyaCollabCkExportResult>(
|
||||
`/huya/external-orders/${id}/ck/copy`,
|
||||
|
||||
@@ -501,10 +501,8 @@ export default function HuyaCollabPage() {
|
||||
const { can, user } = usePermissions();
|
||||
const canEdit = can('huya:collab:edit');
|
||||
const canManage = can('huya:collab:manage');
|
||||
// 导出 CK 是把凭据带出系统,单独一个权限点(默认只给运营,见 permissions.py)
|
||||
// 单行复制与批量导出共用这个权限点(默认运营和客服都有)
|
||||
const canExportCk = can('huya:collab:ck_export');
|
||||
// 「复制 CK」是单行一键带走凭据,按用户要求只给超级管理员(后端也会再校验一次)
|
||||
const isAdmin = user?.role === 'super_admin';
|
||||
|
||||
const [rows, setRows] = useState<HuyaCollabOrder[]>([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
@@ -1399,7 +1397,7 @@ export default function HuyaCollabPage() {
|
||||
}
|
||||
};
|
||||
|
||||
/** 单行「复制 CK」:只有超级管理员能看到按钮,后端还会再校验一次角色。 */
|
||||
/** 单行「复制 CK」与批量导出共用权限点,后端会再次校验。 */
|
||||
const copyOneCk = async (row: HuyaCollabOrder) => {
|
||||
setBusy(true);
|
||||
try {
|
||||
@@ -2249,8 +2247,8 @@ export default function HuyaCollabPage() {
|
||||
补资料
|
||||
</Button>
|
||||
)}
|
||||
{isAdmin && !row.is_archived && (
|
||||
<Tooltip title={row.has_cookie ? '复制这一行的 CK 明文(仅管理员)' : '这行还没贴 CK'}>
|
||||
{canExportCk && !row.is_archived && (
|
||||
<Tooltip title={row.has_cookie ? '复制这一行的 CK 明文' : '这行还没贴 CK'}>
|
||||
<Button size="small" icon={<CopyOutlined />}
|
||||
disabled={busy || !row.has_cookie}
|
||||
onClick={() => void copyOneCk(row)}>
|
||||
|
||||
Reference in New Issue
Block a user