|
|
@@ -5,7 +5,11 @@
|
|
|
<div class="titleTip">欢迎进入随身邦chatBl,智能助理为您提供以下服务</div>
|
|
|
</div>
|
|
|
<div class="content">
|
|
|
- <div class="tabItem" v-for="item in tabData" :style="{ background: item.backColor }">
|
|
|
+ <div
|
|
|
+ class="tabItem"
|
|
|
+ v-for="item in tabData"
|
|
|
+ :style="{ background: item.backColor }"
|
|
|
+ @click="openAiPage">
|
|
|
<div class="tabName">{{ item.tabName }}</div>
|
|
|
<div class="message">{{ item.message }}</div>
|
|
|
<div class="icon">
|
|
|
@@ -28,6 +32,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import { getAiToken } from '@/api/chatAI.js';
|
|
|
export default {
|
|
|
name: 'chatAIPage',
|
|
|
data() {
|
|
|
@@ -47,8 +52,34 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
chatBoxMessage: '',
|
|
|
+ AIToken: '',
|
|
|
};
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.getAiTokenFun();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getAiTokenFun() {
|
|
|
+ this.toastLoading(0, '上传中...', true);
|
|
|
+ getAiToken()
|
|
|
+ .then((res) => {
|
|
|
+ this.toastLoading().clear();
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.AIToken = res.msg;
|
|
|
+ } else {
|
|
|
+ this.$toast(res.msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ this.toastLoading().clear();
|
|
|
+ this.$toast(error.msg);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ openAiPage() {
|
|
|
+ window.location.href =
|
|
|
+ 'http://bi.dgtis.com/cboard/h5/index.html?token=' + this.AIToken + '#/chatbi';
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|