This commit is contained in:
yumoqing 2025-07-05 13:54:21 +08:00
parent 0f0d32b7c3
commit 16418f174e

View File

@ -1,6 +1,9 @@
from time import time
from appPublic.aes import aes_encrypt_ecb, aes_decrypt_ecb
from sqlor.dbpools import DBPools
from ahserver.serverenv import get_serverenv
from ahserver.auth_api import get_session_userinfo
def build_beardata(appid, apikey, secretkey):
"""
@ -13,3 +16,21 @@ def build_beardata(appid, apikey, secretkey):
cyber = aes_encrypt_ecb(secretkey, txt)
return f'Bear {appid}-:-{cyber}'
async def get_org(sor, orgid):
orgs = await sor.R('organization', {'id': orgid})
if len(orgs) < 1:
return None
return orgs[0]
async def sync_users(request, upappid, orgid):
db = DBPools()
dbname = get_dbname()
async with db.sqlorContext(dbname) as sor:
upapp = await get_upapp(sor, upappid)
async def sysn_user(request, upappid, userid):
db = DBPools()
dbname = get_dbname()
async with db.sqlorContext(dbname) as sor:
upapp = await get_upapp(sor, upappid)