|
|
@@ -13,6 +13,20 @@ import AMapLocationKit
|
|
|
import YYText
|
|
|
|
|
|
class QSLHomeController: QSLBaseController {
|
|
|
+ // 存储上次时间戳的属性
|
|
|
+ private var lastActionTimestamp: TimeInterval = 0
|
|
|
+
|
|
|
+ // 检查时间间隔的方法
|
|
|
+ private func shouldProceedWithAction() -> Bool {
|
|
|
+ let currentTimestamp = Date().timeIntervalSince1970
|
|
|
+
|
|
|
+ if lastActionTimestamp == 0 || currentTimestamp - lastActionTimestamp >= 1 {
|
|
|
+ lastActionTimestamp = currentTimestamp
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
lazy var viewModel: QSLHomeViewModel = {
|
|
|
return QSLHomeViewModel()
|
|
|
@@ -355,7 +369,10 @@ extension QSLHomeController {
|
|
|
|
|
|
QSLBaseManager.shared.saveUserId(id: memberModel.userId)
|
|
|
|
|
|
- QSLTools.shared.requestShortcutItem()
|
|
|
+ if(self.shouldProceedWithAction()){
|
|
|
+ QSLTools.shared.requestShortcutItem()
|
|
|
+ }
|
|
|
+
|
|
|
// NotificationCenter.default.post(name: QSLNotification.QSLRefreshMember, object: nil)
|
|
|
|
|
|
} fail: { code, error in
|