feat(songs): 歌曲管理支持批量驳回、投稿留言自动审查与排期范围可见性过滤
- 新增 /api/admin/songs/batch-reject.post 批量驳回接口(事务清排期/投票/扣接纳数/黑名单去重/异步通知) - requireSongAdmin 三角色校验 + createApiError 统一错误包装 - scheduleDaysBefore/After 四字段排期可见范围限制(开放 API 与公开排期接口三处缓存路径 + DB 条件过滤) - submissionNoteAutoModeration 基于黑名单 KEYWORD/LANGUAGE/GENRE 自动判定留言 publicStatus,命中自动关闭 submissionNotePublic - 更新 songs/request.post 与 songs/[id]/update.put 接入自动审查逻辑
This commit is contained in:
+55
-8
@@ -40,11 +40,51 @@ export default defineNuxtConfig({
|
||||
},
|
||||
modules: [
|
||||
'@nuxtjs/tailwindcss',
|
||||
...(process.env.NODE_ENV === 'development' || process.env.npm_lifecycle_event?.includes('lint')
|
||||
...((process.env.NODE_ENV === 'development' || process.env.npm_lifecycle_event?.includes('lint'))
|
||||
? ['@nuxt/eslint']
|
||||
: []),
|
||||
...((process.env.PWA_ENABLED || 'false') === 'true'
|
||||
? ['@vite-pwa/nuxt']
|
||||
: [])
|
||||
],
|
||||
|
||||
pwa: (process.env.PWA_ENABLED || 'false') === 'true'
|
||||
? {
|
||||
registerType: 'autoUpdate',
|
||||
manifest: {
|
||||
name: process.env.NUXT_PUBLIC_SITE_TITLE || '校园广播站点歌系统',
|
||||
short_name: process.env.NUXT_PUBLIC_SITE_TITLE || 'VoiceHub',
|
||||
description: process.env.NUXT_PUBLIC_SITE_DESCRIPTION || '校园广播站点歌系统',
|
||||
display: (process.env.PWA_DISPLAY as any) || 'standalone',
|
||||
background_color: process.env.PWA_BACKGROUND_COLOR || '#000000',
|
||||
theme_color: process.env.PWA_THEME_COLOR || '#111111',
|
||||
icons: [
|
||||
{
|
||||
src: '/images/logo.png',
|
||||
sizes: '192x192',
|
||||
type: 'image/png'
|
||||
},
|
||||
{
|
||||
src: '/images/logo.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/png'
|
||||
}
|
||||
]
|
||||
},
|
||||
workbox: {
|
||||
navigateFallback: '/',
|
||||
globPatterns: ['**/*.{js,css,html,png,jpg,jpeg,svg,ico,webp,woff2}']
|
||||
},
|
||||
client: {
|
||||
installPrompt: true,
|
||||
periodicSyncForUpdates: 3600
|
||||
},
|
||||
devOptions: {
|
||||
enabled: process.env.NODE_ENV === 'development'
|
||||
}
|
||||
}
|
||||
: {},
|
||||
|
||||
// 引入全局CSS
|
||||
css: [
|
||||
'~/assets/css/variables.css',
|
||||
@@ -150,6 +190,10 @@ export default defineNuxtConfig({
|
||||
},
|
||||
// 移动端优化
|
||||
{ name: 'theme-color', content: '#111111' },
|
||||
{
|
||||
name: 'x-default-theme',
|
||||
content: process.env.NUXT_PUBLIC_DEFAULT_THEME || 'System'
|
||||
},
|
||||
{ name: 'apple-mobile-web-app-capable', content: 'yes' },
|
||||
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent' },
|
||||
{ name: 'apple-mobile-web-app-title', content: 'VoiceHub管理' },
|
||||
@@ -162,22 +206,25 @@ export default defineNuxtConfig({
|
||||
tagPosition: 'head',
|
||||
children: [
|
||||
`(function(){try{`,
|
||||
` var k='voicehub:theme', d=document, r=d.documentElement, s=null;`,
|
||||
` var k='voicehub:theme', d=document, r=d.documentElement, s=null, eff=null;`,
|
||||
` try{s=localStorage.getItem(k)}catch(e){s=null}`,
|
||||
` if(!s){`,
|
||||
` try{`,
|
||||
` var meta=document.querySelector('meta[name="x-default-theme"]');`,
|
||||
` if(meta && meta.content){s=meta.content}`,
|
||||
` }catch(e){s=null}`,
|
||||
` if(!s){s=window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'}`,
|
||||
` if(!s){s='System'}`,
|
||||
` }`,
|
||||
` r.setAttribute('data-theme', s);`,
|
||||
` if(s==='dark'){r.classList.add('dark'); r.style.colorScheme='dark'}`,
|
||||
` else if(s==='light'){r.classList.add('light'); r.style.colorScheme='light'}`,
|
||||
` else{r.style.colorScheme='light dark'}`,
|
||||
` if(s==='System'||s==='system'){eff=window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'}`,
|
||||
` else if(typeof s==='string'){eff=s.endsWith('Dark')||s==='dark'?'dark':(s.endsWith('Light')||s==='light'?'light':s)}`,
|
||||
` else{eff='dark'}`,
|
||||
` r.setAttribute('data-theme', (typeof s==='string'?s:eff));`,
|
||||
` if(eff==='dark'){r.classList.add('dark'); r.classList.remove('light'); r.style.colorScheme='dark'}`,
|
||||
` else if(eff==='light'){r.classList.add('light'); r.classList.remove('dark'); r.style.colorScheme='light'}`,
|
||||
` else{r.classList.remove('dark','light'); r.style.colorScheme='light dark'}`,
|
||||
` try{`,
|
||||
` var tm=d.querySelector('meta[name="theme-color"]');`,
|
||||
` if(tm){tm.content=(s==='light'?'#f8fafc':'#111111')}`,
|
||||
` if(tm){tm.content=(eff==='light'?'#f8fafc':'#111111')}`,
|
||||
` }catch(e){}`,
|
||||
`}catch(e){}})();`
|
||||
].join('')
|
||||
|
||||
Reference in New Issue
Block a user