|
|
|
@ -19,17 +19,27 @@ export default { |
|
|
|
|
let url = `${location.origin}/reviewCenter/` |
|
|
|
|
if (Setting.isDev) url = `http://192.168.31.125:8099/` |
|
|
|
|
if (cache) { |
|
|
|
|
url += `#${cache}${cache.includes('?') ? `&` : '?'}token=${this.token}&nakadai=` |
|
|
|
|
url += '#' + this.replaceParam(cache, Date.now()) |
|
|
|
|
} else { |
|
|
|
|
url += `#/myReview?token=${this.token}&nakadai=` |
|
|
|
|
url += `#/myReview?nakadai=${Setting.isDev ? `&token=${this.token}` : ''}&v=${Date.now()}` |
|
|
|
|
} |
|
|
|
|
url += `&v=${Date.now()}` |
|
|
|
|
console.log("🚀 ~ mounted ~ url:", url) |
|
|
|
|
localStorage.setItem('review_token', this.token) |
|
|
|
|
this.url = url |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
replaceParam (url, newVValue) { |
|
|
|
|
const vParamRegex = /v=[^&]+/g |
|
|
|
|
|
|
|
|
|
let newUrl = url.replace(vParamRegex, `v=${newVValue}`) |
|
|
|
|
|
|
|
|
|
const [baseUrl, hash] = newUrl.split('#'); |
|
|
|
|
if (hash) { |
|
|
|
|
newUrl = `${baseUrl}#${hash.replace(vParamRegex, `v=${newVValue}`)}` |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return newUrl |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|