优化控制面板

This commit is contained in:
tangly1024.com
2023-11-02 17:01:00 +08:00
parent 5ccf8823a6
commit 0f1f415782
17 changed files with 141 additions and 82 deletions

15
pages/api/cache.js Normal file
View File

@@ -0,0 +1,15 @@
import { cleanCache } from '@/lib/cache/local_file_cache'
/**
* 清理缓存
* @param {*} req
* @param {*} res
*/
export default async function handler(req, res) {
try {
await cleanCache()
res.status(200).json({ status: 'success', message: 'Clean cache successful!' })
} catch (error) {
res.status(400).json({ status: 'error', message: 'Clean cache failed!', error })
}
}