From 47f7e8e5c1a7389bded96e1317a357846e500dab Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 24 Jun 2026 22:13:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A0=91=E6=8E=A7=E4=BB=B6=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E8=8A=82=E7=82=B9=E5=90=8E=E8=BF=94=E5=9B=9Euser=5Fda?= =?UTF-8?q?ta=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=96=B0=E5=A2=9E=E5=AD=90?= =?UTF-8?q?=E9=A1=B9=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/api/product_category_create.dspy | 4 +++- wwwroot/product_category_tree/new_product_category.dspy | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/wwwroot/api/product_category_create.dspy b/wwwroot/api/product_category_create.dspy index b83071d..cceb746 100644 --- a/wwwroot/api/product_category_create.dspy +++ b/wwwroot/api/product_category_create.dspy @@ -34,8 +34,10 @@ try: async with DBPools().sqlorContext(dbname) as sor: await sor.C('product_category', data) + _new_rows = await sor.sqlExe("SELECT * FROM product_category WHERE id = ${id}$", {'id': data['id']}) + _user_data = _new_rows[0] if _new_rows else data - result = {'widgettype': 'Message', 'options': {'title': 'Success', 'message': '类别创建成功', 'type': 'success'}} + result = {'widgettype': 'Message', 'options': {'title': 'Success', 'message': '类别创建成功', 'type': 'success', 'user_data': _user_data}} except Exception as e: result['options'] = {'title': 'Error', 'message': '创建失败: ' + str(e), 'type': 'error'} diff --git a/wwwroot/product_category_tree/new_product_category.dspy b/wwwroot/product_category_tree/new_product_category.dspy index 1b67e6e..fec2c87 100644 --- a/wwwroot/product_category_tree/new_product_category.dspy +++ b/wwwroot/product_category_tree/new_product_category.dspy @@ -34,6 +34,8 @@ db = DBPools() dbname = get_module_dbname('product_management') async with db.sqlorContext(dbname) as sor: r = await sor.C('product_category', ns.copy()) + _new_rows = await sor.sqlExe("SELECT * FROM product_category WHERE id = ${id}$", {'id': id}) + _user_data = _new_rows[0] if _new_rows else ns return { "widgettype":"Message", "options":{ @@ -41,7 +43,8 @@ async with db.sqlorContext(dbname) as sor: "cheight":9, "title":"Add Success", "timeout":3, - "message":"ok" + "message":"ok", + "user_data": _user_data } }