Files
medical-mall/simplify2.py

11 lines
588 B
Python

import codecs
file_path = r'd:\\骅锋\\mall\\layouts\\admin\\store\\adminNavStore.uts'
with codecs.open(file_path, 'r', 'utf-8') as f:
text = f.read()
text = text.replace('function openRoute(routeId: string, addTab: boolean = true): void {', 'function openRoute(routeId: string, addTab: boolean = true): void {\n console.log([AdminNavStore] openRoute called with: );')
text = text.replace('activeRouteId.value = routeId', 'activeRouteId.value = routeId\n console.log([AdminNavStore] activeRouteId set to: );')
with codecs.open(file_path, 'w', 'utf-8') as f:
f.write(text)