初步完成merchant和admin不同role的展示内容逻辑
This commit is contained in:
17
update_header2.py
Normal file
17
update_header2.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import codecs
|
||||
import re
|
||||
|
||||
path = r'd:\骅锋\mall\layouts\admin\components\AdminHeader.uvue'
|
||||
with codecs.open(path, 'r', 'utf-8') as f:
|
||||
text = f.read()
|
||||
|
||||
# Replace uni.removeStorageSync('adminRole') with clearAdminRoleCache()
|
||||
# Add import if missing
|
||||
if 'clearAdminRoleCache' not in text:
|
||||
text = text.replace("import { state, logout } from '@/utils/store.uts'", "import { state, logout } from '@/utils/store.uts'\nimport { clearAdminRoleCache } from '@/layouts/admin/utils/role.uts'")
|
||||
|
||||
text = text.replace("uni.removeStorageSync('adminRole')", "clearAdminRoleCache()")
|
||||
|
||||
with codecs.open(path, 'w', 'utf-8') as f:
|
||||
f.write(text)
|
||||
print("Updated via direct string replace")
|
||||
Reference in New Issue
Block a user