mirror of
https://github.com/yangjian102621/geekai.git
synced 2026-04-24 12:04:31 +08:00
控制器中间件授权改造完成
This commit is contained in:
@@ -30,12 +30,7 @@
|
||||
</div>
|
||||
|
||||
<div class="login-content">
|
||||
<login-dialog
|
||||
:show="true"
|
||||
@hide="handleLoginHide"
|
||||
@success="handleLoginSuccess"
|
||||
ref="loginDialogRef"
|
||||
/>
|
||||
<login-dialog :show="true" @success="handleLoginSuccess" ref="loginDialogRef" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -45,7 +40,7 @@
|
||||
<script setup>
|
||||
import LoginDialog from '@/components/LoginDialog.vue'
|
||||
import { setUserToken } from '@/store/session'
|
||||
import { getCurrentDeviceRedirectPath } from '@/utils/device'
|
||||
import { isMobile } from '@/utils/libs'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
@@ -58,16 +53,13 @@ if (token) {
|
||||
router.push('/chat')
|
||||
}
|
||||
|
||||
// 处理登录弹窗隐藏
|
||||
const handleLoginHide = () => {
|
||||
const redirectPath = getCurrentDeviceRedirectPath()
|
||||
router.push(redirectPath)
|
||||
}
|
||||
|
||||
// 处理登录成功
|
||||
const handleLoginSuccess = () => {
|
||||
const redirectPath = getCurrentDeviceRedirectPath()
|
||||
router.push(redirectPath)
|
||||
if (isMobile()) {
|
||||
router.push('/mobile')
|
||||
} else {
|
||||
router.push('/chat')
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
:show="true"
|
||||
active="register"
|
||||
:inviteCode="inviteCode"
|
||||
@hide="handleRegisterHide"
|
||||
@success="handleRegisterSuccess"
|
||||
ref="loginDialogRef"
|
||||
/>
|
||||
@@ -46,7 +45,7 @@
|
||||
|
||||
<script setup>
|
||||
import LoginDialog from '@/components/LoginDialog.vue'
|
||||
import { getCurrentDeviceRedirectPath } from '@/utils/device'
|
||||
import { isMobile } from '@/utils/libs'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
@@ -54,16 +53,13 @@ const router = useRouter()
|
||||
const loginDialogRef = ref(null)
|
||||
const inviteCode = ref(router.currentRoute.value.query.invite_code || '')
|
||||
|
||||
// 处理注册弹窗隐藏
|
||||
const handleRegisterHide = () => {
|
||||
const redirectPath = getCurrentDeviceRedirectPath()
|
||||
router.push(redirectPath)
|
||||
}
|
||||
|
||||
// 处理注册成功
|
||||
const handleRegisterSuccess = () => {
|
||||
const redirectPath = getCurrentDeviceRedirectPath()
|
||||
router.push(redirectPath)
|
||||
if (isMobile()) {
|
||||
router.push('/mobile')
|
||||
} else {
|
||||
router.push('/chat')
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user