's'
This commit is contained in:
@@ -136,10 +136,29 @@ const Index = () => {
|
||||
},
|
||||
});
|
||||
} else {
|
||||
let nowUrl = window.location.href;
|
||||
// let nowUrl = window.location.href;
|
||||
// window.localStorage.removeItem("openid");
|
||||
// // let payUrl = `https://payjs.cn/api/openid?mchid=1561724891&callback_url=${nowUrl}`;
|
||||
// let payUrl = `https://xorpay.com/api/openid/8220&callback_url=${nowUrl}`;
|
||||
// window.location.href = payUrl;
|
||||
|
||||
// 清除旧 openid(可选,建议保留)
|
||||
window.localStorage.removeItem("openid");
|
||||
let payUrl = `https://payjs.cn/api/openid?mchid=1561724891&callback_url=${nowUrl}`;
|
||||
window.location.href = payUrl;
|
||||
|
||||
// 当前完整 URL(包括 ? 参数和 # hash)
|
||||
let nowUrl = window.location.href;
|
||||
|
||||
// 正确构造 XorPay openid 获取地址
|
||||
// 1. 参数名必须是 callback
|
||||
// 2. 值必须 encodeURIComponent 编码
|
||||
let payUrl = `https://xorpay.com/api/openid/8220?callback=${encodeURIComponent(
|
||||
nowUrl
|
||||
)}`;
|
||||
|
||||
console.log("跳转获取 openid 的 URL:", payUrl);
|
||||
// 示例输出:https://xorpay.com/api/openid/8220?callback=http%3A%2F%2F192.168.31.222%3A10086%2F%23%2Fpay
|
||||
|
||||
// window.location.href = payUrl;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user