From 403cdd5de13b00f1069f6d595c0df192f4c80fb6 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 16 Jul 2026 17:33:46 +0800 Subject: [PATCH] =?UTF-8?q?revert:=20=E6=81=A2=E5=A4=8D=E5=8E=9F=E5=A7=8B?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E6=B5=81=E7=A8=8B=E2=80=94=E2=80=94=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=94=AF=E4=BB=98URL=E5=90=8E=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E6=96=B0=E7=AA=97=E5=8F=A3=E8=B7=B3=E8=BD=AC=EF=BC=8C=E7=A7=BB?= =?UTF-8?q?=E9=99=A4QR=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/load_path.py | 1 - wwwroot/qr.dspy | 14 -------------- wwwroot/recharge.dspy | 12 +++++------- wwwroot/user_recharge.dspy | 5 +---- 4 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 wwwroot/qr.dspy diff --git a/scripts/load_path.py b/scripts/load_path.py index 1a9afa7..afb4c37 100644 --- a/scripts/load_path.py +++ b/scripts/load_path.py @@ -50,7 +50,6 @@ PATHS_LOGINED = [ f"/unipay/paychannel", f"/unipay/payfee", f"/unipay/payment_log", - f"/unipay/qr.dspy", f"/unipay/recharge.dspy", f"/unipay/recharge.ui", f"/unipay/refund.dspy", diff --git a/wwwroot/qr.dspy b/wwwroot/qr.dspy deleted file mode 100644 index 723a5b6..0000000 --- a/wwwroot/qr.dspy +++ /dev/null @@ -1,14 +0,0 @@ -import io, urllib.parse -import qrcode -from aiohttp import web - -data = params_kw.get('data', '') -if not data: - return web.Response(status=400, text='missing data') - -data = urllib.parse.unquote(data) -img = qrcode.make(data, box_size=10, border=2) -buf = io.BytesIO() -img.save(buf, format='PNG') -buf.seek(0) -return web.Response(body=buf.read(), content_type='image/png') diff --git a/wwwroot/recharge.dspy b/wwwroot/recharge.dspy index 2855b0a..a3944c1 100644 --- a/wwwroot/recharge.dspy +++ b/wwwroot/recharge.dspy @@ -1,22 +1,20 @@ -import urllib.parse params_kw.amount = float(params_kw.amount) debug(f'recharge.dspy: {params_kw=}') try: - code_url = await create_payment(request, params_kw) + url = await create_payment(request, params_kw) if params_kw.provider == 'transfer': return { "widgettype":"urlwidget", "mode":"replace", "target":"app.sage_main_content", - "options":{"url": code_url} + "options":{"url": url} } - qr_url = entire_url('/unipay/qr.dspy?data=') + urllib.parse.quote(code_url, safe='') return { "widgettype":"NewWindow", "options":{ - "url": qr_url, - "height": "340", - "width":"340" + "url": url, + "height": "100%", + "width":"100%" } } except Exception as e: diff --git a/wwwroot/user_recharge.dspy b/wwwroot/user_recharge.dspy index 2c3400d..9712842 100644 --- a/wwwroot/user_recharge.dspy +++ b/wwwroot/user_recharge.dspy @@ -1,4 +1,3 @@ -import urllib.parse if params_kw.amount is None: return { "status": "error", @@ -25,12 +24,10 @@ debug(f'user_recharge.dspy: {params_kw=}') try: url = await create_payment(request, params_kw) - qr_url = entire_url('/unipay/qr.dspy?data=') + urllib.parse.quote(url, safe='') return { "status": "ok", "data": { - "code_url": url, - "qr_url": qr_url + "url": url } } except Exception as e: