salescrm/b/kpi/update_code_state.dspy
2025-10-27 15:50:44 +08:00

28 lines
740 B
Plaintext

async def get_code_state(ns={}):
if not ns:
return {
'status': False,
'msg': 'There need params, but get none'
}
code_info = {
'id': ns.get('state'),
'code': ns.get('code')
}
db = DBPools()
async with db.sqlorContext('kboss') as sor:
try:
await sor.C('wechat_login_code', code_info)
except Exception as e:
return {
'status': False,
'msg': str(e)
}
with open('code_state.txt', 'w', encoding='utf-8') as f:
f.write(json.dumps(ns) + '\n')
#return {
# 'status': True,
# 'msg': '参数保存成功'
#}
ret = await get_code_state(params_kw)
return ret