diff --git a/wwwroot/api/wechat_binding.dspy b/wwwroot/api/wechat_binding.dspy index 9ee74b6..39290c2 100644 --- a/wwwroot/api/wechat_binding.dspy +++ b/wwwroot/api/wechat_binding.dspy @@ -14,10 +14,10 @@ if not uid: action = (params_kw or {}).get('action', 'get') dbname = get_module_dbname('pipeline-sdlc') -# 查用户 org_id(sage 库) +# 查用户 org_id(pipeline 库) org_id = '' try: - async with DBPools().sqlorContext('sage') as sor: + async with DBPools().sqlorContext(dbname) as sor: urecs = await sor.sqlExe("SELECT orgid FROM users WHERE id=${u}$", {"u": uid}) if urecs: org_id = getattr(urecs[0], 'orgid', '') or '' diff --git a/wwwroot/api/wechat_config.dspy b/wwwroot/api/wechat_config.dspy index d114386..93a63bf 100644 --- a/wwwroot/api/wechat_config.dspy +++ b/wwwroot/api/wechat_config.dspy @@ -15,15 +15,15 @@ dbname = get_module_dbname('pipeline-sdlc') # 系统级公众号:全局一条,org_id 固定为 '0'(业主机构) SYS_ORG_ID = '0' -# 查用户角色(sage 库),仅 admin 可配置 +# 查用户角色(pipeline 库),superuser/admin 可配置 is_admin = False try: - async with DBPools().sqlorContext('sage') as sor: + async with DBPools().sqlorContext(dbname) as sor: rrecs = await sor.sqlExe( "SELECT r.name FROM userrole ur JOIN role r ON ur.roleid=r.id WHERE ur.userid=${u}$", {"u": uid}) roles = [getattr(r, 'name', '') for r in (rrecs or [])] - is_admin = 'admin' in roles + is_admin = ('superuser' in roles) or ('admin' in roles) except Exception: pass