fix(app): Install/Uninstall 公司权限校验 c.hex 改 c.hex()——UUIDObj 无 hex 属性导致权限误判(403/500)

This commit is contained in:
TermiNexus committed 2026-08-13 08:22:21 +08:00
1 parent 58e75f0829
commit 755d743b16
2 files changed
+6 -6

No files matched your search

+2 -2
View File
@@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GERP 管理系统</title>
<script type="module" crossorigin src="/assets/index-BCZ_yh-A.js"></script>
<script type="module" crossorigin src="/assets/index-B8Srzqt1.js"></script>
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
<link rel="modulepreload" crossorigin href="/assets/element-plus-DtMR4CIi.js">
<link rel="modulepreload" crossorigin href="/assets/utils-C0vl14oO.js">
@@ -14,7 +14,7 @@
<link rel="modulepreload" crossorigin href="/assets/formkit-DL7Nej8X.js">
<link rel="modulepreload" crossorigin href="/assets/vue-vendor-DmO0PmrK.js">
<link rel="modulepreload" crossorigin href="/assets/serverScope-C6yhSV7-.js">
<link rel="stylesheet" crossorigin href="/assets/style-C-s7UXLv.css">
<link rel="stylesheet" crossorigin href="/assets/style-C9mOjRHK.css">
</head>
<body>
<div id="app"></div>
+4 -4
View File
@@ -199,9 +199,9 @@ class AppInstallView(ELTAuthenticatedAPIView):
manageable, scope = AppManager.GetManageableCompanies(request)
if not manageable:
return Response({'code': 403, 'msg': '无权安装应用:您没有可管理的公司'}, status=403)
manageable_set = {c.hex for c in manageable}
manageable_set = {c.hex() for c in manageable}
company_bytes = _ParseUUIDList(request.data.get('CompanyUUIDs'))
invalid = [c.hex for c in company_bytes if c.hex not in manageable_set]
invalid = [c.hex() for c in company_bytes if c.hex() not in manageable_set]
if invalid:
return Response({'code': 403, 'msg': '无权为以下公司安装(不在您的管理范围)'}, status=403)
ok, err, count = AppManager.InstallCompanyApps(
@@ -247,9 +247,9 @@ class AppUninstallView(ELTAuthenticatedAPIView):
manageable, scope = AppManager.GetManageableCompanies(request)
if not manageable:
return Response({'code': 403, 'msg': '无权停用应用:您没有可管理的公司'}, status=403)
manageable_set = {c.hex for c in manageable}
manageable_set = {c.hex() for c in manageable}
company_bytes = _ParseUUIDList(request.data.get('CompanyUUIDs'))
invalid = [c.hex for c in company_bytes if c.hex not in manageable_set]
invalid = [c.hex() for c in company_bytes if c.hex() not in manageable_set]
if invalid:
return Response({'code': 403, 'msg': '无权为以下公司停用(不在您的管理范围)'}, status=403)
ok, err = AppManager.UninstallCompanyApps(company_uuids, app_uuid)