From 7e218a68a632c72c06902c30eb4aa5cff00f2374 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 28 Aug 2025 09:41:11 +0800 Subject: [PATCH] bugfix --- wwwroot/copy_apikey.dspy | 4 ++-- wwwroot/create_apikey.dspy | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wwwroot/copy_apikey.dspy b/wwwroot/copy_apikey.dspy index 05c38cc..96e672a 100644 --- a/wwwroot/copy_apikey.dspy +++ b/wwwroot/copy_apikey.dspy @@ -39,7 +39,7 @@ where a.id = b.dappid "options":{ "wrap":True, "halign":"left", - "text":f"apikey={r.apikey}" + "text":f"apikey={password_decode(r.apikey)}" } }, { @@ -47,7 +47,7 @@ where a.id = b.dappid "options":{ "wrap":True, "halign":"left", - "text":f"secretkey={r.secretkey}" + "text":f"secretkey={password_decode(r.secretkey)}" } } ] diff --git a/wwwroot/create_apikey.dspy b/wwwroot/create_apikey.dspy index 1adc179..50bebd2 100644 --- a/wwwroot/create_apikey.dspy +++ b/wwwroot/create_apikey.dspy @@ -8,7 +8,7 @@ async with db.sqlorContext(dbname) as sor: "id": params_kw.id, "name": params_kw.appname, "description": params_kw.description, - "secretkey": uuid(), + "secretkey": password_encode(uuid()), "allowedips": params_kw.allowedips, "orgid": orgid } @@ -17,10 +17,10 @@ async with db.sqlorContext(dbname) as sor: "id": uuid(), "dappid": ns['id'], "userid": userid, - "apikey": uuid(), + "apikey": password_encode(uid()), "enabled_date": curDateString(), "expired_date": '9999-12-31' } await sor.C('downapikey', ns1) - return UiMessage(title="create apikey", message=f"appid={ns['id']}, apikey={ns1['apikey']}, secretkey={ns['secretkey']}") + return UiMessage(title="create apikey", message=f"apikey created") return UiError(title='create apikey', message='add apikey error')