V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Herwifte
V2EX  ›  Python

Python -flask 关于支付接口回调,前端无法进行跳转的问题

  •  
  •   Herwifte · 2019-07-31 13:45:54 +08:00 · 1047 次点击
    这是一个创建于 1729 天前的主题,其中的信息可能已经有所发展或是发生改变。

    问题描述

    后台在处理完支付平台发送的 JSON 数据包后,本地页面无法进行跳转。

    问题出现的环境背景及自己尝试过哪些方法 在 return 处使用过重定向,但发现只有支付平台的服务器进行了跳转。

    相关代码

    @jsons.route('/native', methods=['GET', 'POST'])
    
    def native_url():
    
        if request.method == "POST":
    
            requ = dict(request.form)
    
            aoid = requ['aoid']
    
            print(requ['order_id'])
    
            time.sleep(3)
    
            queryStatus = query_status(aoid)
    
            print(queryStatus['status'])
    
            if queryStatus['status'] in ['payed','success']:
    
                order = Order.query.filter(Order.Trade_Number == requ['order_id']).first()
    
                order.Print_Status = 1
    
                db.session.add(order)
    
                db.session.commit()
    
                return 'success'
    
            else:
    
                pass
    

    我希望有大神可以提供一个方法,使本地的服务器在获取到支付平台发送的 json 数据包时,可以实现本地的页面跳转

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1078 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 19:14 · PVG 03:14 · LAX 12:14 · JFK 15:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.