项目需要在uniapp打开支付宝的授权页面,但是通过支付宝的schema协议打开地址时出现了回跳地址错误,于是推断是否是url编码的问题,经过测验确实是url编码导致的。qrcode参数的值需要全部进行urlencode否则就会出现错误。
原文如下:
<a href="alipays://platformapi/startapp?saId=10000007&clientVersion=3.7.0.0718&qrcode=https://openauth.alipay.com/oauth2/appToAppAuth.htm?app_id=your ap id &redirect_uri=https%3A%2F%2F" target='_blank' ></a>
修改后:
<a href="alipays://platformapi/startapp?saId=10000007&clientVersion=3.7.0.0718&qrcode=https%3A%2F%2Fopenauth.alipay.com%2Foauth2%2FappToAppAuth.htm%3Fapp_id%3Dyour%20ap%20id%20%26redirect_uri%3Dhttps%253A%252F%252F" target='_blank'></a>