15 lines
739 B
Plaintext
15 lines
739 B
Plaintext
user_id = await get_user()
|
|
if not user_id:
|
|
return {"widgettype":"Error","options":{"title":"操作失败","message":'未登录',"cwidth":16,"cheight":9,"timeout":3}}
|
|
|
|
rec_id = params_kw.get('id', '')
|
|
if not rec_id:
|
|
return {"widgettype":"Error","options":{"title":"操作失败","message":'缺少id',"cwidth":16,"cheight":9,"timeout":3}}
|
|
|
|
try:
|
|
async with get_sor_context(request._run_ns, 'pipeline') as sor:
|
|
await sor.D('sd_test_cases', {'id': rec_id})
|
|
return {"widgettype":"Message","options":{"title":"操作成功","message":"ok","cwidth":16,"cheight":9,"timeout":3}}
|
|
except Exception as e:
|
|
return {"widgettype":"Error","options":{"title":"操作失败","message":str(e),"cwidth":16,"cheight":9,"timeout":3}}
|