fix: permcode → path — 权限表列名修正

permission 表的列名是 path,不是 permcode。
与 sage/load_path.py 保持一致。
This commit is contained in:
yumoqing 2026-07-01 14:59:43 +08:00
parent 5ebe83207d
commit c0c598ff15

View File

@ -36,16 +36,16 @@ async def main():
cnt = 0 cnt = 0
for path, role in paths: for path, role in paths:
r = await sor.sqlExe( r = await sor.sqlExe(
'select * from permission where permcode = ${permcode}$', 'select * from permission where path = ${path}$',
{'permcode': path} {'path': path}
) )
if len(r) == 0: if len(r) == 0:
await sor.sqlExe( await sor.sqlExe(
'''insert into permission (id, permcode, permname, permtype) '''insert into permission (id, path, permname, permtype)
values (${id}$, ${permcode}$, ${permname}$, ${permtype}$)''', values (${id}$, ${path}$, ${permname}$, ${permtype}$)''',
{ {
'id': getID(), 'id': getID(),
'permcode': path, 'path': path,
'permname': path, 'permname': path,
'permtype': role, 'permtype': role,
} }