Explorar o código

展示切换账号按钮

lifanagju_citu hai 8 meses
pai
achega
879f418f83
Modificáronse 1 ficheiros con 12 adicións e 5 borrados
  1. 12 5
      src/views/recruit/personal/shareJob/index.vue

+ 12 - 5
src/views/recruit/personal/shareJob/index.vue

@@ -65,7 +65,7 @@
         <div class="text-center my-10">
           <v-btn v-if="!isMobile" class="mr-2 radius button-item" color="success" variant="outlined" target="_blank" to="/recruit/personal/position">{{ $t('position.moreBtn') }}</v-btn>
           <v-btn class="radius button-item" color="primary" :disabled="delivery" @click="sendResumeProcessVerify">{{ delivery ? $t('position.delivered') : $t('position.submitResume') }}</v-btn>
-          <span v-if="showSwitchAccounts" class="ml-2" style="font-size: 14px; color: #666; text-decoration: underline;" @click="handleSwitchAccounts">切换账号</span>
+          <span v-if="showSwitchAccount" class="ml-2" style="font-size: 14px; color: #666; text-decoration: underline;" @click="handleSwitchAccount">切换账号</span>
         </div>
       </div>
     </v-card>
@@ -185,6 +185,7 @@ const desc = [
 // 快速登录成功
 const loginSuccess = async () => {
   sendResume.showLogin = false // 关闭快速登录弹窗
+  showSwitchAccountFun(true)
   // actions为true则是收藏时的登录,不需要弹窗选择简历
   if (actions.value) {
     actions.value = false
@@ -236,17 +237,23 @@ const handleClose = (key) => {
   sendResume[key] = false // 弹窗关闭,重置绑定数据
 }
 
-const showSwitchAccounts = ref(false)
+
+const showSwitchAccount = ref(false)
+
+const showSwitchAccountFun = (bool) => {
+  showSwitchAccount.value = bool
+}
+
 onMounted(() => {
-  showSwitchAccounts.value = (isMobile.value && getToken())
+  showSwitchAccountFun(getToken()) // (isMobile.value && getToken())
 })
 
 // 切换账号
 import { useUserStore } from '@/store/user'; const userStore = useUserStore()
-const handleSwitchAccounts = async () => {
+const handleSwitchAccount = async () => {
   delivery.value = false // 重置投递状态
   isCollection.value = false // 重置收藏
-  showSwitchAccounts.value = false
+  showSwitchAccount.value = false
   await userStore.userLogout(1)
   // location.reload()
   sendResume.showLogin = true