提交 3da7f95d 编写于 作者: View Design's avatar View Design

Update app.vue

上级 a95101f4
...@@ -21,10 +21,11 @@ const domain = useCookie('domain', { ...@@ -21,10 +21,11 @@ const domain = useCookie('domain', {
const username = useCookie('username', { const username = useCookie('username', {
maxAge: 86400 * 28 maxAge: 86400 * 28
}) })
// 初始化时,获取URL的query userId,如果有值,则赋值给 cookie:userId
const route = useRoute() const route = useRoute()
const queryDomain = route.query.domain const queryDomain = route.query.domain
const queryUsername = route.query.username const queryUsername = route.query.username
if (queryDomain) domain.value = queryDomain onMounted(() => {
if (queryUsername) username.value = queryUsername if (queryDomain) domain.value = queryDomain
if (queryUsername) username.value = queryUsername
})
</script> </script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册