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')
|
file = open(index_path, "r", encoding='utf-8')
|
||||||
content = file.read()
|
content = file.read()
|
||||||
file.close()
|
file.close()
|
||||||
is_auth = 'true'
|
application_access_token = QuerySet(ApplicationAccessToken).filter(
|
||||||
try:
|
access_token=self.data.get('token')).first()
|
||||||
ApplicationSerializer.Authentication(data={'access_token': self.data.get('token')}).auth()
|
|
||||||
except Exception as e:
|
is_auth = 'true' if application_access_token is not None and application_access_token.is_active else 'false'
|
||||||
is_auth = 'false'
|
|
||||||
application_access_token = QuerySet(ApplicationAccessToken).filter(
|
application_access_token = QuerySet(ApplicationAccessToken).filter(
|
||||||
access_token=self.data.get('token')).first()
|
access_token=self.data.get('token')).first()
|
||||||
t = Template(content)
|
t = Template(content)
|
||||||
|
|||||||
@ -289,7 +289,7 @@ function embedChatbot() {
|
|||||||
white_list_str='{{white_list_str}}'
|
white_list_str='{{white_list_str}}'
|
||||||
white_list=white_list_str.split(',')
|
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智能小助手
|
// 初始化maxkb智能小助手
|
||||||
initMaxkb()
|
initMaxkb()
|
||||||
} else console.error('invalid parameter')
|
} else console.error('invalid parameter')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user