fix: 修复proxy_service和account_service中不当的顶层import
- proxy_service.py: 将requests和WhitelistManager改为函数内延迟import, 避免启动时加载不需要的依赖;移除未使用的get_exit_ip_via_proxy导入 - account_service.py: 移除未使用的func、joinedload、AuditLog、 user_has_permission顶层导入
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
} from 'antd';
|
||||
import { PlusOutlined, EditOutlined, DeleteOutlined, SafetyOutlined } from '@ant-design/icons';
|
||||
import { userApi, type UserInfo } from '../api/modules';
|
||||
import { getUser, hasPerm } from '../store/auth';
|
||||
import { usePermissions } from '../hooks/usePermissions';
|
||||
import { getErrorMessage } from '../utils/error';
|
||||
|
||||
const ROLE_OPTIONS = [
|
||||
@@ -50,8 +50,9 @@ export default function UsersPage() {
|
||||
const [selectedPerms, setSelectedPerms] = useState<string[]>([]);
|
||||
const [useCustom, setUseCustom] = useState(false);
|
||||
const [permLoading, setPermLoading] = useState(false);
|
||||
const { can } = usePermissions();
|
||||
|
||||
const canAssignPerm = hasPerm(getUser(), 'user:assign_permissions');
|
||||
const canAssignPerm = can('user:assign_permissions');
|
||||
|
||||
const loadUsers = async () => {
|
||||
setLoading(true);
|
||||
|
||||
Reference in New Issue
Block a user