|
@@ -103,6 +103,7 @@ import { reactive, ref } from 'vue'
|
|
import { getToken } from '@/utils/auth'
|
|
import { getToken } from '@/utils/auth'
|
|
import { useUserStore } from '@/store/user'
|
|
import { useUserStore } from '@/store/user'
|
|
import { useLocaleStore } from '@/store/locale'
|
|
import { useLocaleStore } from '@/store/locale'
|
|
|
|
+import { useLoginType } from '@/store/loginType'
|
|
import Dialog from '@/components/CtDialog'
|
|
import Dialog from '@/components/CtDialog'
|
|
defineOptions({ name: 'personal-navbar' })
|
|
defineOptions({ name: 'personal-navbar' })
|
|
|
|
|
|
@@ -113,6 +114,7 @@ defineProps({
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+const changeLoginType = useLoginType()
|
|
const localeStore = useLocaleStore()
|
|
const localeStore = useLocaleStore()
|
|
const userStore = useUserStore()
|
|
const userStore = useUserStore()
|
|
|
|
|
|
@@ -127,13 +129,13 @@ const router = useRouter()
|
|
const handleLogoClick = () => { router.push({ path: '/home'}) }
|
|
const handleLogoClick = () => { router.push({ path: '/home'}) }
|
|
|
|
|
|
const show = ref(false)
|
|
const show = ref(false)
|
|
-const userType = ref(0) // 0企业用户、1个人用户
|
|
|
|
|
|
+const loginType = ref(1) // 0企业用户、1个人用户
|
|
const changeRole = () => {
|
|
const changeRole = () => {
|
|
- if (userType.value) {
|
|
|
|
- show.value = true
|
|
|
|
- router.push({ path: '/enterprise/register' })
|
|
|
|
|
|
+ if (loginType.value) {
|
|
|
|
+ show.value = true // 选择切换类型
|
|
} else {
|
|
} else {
|
|
- // 重新走登录拿数据
|
|
|
|
|
|
+ router.push({ path: '/enterprise/home' })
|
|
|
|
+ changeLoginType.change(0)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|