diff --git a/utils/store.js b/utils/store.js index a087ffe..51e8b7b 100644 --- a/utils/store.js +++ b/utils/store.js @@ -865,13 +865,15 @@ export const store = { try { this.attendRules.locations = asList(await api.oaGet('/profile/attendance/locations', this.token)) } catch (_) {} - try { - const pack = await api.oaGet('/system/attend-rules', this.token) - if (pack && typeof pack === 'object') { - this.attendRules.workStart = pack.workStart || this.attendRules.workStart - this.attendRules.workEnd = pack.workEnd || this.attendRules.workEnd - } - } catch (_) {} + if (this.can('system', 'attend')) { + try { + const pack = await api.oaGet('/system/attend-rules', this.token) + if (pack && typeof pack === 'object') { + this.attendRules.workStart = pack.workStart || this.attendRules.workStart + this.attendRules.workEnd = pack.workEnd || this.attendRules.workEnd + } + } catch (_) {} + } try { this.attendance = asList(await api.oaGet('/profile/attendance', this.token)) } catch (_) {}