Commit f0fc260c authored by 劳琪峰's avatar 劳琪峰

chore: joinUrlAndQs

parent 0fc13b24
......@@ -31,23 +31,23 @@ onShow(() => {
registered.value = getRegistered()
})
function joinUrlAndQs(url, qs) {
return qs
? url + (url.includes('?') ? (url.endsWith('?') ? '' : '&') : '?') + qs
: url
}
watch(() => registered.value, (newVal, oldVal) => {
if (newVal !== oldVal) {
const oldSrc = src.value
src.value = ''
nextTick(() => {
src.value = oldSrc + (oldSrc.includes('?') ? '&' : '?') + 'registered=' + newVal
src.value = joinUrlAndQs(oldSrc, 'registered=' + newVal)
})
}
})
function joinUrlAndQs(url, qs) {
return qs
? url + (url.includes('?') ? (url.endsWith('?') ? '' : '&') : '?') + qs
: url
}
function initOk() {
console.log(userStore.userInfo)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment