| 1819 | } |
| 1820 | } |
| 1821 | const read = (key) => { |
| 1822 | if (isQuanX) return $prefs.valueForKey(key) |
| 1823 | if (isSurge) return $persistentStore.read(key) |
| 1824 | if (isNode) { |
| 1825 | try { |
| 1826 | if (!node.fs.existsSync(node.path.resolve(__dirname, NodeSet))) return null; |
| 1827 | const dataValue = JSON.parse(node.fs.readFileSync(node.path.resolve(__dirname, NodeSet))) |
| 1828 | return dataValue[key] |
| 1829 | } catch (er) { |
| 1830 | return AnError('Node.js持久化读取', null, er) |
| 1831 | } |
| 1832 | } |
| 1833 | if (isJSBox) { |
| 1834 | if (!$file.exists(`shared://${key}.txt`)) return null; |
| 1835 | return $file.read(`shared://${key}.txt`).string |
| 1836 | } |
| 1837 | } |
| 1838 | const adapterStatus = (response) => { |
| 1839 | if (response) { |
| 1840 | if (response.status) { |