|
@@ -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
|