首页增加短剧推荐
This commit is contained in:
@@ -79,6 +79,16 @@ export async function POST(request: NextRequest) {
|
||||
adminConfig = refineConfig(adminConfig);
|
||||
// 更新配置文件
|
||||
await db.saveAdminConfig(adminConfig);
|
||||
|
||||
// 清除短剧视频源缓存(因为配置文件可能包含新的视频源)
|
||||
try {
|
||||
await db.deleteGlobalValue('duanju');
|
||||
console.log('已清除短剧视频源缓存');
|
||||
} catch (error) {
|
||||
console.error('清除短剧视频源缓存失败:', error);
|
||||
// 不影响主流程,继续执行
|
||||
}
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: '配置文件更新成功',
|
||||
|
||||
@@ -85,6 +85,15 @@ export async function POST(req: NextRequest) {
|
||||
await db.saveAdminConfig(importData.data.adminConfig);
|
||||
await setCachedConfig(importData.data.adminConfig);
|
||||
|
||||
// 清除短剧视频源缓存(因为导入的配置可能包含不同的视频源)
|
||||
try {
|
||||
await db.deleteGlobalValue('duanju');
|
||||
console.log('已清除短剧视频源缓存');
|
||||
} catch (error) {
|
||||
console.error('清除短剧视频源缓存失败:', error);
|
||||
// 不影响主流程,继续执行
|
||||
}
|
||||
|
||||
// 导入用户数据
|
||||
const userData = importData.data.userData;
|
||||
for (const username in userData) {
|
||||
|
||||
@@ -226,6 +226,15 @@ export async function POST(request: NextRequest) {
|
||||
// 持久化到存储
|
||||
await db.saveAdminConfig(adminConfig);
|
||||
|
||||
// 清除短剧视频源缓存(因为视频源发生了变动)
|
||||
try {
|
||||
await db.deleteGlobalValue('duanju');
|
||||
console.log('已清除短剧视频源缓存');
|
||||
} catch (error) {
|
||||
console.error('清除短剧视频源缓存失败:', error);
|
||||
// 不影响主流程,继续执行
|
||||
}
|
||||
|
||||
return NextResponse.json(
|
||||
{ ok: true },
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user