|
|
@@ -68,13 +68,23 @@ router.beforeEach(async(to, from, next) => {
|
|
|
// // 可以添加其他需要的参数
|
|
|
// timestamp: Date.now().toString()
|
|
|
// }).toString()
|
|
|
- const redirect_uri = to.query.url ? encodeURIComponent('url=' + encodeURIComponent(to.query.url)) : ''
|
|
|
- const isApp = to.query.isApp ? to.query.isApp : '2'
|
|
|
- if (isApp === '2' && redirect_uri) {
|
|
|
- // window.location.href = `weixin://dl/business/?appid=wxf8a72764a38a40b2&path=pages/index/index&query=${redirect_uri}`
|
|
|
- window.location.href = decodeURIComponent(to.query.url)
|
|
|
- } else if (redirect_uri) {
|
|
|
- window.location.href = decodeURIComponent(to.query.url)
|
|
|
+ // 从 URL 参数或 Cookie 中获取 redirect_uri
|
|
|
+
|
|
|
+ // const redirect_uri = to.query.url ? to.query.url : ''
|
|
|
+ // const isApp = to.query.isApp ? to.query.isApp : '2'
|
|
|
+ // if (isApp === '2' && redirect_uri) {
|
|
|
+ // // window.location.href = `weixin://dl/business/?appid=wxf8a72764a38a40b2&path=pages/index/index&query=${redirect_uri}`
|
|
|
+ // window.location.href = decodeURIComponent(to.query.url)
|
|
|
+ // } else if (redirect_uri) {
|
|
|
+ // window.location.href = decodeURIComponent(to.query.url)
|
|
|
+
|
|
|
+ const redirect_uri = to.query.url ? to.query.url : Cookies.get('redirectUri') || ''
|
|
|
+ // 从 URL 参数或 Cookie 中获取 isApp
|
|
|
+ // const isApp = to.query.isApp ? to.query.isApp : Cookies.get('isApp') || '2'
|
|
|
+ if (redirect_uri) {
|
|
|
+ // 如果有 redirect_uri,清除 Cookie 并跳转
|
|
|
+ Cookies.remove('redirectUri')
|
|
|
+ window.location.href = decodeURIComponent(redirect_uri)
|
|
|
} else {
|
|
|
next({ path: '/appStoreCopy' })
|
|
|
}
|