| | |
| | | return []; |
| | | } |
| | | |
| | | /** 不再使用前端本地缓存,列表数据以接口为准;并清除历史 localStorage 数据 */ |
| | | export function loadStoredNotices() { |
| | | try { |
| | | const raw = localStorage.getItem(STORAGE_KEY); |
| | | if (!raw) return null; |
| | | const data = JSON.parse(raw); |
| | | return Array.isArray(data) ? data : null; |
| | | } catch { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | export function saveStoredNotices(rows) { |
| | | try { |
| | | localStorage.setItem(STORAGE_KEY, JSON.stringify(rows)); |
| | | localStorage.removeItem(STORAGE_KEY); |
| | | } catch { |
| | | /* ignore */ |
| | | } |
| | | return []; |
| | | } |
| | | |
| | | /** @deprecated 保留空实现,避免旧调用报错;不做任何持久化 */ |
| | | export function saveStoredNotices() {} |
| | | |
| | | export function nextNoticeNo() { |
| | | return `NA${dayjs().format("YYYYMMDD")}${String(Math.floor(Math.random() * 9000) + 1000)}`; |
| | | } |