feat: 添加用户错误日志功能, 禁用Redis缓存, userId自动生成5位随机字符
This commit is contained in:
@@ -268,16 +268,6 @@
|
||||
</el-input>
|
||||
<div class="model-tip">{{ $t('systemSettings.storyboardSystemPromptTip') }}</div>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('systemSettings.promptOptimizationSystemPrompt')">
|
||||
<el-input
|
||||
v-model="promptOptimizationSystemPrompt"
|
||||
type="textarea"
|
||||
:rows="6"
|
||||
style="width: 500px;"
|
||||
:placeholder="$t('systemSettings.promptOptimizationSystemPromptPlaceholder')">
|
||||
</el-input>
|
||||
<div class="model-tip">{{ $t('systemSettings.promptOptimizationSystemPromptTip') }}</div>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
@@ -510,7 +500,6 @@ const cleanupConfig = reactive({
|
||||
const promptOptimizationModel = ref('gpt-5.1-thinking')
|
||||
const promptOptimizationApiUrl = ref('https://ai.comfly.chat')
|
||||
const storyboardSystemPrompt = ref('')
|
||||
const promptOptimizationSystemPrompt = ref('')
|
||||
const savingAiModel = ref(false)
|
||||
|
||||
const goToDashboard = () => {
|
||||
@@ -664,23 +653,24 @@ const loadMembershipLevels = async () => {
|
||||
|
||||
// 任务清理相关方法
|
||||
const getAuthHeaders = () => {
|
||||
const token = sessionStorage.getItem('token')
|
||||
const token = localStorage.getItem('token')
|
||||
return token ? { 'Authorization': `Bearer ${token}` } : {}
|
||||
}
|
||||
|
||||
const refreshStats = async () => {
|
||||
const refreshStats = async (showMessage = true) => {
|
||||
loadingStats.value = true
|
||||
try {
|
||||
const response = await cleanupApi.getCleanupStats()
|
||||
cleanupStats.value = response.data
|
||||
ElMessage.success(t('systemSettings.statsRefreshSuccess'))
|
||||
if (showMessage) {
|
||||
ElMessage.success(t('systemSettings.statsRefreshSuccess'))
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Get statistics failed:', error)
|
||||
ElMessage.error(t('systemSettings.statsRefreshFailed'))
|
||||
} finally {
|
||||
loadingStats.value = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const performFullCleanup = async () => {
|
||||
@@ -779,7 +769,7 @@ const loadAiModelSettings = async () => {
|
||||
try {
|
||||
const response = await fetch('/api/admin/settings', {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${sessionStorage.getItem('token')}`
|
||||
'Authorization': `Bearer ${localStorage.getItem('token')}`
|
||||
}
|
||||
})
|
||||
if (response.ok) {
|
||||
@@ -793,9 +783,6 @@ const loadAiModelSettings = async () => {
|
||||
if (data.storyboardSystemPrompt !== undefined) {
|
||||
storyboardSystemPrompt.value = data.storyboardSystemPrompt
|
||||
}
|
||||
if (data.promptOptimizationSystemPrompt !== undefined) {
|
||||
promptOptimizationSystemPrompt.value = data.promptOptimizationSystemPrompt
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Load AI model settings failed:', error)
|
||||
@@ -810,13 +797,12 @@ const saveAiModelSettings = async () => {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': `Bearer ${sessionStorage.getItem('token')}`
|
||||
'Authorization': `Bearer ${localStorage.getItem('token')}`
|
||||
},
|
||||
body: JSON.stringify({
|
||||
promptOptimizationModel: promptOptimizationModel.value,
|
||||
promptOptimizationApiUrl: promptOptimizationApiUrl.value,
|
||||
storyboardSystemPrompt: storyboardSystemPrompt.value,
|
||||
promptOptimizationSystemPrompt: promptOptimizationSystemPrompt.value
|
||||
storyboardSystemPrompt: storyboardSystemPrompt.value
|
||||
})
|
||||
})
|
||||
if (response.ok) {
|
||||
@@ -834,7 +820,7 @@ const saveAiModelSettings = async () => {
|
||||
|
||||
// 页面加载时获取统计信息和会员等级配置
|
||||
onMounted(() => {
|
||||
refreshStats()
|
||||
refreshStats(false) // 初始加载不显示成功提示
|
||||
loadMembershipLevels()
|
||||
fetchSystemStats()
|
||||
loadAiModelSettings()
|
||||
@@ -845,7 +831,7 @@ const fetchSystemStats = async () => {
|
||||
try {
|
||||
const response = await fetch('/api/admin/online-stats', {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${sessionStorage.getItem('token')}`
|
||||
'Authorization': `Bearer ${localStorage.getItem('token')}`
|
||||
}
|
||||
})
|
||||
const data = await response.json()
|
||||
|
||||
Reference in New Issue
Block a user