diff --git a/apps/common/auth/handle/impl/chat_anonymous_user_token.py b/apps/common/auth/handle/impl/chat_anonymous_user_token.py index cea9467b5..7d8cc56e5 100644 --- a/apps/common/auth/handle/impl/chat_anonymous_user_token.py +++ b/apps/common/auth/handle/impl/chat_anonymous_user_token.py @@ -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')) diff --git a/apps/common/job/clean_chat_job.py b/apps/common/job/clean_chat_job.py index bf7dd362d..44ae4bb86 100644 --- a/apps/common/job/clean_chat_job.py +++ b/apps/common/job/clean_chat_job.py @@ -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(): diff --git a/apps/common/job/clean_debug_file_job.py b/apps/common/job/clean_debug_file_job.py index fed97ac90..4933579d5 100644 --- a/apps/common/job/clean_debug_file_job.py +++ b/apps/common/job/clean_debug_file_job.py @@ -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(): diff --git a/apps/common/job/client_access_num_job.py b/apps/common/job/client_access_num_job.py index 2b35935cf..48262c824 100644 --- a/apps/common/job/client_access_num_job.py +++ b/apps/common/job/client_access_num_job.py @@ -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(): diff --git a/ui/src/views/chat-log/index.vue b/ui/src/views/chat-log/index.vue index d4d9320ad..74adaf226 100644 --- a/ui/src/views/chat-log/index.vue +++ b/ui/src/views/chat-log/index.vue @@ -153,7 +153,7 @@ diff --git a/ui/src/views/chat/auth/component/password.vue b/ui/src/views/chat/auth/component/password.vue index dbbd77ada..70766ea2e 100644 --- a/ui/src/views/chat/auth/component/password.vue +++ b/ui/src/views/chat/auth/component/password.vue @@ -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()