初步完成merchant和admin不同role的展示内容逻辑
This commit is contained in:
19
update_layout3.py
Normal file
19
update_layout3.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import codecs
|
||||
import re
|
||||
|
||||
path = r'd:\骅锋\mall\layouts\admin\AdminLayout.uvue'
|
||||
with codecs.open(path, 'r', 'utf-8') as f:
|
||||
text = f.read()
|
||||
|
||||
# Make sure we add the await
|
||||
if 'await refreshAdminRole()' not in text:
|
||||
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("Injected await refreshAdminRole()")
|
||||
else:
|
||||
print("Await already present.")
|
||||
|
||||
Reference in New Issue
Block a user