Compare commits

...

2 Commits

Author SHA1 Message Date
d848218629 bugfix 2026-03-20 15:45:55 +08:00
3d3bdf8611 bugfix 2026-03-20 15:45:39 +08:00
2 changed files with 8 additions and 8 deletions

View File

@ -1591,11 +1591,11 @@ paths="""/favicon.ico
/unipay/refund.ui /unipay/refund.ui
""" """
async def main(): async def main():
config = getConfig('.') config = getConfig('.')
db = DBPools(config.databases) db = DBPools(config.databases)
ids = d.split('\n') ids = d.split('\n')
cnt = 0 cnt = 0
async with db.sqlorContext('sage') as sor: async with db.sqlorContext('sage') as sor:
for p in paths.split('\n'): for p in paths.split('\n'):
if not p: if not p:
continue continue

View File

@ -32,15 +32,15 @@ async def add_roleperm(sor, roleid, path, permid=None):
return return
async def main(): async def main():
config = getConfig('.') config = getConfig('.')
db = DBPools(config.databases) db = DBPools(config.databases)
if len(sys.argv) < 3: if len(sys.argv) < 3:
print(f'{sys.argv[0]} role path') print(f'{sys.argv[0]} role path')
sys.exit(1) sys.exit(1)
role = sys.argv[1] role = sys.argv[1]
path = sys.argv[2] path = sys.argv[2]
async with db.sqlorContext('sage') as sor: async with db.sqlorContext('sage') as sor:
perms = None perms = None
if '%' in path: if '%' in path:
perms = await sor.sqlExe('select * from permission where path like ${path}$", {'path': path}) perms = await sor.sqlExe('select * from permission where path like ${path}$", {'path': path})
@ -69,5 +69,5 @@ async def main():
if __name__ == '__main__': if __name__ == '__main__':
asyncio.get_event_loop().run_until_complete(main()) asyncio.get_event_loop().run_until_complete(main())