|
@@ -207,7 +207,7 @@ const socketData = async (res) => {
|
|
|
} else if (type === 'msgCountDown') {
|
|
|
//倒计时更新
|
|
|
if (isNullES(data) || data <= 0) {
|
|
|
- isReminderShow.value = false
|
|
|
+ closeReminder()
|
|
|
return
|
|
|
}
|
|
|
isReminderText.value = `系统将在${data}秒后,进行更新`
|
|
@@ -217,17 +217,27 @@ const socketData = async (res) => {
|
|
|
}
|
|
|
|
|
|
//倒计时
|
|
|
+let timeRef
|
|
|
const setReminderText = (time) => {
|
|
|
if (time < 0) {
|
|
|
- isReminderShow.value = false
|
|
|
+ closeReminder()
|
|
|
return
|
|
|
}
|
|
|
- setTimeout(() => {
|
|
|
+ timeRef = setTimeout(() => {
|
|
|
isReminderText.value = `系统将在${time}秒后,进行更新`
|
|
|
setReminderText(time - 1)
|
|
|
}, 1000)
|
|
|
}
|
|
|
|
|
|
+//关闭倒计时
|
|
|
+const closeReminder = () => {
|
|
|
+ isReminderShow.value = false
|
|
|
+ if (!isNullES(timeRef)) {
|
|
|
+ clearTimeout(timeRef)
|
|
|
+ timeRef = null
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
//用户信息
|
|
|
const userId = ref('')
|
|
|
const userInfoLoad = ({ user_id }) => {
|