初步完成merchant和admin不同role的展示内容逻辑

This commit is contained in:
2026-03-12 10:18:04 +08:00
parent c90b549b89
commit f19dd093bf
13 changed files with 853 additions and 110 deletions

20
update_layout2.py Normal file
View File

@@ -0,0 +1,20 @@
import codecs
import re
path = r'd:\骅锋\mall\layouts\admin\AdminLayout.uvue'
with codecs.open(path, 'r', 'utf-8') as f:
text = f.read()
if 'refreshAdminRole' not in text:
text = text.replace("import { hasAdminModuleAccess", "import { hasAdminModuleAccess, refreshAdminRole")
# regex replace onMounted(() => { \s* initNavState()
text = re.sub(r'onMounted\(\(\) => \{\s+initNavState\(\)',
"onMounted(async () => {\n await refreshAdminRole()\n initNavState()",
text)
with codecs.open(path, 'w', 'utf-8') as f:
f.write(text)
print("AdminLayout regex updated.")
else:
print("Already there.")