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}} data = {'id': rec_id, 'updated_at': curDateString()} for f in ['org_id', 'workspace_root', 'skills_dir']: if f in params_kw: data[f] = params_kw[f] try: async with get_sor_context(request._run_ns, 'pipeline') as sor: await sor.U('sd_org_settings', data) 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}}