瀏覽代碼

《我的》退出登录清空数据

lifanagju_citu 7 月之前
父節點
當前提交
f34ea07c6b
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      components/ResumeStatus/index.vue

+ 6 - 6
components/ResumeStatus/index.vue

@@ -28,12 +28,9 @@ import { onShow } from '@dcloudio/uni-app'
 import { userStore } from '@/store/user'
 const useUserStore = userStore()
 
+// 监听登录状态
 watch(() => useUserStore.refreshToken, (newVal, oldVal) => {
-  if (useUserStore.refreshToken) {
-		// 监听登录状态
-		console.log('重新登录了')
-		recommendCount()
-	}
+	recommendCount(Boolean(newVal))
 })
 
 onShow(() => {
@@ -48,7 +45,7 @@ const handleTo = (item) => {
 	})
 }
 
-async function recommendCount () {
+async function recommendCount (refreshToken) {
 	try {
 		const { data: dict } = await getDict('menduner_hire_job_cv_status')
 		if (!dict?.data) {
@@ -61,6 +58,9 @@ async function recommendCount () {
 			}
 		})
 		// console.log(items)
+		if (!refreshToken) {
+			return
+		}
 		const { data } = await getRecommendCount()
 		if (!data) {
 			return