控制器中间件授权改造完成

This commit is contained in:
GeekMaster
2025-08-26 14:22:14 +08:00
parent 728de61bd6
commit b6d81890cf
23 changed files with 168 additions and 334 deletions

View File

@@ -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(() => {

View File

@@ -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(() => {