|
@@ -209,6 +209,8 @@ async function sendMessage(type = "") {
|
|
|
handleVideoCache(); // 播放 Video Cache
|
|
|
if (audioFile.value && type !== "text") {
|
|
|
messageSaveMp3(message, videoCacheData.value.answer, []);
|
|
|
+ } else {
|
|
|
+ messageSave(message, videoCacheData.value.answer, []);
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
@@ -245,6 +247,8 @@ async function sendMessage(type = "") {
|
|
|
console.log("response", response);
|
|
|
if (audioFile.value && type !== "text") {
|
|
|
messageSaveMp3(message, response.data.response, response.data.data);
|
|
|
+ } else {
|
|
|
+ messageSave(message, response.data.response, response.data.data);
|
|
|
}
|
|
|
|
|
|
messageNotInCache(message, response.data.response); // 回傳未收錄問題
|
|
@@ -2243,7 +2247,27 @@ function recStop() {
|
|
|
|
|
|
let videoCacheData = ref({});
|
|
|
|
|
|
-// 儲存問答 Log & 使用者語音
|
|
|
+// 儲存問答 Log
|
|
|
+async function messageSave(question, answer, data) {
|
|
|
+ let url = "https://cmm.ai:9101/message_save";
|
|
|
+
|
|
|
+ let parameters = {
|
|
|
+ question: question,
|
|
|
+ answer: answer,
|
|
|
+ data_list: data.length ? JSON.stringify(data) : "[]",
|
|
|
+ };
|
|
|
+
|
|
|
+ console.log("messageSave", parameters);
|
|
|
+
|
|
|
+ try {
|
|
|
+ const response = await axios.post(url, parameters);
|
|
|
+ console.log("response", response);
|
|
|
+ } catch (error) {
|
|
|
+ console.log("error", error);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 儲存問答 Log (有使用者錄音檔)
|
|
|
async function messageSaveMp3(question, answer, data) {
|
|
|
let url = "https://cmm.ai:9101/message_save_mp3";
|
|
|
|
|
@@ -3103,7 +3127,7 @@ async function messageNotInCache(question, answer) {
|
|
|
:href="item.info.website_url || item.info.url"
|
|
|
target="_blank"
|
|
|
>
|
|
|
- {{ t("ctaGoUrl") }}
|
|
|
+ {{ t("cta_url") }}
|
|
|
</a> -->
|
|
|
|
|
|
<!-- 掃描 QR Code -->
|
|
@@ -3115,7 +3139,7 @@ async function messageNotInCache(question, answer) {
|
|
|
"
|
|
|
color="primary"
|
|
|
>
|
|
|
- <p class="text-white m-0">{{ t("ctaGoUrl") }}</p>
|
|
|
+ <p class="text-white m-0">{{ t("cta_url") }}</p>
|
|
|
</v-btn>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -3173,7 +3197,7 @@ async function messageNotInCache(question, answer) {
|
|
|
<span>{{ item.info.floor || item.info.price }}</span>
|
|
|
<div class="link-btn">
|
|
|
<!-- <a :href="item.info.url" target="_blank">
|
|
|
- {{ t("ctaGoUrl") }}
|
|
|
+ {{ t("cta_url") }}
|
|
|
</a> -->
|
|
|
|
|
|
<!-- 掃描 QR Code -->
|
|
@@ -3181,7 +3205,7 @@ async function messageNotInCache(question, answer) {
|
|
|
@click="openQrcodeDialog(item.info.url)"
|
|
|
color="primary"
|
|
|
>
|
|
|
- <p class="text-white m-0">{{ t("ctaGoUrl") }}</p>
|
|
|
+ <p class="text-white m-0">{{ t("cta_url") }}</p>
|
|
|
</v-btn>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -3231,7 +3255,7 @@ async function messageNotInCache(question, answer) {
|
|
|
<span>{{ item.info.floor || item.info.price }}</span>
|
|
|
<div class="link-btn">
|
|
|
<!-- <a :href="item.info.url" target="_blank">
|
|
|
- {{ t("ctaGoUrl") }}
|
|
|
+ {{ t("cta_url") }}
|
|
|
</a> -->
|
|
|
|
|
|
<!-- 掃描 QR Code -->
|
|
@@ -3239,7 +3263,7 @@ async function messageNotInCache(question, answer) {
|
|
|
@click="openQrcodeDialog(item.info.url)"
|
|
|
color="primary"
|
|
|
>
|
|
|
- <p class="text-white m-0">{{ t("ctaGoUrl") }}</p>
|
|
|
+ <p class="text-white m-0">{{ t("cta_url") }}</p>
|
|
|
</v-btn>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -3285,7 +3309,7 @@ async function messageNotInCache(question, answer) {
|
|
|
<span>{{ item.info.floor || item.info.price }}</span>
|
|
|
<div class="link-btn">
|
|
|
<a :href="item.info.url" target="_blank">
|
|
|
- {{ t("ctaGoUrl") }}
|
|
|
+ {{ t("cta_url") }}
|
|
|
</a>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -3309,7 +3333,7 @@ async function messageNotInCache(question, answer) {
|
|
|
:href="message.body.store_info_url || message.body.url"
|
|
|
target="_blank"
|
|
|
>
|
|
|
- {{ t("ctaBuyNow") }}
|
|
|
+ {{ t("cta_buy") }}
|
|
|
</a>
|
|
|
<a :href="message.body.website_url" target="_blank"> 官網 </a>
|
|
|
</div>
|