mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: 嵌入式js
This commit is contained in:
parent
0fbd5873f7
commit
20cefe8207
|
|
@ -118,11 +118,10 @@ class ApplicationSerializer(serializers.Serializer):
|
|||
file = open(index_path, "r", encoding='utf-8')
|
||||
content = file.read()
|
||||
file.close()
|
||||
is_auth = 'true'
|
||||
try:
|
||||
ApplicationSerializer.Authentication(data={'access_token': self.data.get('token')}).auth()
|
||||
except Exception as e:
|
||||
is_auth = 'false'
|
||||
application_access_token = QuerySet(ApplicationAccessToken).filter(
|
||||
access_token=self.data.get('token')).first()
|
||||
|
||||
is_auth = 'true' if application_access_token is not None and application_access_token.is_active else 'false'
|
||||
application_access_token = QuerySet(ApplicationAccessToken).filter(
|
||||
access_token=self.data.get('token')).first()
|
||||
t = Template(content)
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ function embedChatbot() {
|
|||
white_list_str='{{white_list_str}}'
|
||||
white_list=white_list_str.split(',')
|
||||
|
||||
if ({{is_auth}}&&{{white_active}}?white_list.includes(window.location.origin):true) {
|
||||
if ({{is_auth}}&&({{white_active}}?white_list.includes(window.location.origin):true)) {
|
||||
// 初始化maxkb智能小助手
|
||||
initMaxkb()
|
||||
} else console.error('invalid parameter')
|
||||
|
|
|
|||
Loading…
Reference in New Issue