()
| 57 | |
| 58 | // 24h 清理一次缓存(每次页面打开即 main.js 时都应该调用) |
| 59 | cleaner() { |
| 60 | const lastSessionTimestamp = localStorage.getItem('flLastSessionTimestamp'); |
| 61 | const currentTime = Date.now(); |
| 62 | |
| 63 | if (!lastSessionTimestamp || currentTime - parseInt(lastSessionTimestamp) > 24 * 3600000) { |
| 64 | this.clean(); |
| 65 | localStorage.setItem('flLastSessionTimestamp', currentTime.toString()); |
| 66 | } |
| 67 | }, |
| 68 | |
| 69 | // 清除当前 url.host 的翻译缓存 |
| 70 | clean() { |
nothing calls this directly
no outgoing calls
no test coverage detected