mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: Interface parameters disappear after dialogue password authentication (#3626)
This commit is contained in:
parent
232e90fd12
commit
d76c85ca3b
|
|
@ -16,6 +16,7 @@ from common.constants.authentication_type import AuthenticationType
|
|||
from common.constants.permission_constants import RoleConstants, Permission, Group, Operate, ChatAuth
|
||||
from common.database_model_manage.database_model_manage import DatabaseModelManage
|
||||
from common.exception.app_exception import AppAuthenticationFailed
|
||||
from maxkb.settings import edition
|
||||
|
||||
|
||||
class ChatAnonymousUserToken(AuthBaseHandle):
|
||||
|
|
@ -41,7 +42,7 @@ class ChatAnonymousUserToken(AuthBaseHandle):
|
|||
raise AppAuthenticationFailed(1002, _('Authentication information is incorrect'))
|
||||
if not application_access_token.access_token == access_token:
|
||||
raise AppAuthenticationFailed(1002, _('Authentication information is incorrect'))
|
||||
if application_access_token.authentication:
|
||||
if application_access_token.authentication and ['PE', 'EE'].__contains__(edition):
|
||||
if chat_user_token.authentication.auth_type != application_access_token.authentication_value.get('type',
|
||||
''):
|
||||
raise AppAuthenticationFailed(1002, _('Authentication information is incorrect'))
|
||||
|
|
|
|||
|
|
@ -1,17 +1,16 @@
|
|||
# coding=utf-8
|
||||
|
||||
import logging
|
||||
import datetime
|
||||
|
||||
from django.db import transaction
|
||||
from django.utils import timezone
|
||||
from apscheduler.schedulers.background import BackgroundScheduler
|
||||
from django_apscheduler.jobstores import DjangoJobStore
|
||||
from application.models import Application, Chat, ChatRecord
|
||||
from django.db import transaction
|
||||
from django.db.models import Q, Max
|
||||
from django.utils import timezone
|
||||
from django_apscheduler.jobstores import DjangoJobStore
|
||||
|
||||
from application.models import Application, Chat, ChatRecord
|
||||
from common.utils.lock import try_lock, un_lock, lock
|
||||
from common.utils.logger import maxkb_logger
|
||||
|
||||
from knowledge.models import File
|
||||
|
||||
scheduler = BackgroundScheduler()
|
||||
|
|
@ -25,7 +24,7 @@ def clean_chat_log_job():
|
|||
@lock(lock_key='clean_chat_log_job_execute', timeout=30)
|
||||
def clean_chat_log_job_lock():
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
maxkb_logger.info(_('start clean chat log'))
|
||||
maxkb_logger.debug(_('start clean chat log'))
|
||||
now = timezone.now()
|
||||
|
||||
applications = Application.objects.all().values('id', 'clean_time')
|
||||
|
|
@ -71,7 +70,7 @@ def clean_chat_log_job_lock():
|
|||
if deleted_count < batch_size:
|
||||
break
|
||||
|
||||
maxkb_logger.info(_('end clean chat log'))
|
||||
maxkb_logger.debug(_('end clean chat log'))
|
||||
|
||||
|
||||
def run():
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# coding=utf-8
|
||||
|
||||
import time
|
||||
from datetime import timedelta
|
||||
|
||||
from apscheduler.schedulers.background import BackgroundScheduler
|
||||
|
|
@ -32,6 +32,7 @@ def clean_debug_file_lock():
|
|||
Q(create_time__lt=two_hours_ago, source_type=FileSourceType.TEMPORARY_120_MINUTE.value) |
|
||||
Q(create_time__lt=minutes_30_ago, source_type=FileSourceType.TEMPORARY_30_MINUTE.value)).delete()
|
||||
maxkb_logger.debug(_('end clean debug file'))
|
||||
time.sleep(2)
|
||||
|
||||
|
||||
def run():
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
@date:2024/3/14 11:56
|
||||
@desc:
|
||||
"""
|
||||
import logging
|
||||
|
||||
from apscheduler.schedulers.background import BackgroundScheduler
|
||||
from django.db.models import QuerySet
|
||||
|
|
@ -27,9 +26,9 @@ def client_access_num_reset_job():
|
|||
@lock(lock_key="access_num_reset_execute", timeout=30)
|
||||
def client_access_num_reset_job_lock():
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
maxkb_logger.info(_('start reset access_num'))
|
||||
maxkb_logger.debug(_('start reset access_num'))
|
||||
QuerySet(ApplicationChatUserStats).update(intraday_access_num=0)
|
||||
maxkb_logger.info(_('end reset access_num'))
|
||||
maxkb_logger.debug(_('end reset access_num'))
|
||||
|
||||
|
||||
def run():
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@
|
|||
<el-table-column prop="mark_sum" :label="$t('views.chatLog.table.mark')" align="right" />
|
||||
<el-table-column prop="asker" :label="$t('views.chatLog.table.user')">
|
||||
<template #default="{ row }">
|
||||
{{ row.asker?.user_name }}
|
||||
{{ row.asker?.username }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('views.chatLog.table.recenTimes')" width="180">
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import { ref, computed } from 'vue'
|
|||
import useStore from '@/stores'
|
||||
import { t } from '@/locales'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
const route = useRoute()
|
||||
const FormRef = ref()
|
||||
|
||||
const { chatUser } = useStore()
|
||||
|
|
|
|||
Loading…
Reference in New Issue