jeawin-astro 3.0.95 → 3.0.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import {render_value, render_lang} from "../scripts/util.js";
|
|
3
|
-
const {jeawin_form_api_domain, jeawinapi, all_langs} = Astro.locals;
|
|
3
|
+
const {jeawin_form_api_domain, jeawinapi, all_langs, siteinfo} = Astro.locals;
|
|
4
4
|
let chatbot_status = false;
|
|
5
5
|
let prompts = [];
|
|
6
6
|
let assistant_name = '';
|
|
@@ -31,6 +31,7 @@ try{
|
|
|
31
31
|
<link rel="stylesheet" crossorigin href="https://img.jeawincdn.com/resource/web-chatbot-ui/dist/index.css" />
|
|
32
32
|
<script is:inline type="module" crossorigin="true" src="https://img.jeawincdn.com/resource/web-chatbot-ui/dist/index.js"></script>
|
|
33
33
|
<script define:vars={{
|
|
34
|
+
siteinfo: siteinfo,
|
|
34
35
|
jeawin_form_api_domain:jeawin_form_api_domain,
|
|
35
36
|
assistant_name: assistant_name,
|
|
36
37
|
assistant_avatar: assistant_avatar,
|
|
@@ -47,7 +48,7 @@ try{
|
|
|
47
48
|
// @ts-ignore
|
|
48
49
|
window.CHATBOT_CONFIG = {
|
|
49
50
|
title: title,
|
|
50
|
-
endpoint: `${jeawin_form_api_domain}/api.php?c=chatbot&m=chat`, // 可以替换为 https://{your-fc-http-trigger-domain}/chat
|
|
51
|
+
endpoint: `${jeawin_form_api_domain}/api.php?c=chatbot&m=chat&site_id=${siteinfo.id}`, // 可以替换为 https://{your-fc-http-trigger-domain}/chat
|
|
51
52
|
displayByDefault: false, // 默认不展示 AI 助手聊天框
|
|
52
53
|
aiChatOptions: { // aiChatOptions 中 options 会传递 aiChat 组件,自定义取值参考:https://docs.nlkit.com/nlux/reference/ui/ai-chat
|
|
53
54
|
conversationOptions: { // 自定义取值参考:https://docs.nlkit.com/nlux/reference/ui/ai-chat#conversation-options
|
package/src/scripts/util.js
CHANGED
|
@@ -206,13 +206,13 @@ export function render_url(url, base = '', queryObj = null, suffix = '.html') {
|
|
|
206
206
|
str = url;
|
|
207
207
|
} else {
|
|
208
208
|
if (url == '/') {
|
|
209
|
-
str = '
|
|
209
|
+
str = `${base || ''}/`;
|
|
210
210
|
} else {
|
|
211
|
-
str =
|
|
211
|
+
str = `${base || ''}/${_.trimStart(url.replaceAll(suffix, ''), '/')}${suffix}`;
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
} else {
|
|
215
|
-
str = '
|
|
215
|
+
str = `${base || ''}/`;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
let queryStr = '';
|
|
@@ -229,7 +229,7 @@ export function render_url(url, base = '', queryObj = null, suffix = '.html') {
|
|
|
229
229
|
queryStr = new_params.size ? `?${new_params.toString()}` : '';
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
return `${
|
|
232
|
+
return `${str}${queryStr}`;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
/**
|