feat: 添加聊天历史组件及相关功能,优化消息发送逻辑
This commit is contained in:
parent
25ab27317d
commit
aef3a3069d
153
App.vue
153
App.vue
|
@ -1,31 +1,29 @@
|
|||
<script>
|
||||
import router from "./static/common/js/router";
|
||||
import config from "./static/common/js/config.js"
|
||||
import config from "./static/common/js/config.js";
|
||||
|
||||
var jweixin = require("jweixin-module");
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
}
|
||||
};
|
||||
},
|
||||
globalData: {},
|
||||
created() {
|
||||
|
||||
},
|
||||
created() {},
|
||||
onLaunch() {
|
||||
if (typeof window.entryUrl === 'undefined' || window.entryUrl === '') {
|
||||
window.entryUrl = location.href.split('#')[0]
|
||||
if (typeof window.entryUrl === "undefined" || window.entryUrl === "") {
|
||||
window.entryUrl = location.href.split("#")[0];
|
||||
}
|
||||
router.initApp(this);
|
||||
// 处理项目加载时白名单不生效异常问题
|
||||
let isUrl = this._route.fullPath.split('?')[0]
|
||||
let notNeed = config.whiteList.includes(isUrl)
|
||||
let isUrl = this._route.fullPath.split("?")[0];
|
||||
let notNeed = config.whiteList.includes(isUrl);
|
||||
if (notNeed) {
|
||||
uni.navigateTo({
|
||||
url: this._route.fullPath,
|
||||
});
|
||||
return
|
||||
return;
|
||||
}
|
||||
var that = this;
|
||||
uni.getSystemInfo({
|
||||
|
@ -36,7 +34,20 @@ export default {
|
|||
}
|
||||
},
|
||||
});
|
||||
return
|
||||
|
||||
debugger;
|
||||
|
||||
if (!that.vuex_user) {
|
||||
this.$u.vuex("vuex_user", "");
|
||||
this.$u.vuex("vuex_token", "");
|
||||
uni.clearStorage();
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/login/index",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
if (!that.vuex_user.isFill) {
|
||||
this.$u.vuex("vuex_msgList", "");
|
||||
this.$u.vuex("vuex_user", "");
|
||||
|
@ -51,10 +62,8 @@ export default {
|
|||
uni.navigateTo({
|
||||
url: "/pages/login/roleSelection",
|
||||
});
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// onShow(){
|
||||
// console.log('onShow')
|
||||
|
@ -64,12 +73,12 @@ export default {
|
|||
var that = this;
|
||||
if (this.isWechat()) {
|
||||
const isiOS = !!navigator.userAgent.match(
|
||||
/\(i[^;]+;( U;)? CPU.+Mac OS X/
|
||||
/\(i[^;]+;( U;)? CPU.+Mac OS X/
|
||||
); //ios终端
|
||||
// 进行签名的时候 Android 不用使用之前的链接, ios 需要
|
||||
const signLink = isiOS
|
||||
? window.entryUrl
|
||||
: window.location.href.split("#")[0];
|
||||
? window.entryUrl
|
||||
: window.location.href.split("#")[0];
|
||||
//获取当前url然后传递给后台获取授权和签名信息,后台需要解码才能使用
|
||||
// const url =encodeURIComponent(signLink);
|
||||
const url = signLink;
|
||||
|
@ -100,14 +109,14 @@ export default {
|
|||
type: "gcj02", // 默认为wgs84的gps坐标,如果要返 回直接给openLocation用的火星坐标,可传入'gcj02'
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
that.$u.vuex('vuex_userLocation', res)
|
||||
that.$u.vuex("vuex_userLocation", res);
|
||||
|
||||
var data = {
|
||||
userId: that.vuex_user.id,
|
||||
longitude: res.longitude + "",
|
||||
latitude: res.latitude + "",
|
||||
};
|
||||
that.$u.api.upPosition(data)
|
||||
that.$u.api.upPosition(data);
|
||||
},
|
||||
fail: function (res) {
|
||||
uni.hideLoading();
|
||||
|
@ -126,16 +135,15 @@ export default {
|
|||
isHighAccuracy: true,
|
||||
highAccuracyExpireTime: 3000,
|
||||
success: (res) => {
|
||||
|
||||
uni.hideLoading();
|
||||
|
||||
this.$u.vuex('vuex_userLocation', res)
|
||||
this.$u.vuex("vuex_userLocation", res);
|
||||
var data = {
|
||||
userId: this.vuex_user.id,
|
||||
longitude: res.longitude + "",
|
||||
latitude: res.latitude + "",
|
||||
};
|
||||
this.$u.api.upPosition(data)
|
||||
this.$u.api.upPosition(data);
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.hideLoading();
|
||||
|
@ -160,75 +168,76 @@ export default {
|
|||
setTimeout(() => {
|
||||
try {
|
||||
that.$connection
|
||||
.start()
|
||||
.then(() => {
|
||||
// console.log(that.$connection.connection.transport.webSocket._webSocket.url)
|
||||
// that.connectionId = that.$connection.connection.transport.url.split(
|
||||
// "=")[1]
|
||||
that.connectionId = that.$connection.connection.transport.webSocket._webSocket.url.split(
|
||||
"=")[1]
|
||||
that.CharLogin()
|
||||
})
|
||||
.catch((e) => {
|
||||
//重试
|
||||
that.$connection.sto
|
||||
console.log("websocket连接失败", e);
|
||||
return start(5000);
|
||||
});
|
||||
.start()
|
||||
.then(() => {
|
||||
// console.log(that.$connection.connection.transport.webSocket._webSocket.url)
|
||||
// that.connectionId = that.$connection.connection.transport.url.split(
|
||||
// "=")[1]
|
||||
that.connectionId =
|
||||
that.$connection.connection.transport.webSocket._webSocket.url.split(
|
||||
"="
|
||||
)[1];
|
||||
that.CharLogin();
|
||||
})
|
||||
.catch((e) => {
|
||||
//重试
|
||||
that.$connection.sto;
|
||||
console.log("websocket连接失败", e);
|
||||
return start(5000);
|
||||
});
|
||||
} catch (e) {
|
||||
//重试
|
||||
return start(5000);
|
||||
}
|
||||
}, ms);
|
||||
})(0)
|
||||
})(0);
|
||||
//接收消息
|
||||
this.$connection.on("ReceiveMessage", (user, message, type) => {
|
||||
|
||||
if (this._route.fullPath.indexOf('dialogBox') < 0) {
|
||||
if (this._route.fullPath.indexOf("dialogBox") < 0) {
|
||||
var tab = this.vuex_tabbar;
|
||||
tab[1].isDot = true;
|
||||
this.$u.vuex('vuex_tabbar', tab);
|
||||
var msgList = this.vuex_tabbar
|
||||
var msgList = this.vuex_msgList
|
||||
this.$u.vuex("vuex_tabbar", tab);
|
||||
var msgList = this.vuex_tabbar;
|
||||
var msgList = this.vuex_msgList;
|
||||
// 管理员对普通用户
|
||||
if (type == 4) {
|
||||
user = 'admin'
|
||||
user = "admin";
|
||||
}
|
||||
if (type == 3) {
|
||||
user += 'user'
|
||||
user += "user";
|
||||
}
|
||||
if (msgList.indexOf(user) < 0) {
|
||||
msgList += (user + ',');
|
||||
msgList += user + ",";
|
||||
}
|
||||
this.$u.vuex('vuex_msgList', msgList)
|
||||
this.$u.vuex("vuex_msgList", msgList);
|
||||
}
|
||||
});
|
||||
//接收系统消息
|
||||
this.$connection.on("SystemMessage", (title, content, time) => {
|
||||
if (this._route.fullPath.indexOf('sysList') < 0) {
|
||||
if (this._route.fullPath.indexOf("sysList") < 0) {
|
||||
var tab = this.vuex_tabbar;
|
||||
tab[1].isDot = true;
|
||||
this.$u.vuex('vuex_tabbar', tab);
|
||||
var msgList = this.vuex_tabbar
|
||||
var msgList = this.vuex_msgList
|
||||
if (msgList.indexOf('SystemMessage') < 0) {
|
||||
msgList += 'SystemMessage,';
|
||||
this.$u.vuex("vuex_tabbar", tab);
|
||||
var msgList = this.vuex_tabbar;
|
||||
var msgList = this.vuex_msgList;
|
||||
if (msgList.indexOf("SystemMessage") < 0) {
|
||||
msgList += "SystemMessage,";
|
||||
}
|
||||
this.$u.vuex('vuex_msgList', msgList)
|
||||
this.$u.vuex("vuex_msgList", msgList);
|
||||
}
|
||||
});
|
||||
//接收互动消息
|
||||
this.$connection.on("InteractMessage", (data, type) => {
|
||||
if (this._route.fullPath.indexOf('interactionList') < 0) {
|
||||
if (this._route.fullPath.indexOf("interactionList") < 0) {
|
||||
var tab = this.vuex_tabbar;
|
||||
tab[1].isDot = true;
|
||||
this.$u.vuex('vuex_tabbar', tab);
|
||||
var msgList = this.vuex_tabbar
|
||||
var msgList = this.vuex_msgList
|
||||
if (msgList.indexOf('InteractMessage') < 0) {
|
||||
msgList += 'InteractMessage,';
|
||||
this.$u.vuex("vuex_tabbar", tab);
|
||||
var msgList = this.vuex_tabbar;
|
||||
var msgList = this.vuex_msgList;
|
||||
if (msgList.indexOf("InteractMessage") < 0) {
|
||||
msgList += "InteractMessage,";
|
||||
}
|
||||
this.$u.vuex('vuex_msgList', msgList)
|
||||
this.$u.vuex("vuex_msgList", msgList);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -236,23 +245,20 @@ export default {
|
|||
//绑定用户账号和connectionId
|
||||
if (this.vuex_user.id) {
|
||||
this.$connection
|
||||
.invoke("login", this.connectionId, this.vuex_user.id)
|
||||
.then((res) => {
|
||||
|
||||
})
|
||||
.catch((err) => {
|
||||
});
|
||||
.invoke("login", this.connectionId, this.vuex_user.id)
|
||||
.then((res) => {})
|
||||
.catch((err) => {});
|
||||
//初始化获取定位
|
||||
// this.getLocation()
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.CharLogin()
|
||||
}, 1000)
|
||||
this.CharLogin();
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.charLink()
|
||||
this.charLink();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -305,7 +311,7 @@ uni-modal .uni-modal__btn:after {
|
|||
|
||||
uni-modal .uni-modal__btn_default {
|
||||
background: #e6f6ff;
|
||||
color: #3CB5FB !important;
|
||||
color: #3cb5fb !important;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
|
@ -322,7 +328,6 @@ uni-modal .uni-modal__btn_primary {
|
|||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
|
||||
uni-modal .uni-modal {
|
||||
padding: 40rpx;
|
||||
box-sizing: border-box;
|
||||
|
@ -357,8 +362,8 @@ uni-page-body {
|
|||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
|
||||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
|
||||
"Microsoft Yahei", sans-serif;
|
||||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
|
||||
"Microsoft Yahei", sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
// max-width: 1536rpx;
|
||||
|
|
|
@ -93,6 +93,10 @@ const install = (Vue, vm) => {
|
|||
/** 首页ai对话 */
|
||||
// 发送消息
|
||||
let SendMessageApi = (params = {}) => vm.$u.post('api/ChatAI/CreateChat', params);
|
||||
// 获取历史对话列表
|
||||
let GetConversationPage = (params = {}) => vm.$u.get('api/ChatAI/GetConversationPage', params);
|
||||
// 获取对话详情
|
||||
let GetConversationDetail = (params = {}) => vm.$u.get('api/ChatAI/GetHistoricalConversations', params);
|
||||
|
||||
/** 登录 */
|
||||
// 获取图形验证码
|
||||
|
@ -144,7 +148,9 @@ const install = (Vue, vm) => {
|
|||
SendMessageApi,
|
||||
GetCaptcha,
|
||||
GetStuVerifyCode,
|
||||
StuLogin
|
||||
StuLogin,
|
||||
GetConversationPage,
|
||||
GetConversationDetail
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,210 @@
|
|||
<template>
|
||||
<u-popup v-model="showPopup" width="550rpx">
|
||||
<view class="drawer-container">
|
||||
<view class="drawer-header">
|
||||
<text class="drawer-title" @click="handleCreateConversation">
|
||||
<u-icon
|
||||
class="drawer-title-icon"
|
||||
name="plus"
|
||||
size="32rpx"
|
||||
color="#666666"
|
||||
></u-icon>
|
||||
新建对话
|
||||
</text>
|
||||
</view>
|
||||
<scroll-view scroll-y class="chat-history-list">
|
||||
<!-- 使用新的数据结构渲染聊天历史 -->
|
||||
<view
|
||||
v-for="(group, groupIndex) in chatHistoryList3"
|
||||
:key="'group-' + group.id + groupIndex"
|
||||
>
|
||||
<!-- 日期标题 -->
|
||||
<view class="chat-day">
|
||||
<text class="day-text">{{ group.id }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 该日期下的对话列表 -->
|
||||
<view
|
||||
class="chat-item"
|
||||
v-for="(item, index) in group.conversation"
|
||||
:key="'conv-' + groupIndex + '-' + index"
|
||||
:class="{
|
||||
'chat-item-active':
|
||||
currentActiveGroup === groupIndex &&
|
||||
currentActiveIndex === index,
|
||||
}"
|
||||
@click="selectChatItem(groupIndex, index, item.id)"
|
||||
>
|
||||
<text class="chat-text">{{ item.title }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view class="drawer-footer">
|
||||
<view class="user-info">
|
||||
<image
|
||||
class="user-avatar"
|
||||
src="/static/common/images/avatar.png"
|
||||
></image>
|
||||
<text class="user-name">{{ userName || "晓德塔," }}</text>
|
||||
</view>
|
||||
<view class="settings">
|
||||
<u-icon name="setting" size="40rpx" color="#999"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "ChatHistory",
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
chatHistoryList3: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
activeIndex: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
userName: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showPopup: false,
|
||||
currentActiveGroup: -1,
|
||||
currentActiveIndex: -1,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
show: {
|
||||
handler(newVal) {
|
||||
this.showPopup = newVal;
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
showPopup(val) {
|
||||
if (val !== this.show) {
|
||||
this.$emit("update:show", val);
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
selectChatItem(groupIndex, index, conversationId) {
|
||||
this.currentActiveGroup = groupIndex;
|
||||
this.currentActiveIndex = index;
|
||||
|
||||
// 向父组件发送选中的对话信息
|
||||
this.$emit("select-conversation", {
|
||||
conversationId,
|
||||
});
|
||||
},
|
||||
|
||||
handleCreateConversation() {
|
||||
this.$emit("create-conversation");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.drawer-container {
|
||||
padding: 32rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
background-color: #ffffff;
|
||||
|
||||
.drawer-header {
|
||||
padding: 40rpx 32rpx;
|
||||
|
||||
.drawer-title {
|
||||
font-family: DouyinSans;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #666666;
|
||||
|
||||
.drawer-title-icon {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.chat-history-list {
|
||||
flex: 1;
|
||||
height: calc(100vh - 200rpx);
|
||||
|
||||
.chat-day {
|
||||
display: flex;
|
||||
margin: 20rpx 0 20rpx 30rpx;
|
||||
|
||||
.day-text {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
font-family: PingFang SC;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.chat-item {
|
||||
padding: 24rpx 30rpx;
|
||||
border-radius: 16rpx;
|
||||
|
||||
.chat-text {
|
||||
font-size: 28rpx;
|
||||
color: #303030;
|
||||
font-family: PingFang SC;
|
||||
}
|
||||
|
||||
&-active {
|
||||
background-color: #4f6aff;
|
||||
|
||||
.chat-text {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.drawer-footer {
|
||||
height: 130rpx;
|
||||
border: 1rpx solid #eeeeee;
|
||||
border-radius: 12rpx;
|
||||
padding: 0 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.user-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.user-avatar {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.user-name {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
font-family: DouyinSans;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.settings {
|
||||
padding: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -54,7 +54,7 @@
|
|||
</view> -->
|
||||
|
||||
<view class="start-chat">
|
||||
<button class="chat-button" @click="isChat = true">
|
||||
<button class="chat-button" @click="handleStartChat">
|
||||
<image
|
||||
class="chat-icon"
|
||||
src="/static/common/images/icon_chat.png"
|
||||
|
@ -116,46 +116,45 @@
|
|||
<view class="chat-content">
|
||||
<!-- 消息循环渲染 -->
|
||||
<block
|
||||
v-for="(group, groupIndex) in messageGroups"
|
||||
:key="'group-' + groupIndex"
|
||||
v-for="(message, index) in messageGroups"
|
||||
:key="'msg-' + index"
|
||||
>
|
||||
<!-- 时间 -->
|
||||
<view class="message-time" v-if="group.time">{{ group.time }}</view>
|
||||
<view class="message-time" v-if="message.timeLabel === 1">
|
||||
{{ message.displayTime }}
|
||||
</view>
|
||||
|
||||
<!-- 消息列表 -->
|
||||
<block
|
||||
v-for="(message, messageIndex) in group.messages"
|
||||
:key="'msg-' + groupIndex + '-' + messageIndex"
|
||||
<!-- 用户消息 -->
|
||||
<view
|
||||
class="message-right"
|
||||
v-if="message.interactMode === 0"
|
||||
:id="'msg-' + message.id"
|
||||
>
|
||||
<!-- 用户消息 -->
|
||||
<view
|
||||
class="message-right"
|
||||
v-if="message.isUser"
|
||||
:id="'msg-' + message.id"
|
||||
>
|
||||
<view class="message-content">
|
||||
<text>{{ message.content }}</text>
|
||||
</view>
|
||||
<image
|
||||
class="user-avatar"
|
||||
src="/static/common/images/avatar.png"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
<view class="message-content">
|
||||
<text>{{ message.message }}</text>
|
||||
</view>
|
||||
<image
|
||||
class="user-avatar"
|
||||
src="/static/common/images/avatar.png"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- AI消息 -->
|
||||
<view class="message-left" v-else :id="'msg-' + message.id">
|
||||
<image
|
||||
class="ai-avatar"
|
||||
src="/static/common/images/avatar_ai.png"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
<view class="message-content">
|
||||
<!-- <text space="nbsp" decode>{{ message.content }}</text> -->
|
||||
<markdown-viewer :content="message.content" />
|
||||
</view>
|
||||
<!-- AI消息 -->
|
||||
<view
|
||||
class="message-left"
|
||||
v-if="message.interactMode === 1"
|
||||
:id="'msg-' + message.id"
|
||||
>
|
||||
<image
|
||||
class="ai-avatar"
|
||||
src="/static/common/images/avatar_ai.png"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
<view class="message-content">
|
||||
<markdown-viewer :content="message.message" />
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
@ -206,6 +205,7 @@
|
|||
v-model="messageValue"
|
||||
type="text"
|
||||
class="chat-input"
|
||||
:focus="true"
|
||||
placeholder="请输入内容"
|
||||
placeholder-style="color: #adadad;"
|
||||
@confirm="sendMessageFn"
|
||||
|
@ -223,56 +223,13 @@
|
|||
</view>
|
||||
|
||||
<!-- 对话弹出层 -->
|
||||
<u-popup v-model="popupShow" width="550rpx">
|
||||
<view class="drawer-container">
|
||||
<scroll-view scroll-y class="chat-history-list">
|
||||
<view class="chat-day">
|
||||
<text class="day-text">周三</text>
|
||||
</view>
|
||||
<view
|
||||
class="chat-item"
|
||||
v-for="(item, index) in chatHistoryList"
|
||||
:key="index"
|
||||
:class="{ 'chat-item-active': index === activeIndex }"
|
||||
@click="selectChatItem(index)"
|
||||
>
|
||||
<text class="chat-text">{{ item.content }}</text>
|
||||
</view>
|
||||
<view class="chat-day">
|
||||
<text class="day-text">6/27</text>
|
||||
</view>
|
||||
<view
|
||||
class="chat-item"
|
||||
v-for="(item, index) in chatHistoryList2"
|
||||
:key="'history2-' + index"
|
||||
:class="{
|
||||
'chat-item-active':
|
||||
index + chatHistoryList.length === activeIndex,
|
||||
}"
|
||||
@click="selectChatItem(index + chatHistoryList.length)"
|
||||
>
|
||||
<text class="chat-text">{{ item.content }}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view class="drawer-footer">
|
||||
<view class="user-info">
|
||||
<image
|
||||
class="user-avatar"
|
||||
src="/static/common/avatar/male.png"
|
||||
></image>
|
||||
<!-- <u-avatar
|
||||
class="user-avatar"
|
||||
src="/static/common/avatar/user-avatar.png"
|
||||
></u-avatar> -->
|
||||
<text class="user-name">晓德塔,</text>
|
||||
</view>
|
||||
<view class="settings">
|
||||
<u-icon name="setting" size="40rpx" color="#999"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<chat-history
|
||||
:show.sync="popupShow"
|
||||
:chat-history-list3="chatHistoryList3"
|
||||
:user-name="vuex_user ? vuex_user.Name : ''"
|
||||
@select-conversation="handleSelectConversation"
|
||||
@create-conversation="handleCreateConversation"
|
||||
></chat-history>
|
||||
|
||||
<!-- 完善信息弹出层 -->
|
||||
<perfect-info :show.sync="perfectInfoShow"></perfect-info>
|
||||
|
@ -290,6 +247,7 @@ import MarkdownViewer from "@/components/markdown-viewer/markdown-viewer";
|
|||
import CustomTabBar from "@/components/custom-tab-bar/custom-tab-bar.vue";
|
||||
import AdvicePhone from "@/components/AdvicePhone.vue";
|
||||
import PerfectInfo from "@/components/PerfectInfo.vue";
|
||||
import ChatHistory from "@/components/ChatHistory.vue"; // 导入新组件
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
@ -297,10 +255,12 @@ export default {
|
|||
AdvicePhone,
|
||||
MarkdownViewer,
|
||||
PerfectInfo,
|
||||
ChatHistory, // 注册新组件
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isChat: false,
|
||||
currentConversationId: "",
|
||||
advicePhoneShow: false,
|
||||
perfectInfoShow: false,
|
||||
|
||||
|
@ -326,22 +286,37 @@ export default {
|
|||
},
|
||||
],
|
||||
popupShow: false,
|
||||
chatHistoryList: [
|
||||
{ content: "学校哪些专业比较好?" },
|
||||
{ content: "如何报考学校综合合录取评澳市评招生?" },
|
||||
{ content: "学校有新华专业?" },
|
||||
],
|
||||
chatHistoryList2: [
|
||||
{ content: "学校哪些专业比较好?" },
|
||||
{ content: "如何报考学校综合合录取评澳市评招生?" },
|
||||
{ content: "如何报考学校综合合录取评澳市评招生?" },
|
||||
{ content: "如何报考学校综合合录取评澳市评招生?" },
|
||||
{ content: "如何报考学校综合合录取评澳市评招生?" },
|
||||
{ content: "学校有新华专业?" },
|
||||
{ content: "学校有新华专业?" },
|
||||
{ content: "学校有新华专业?" },
|
||||
{ content: "学校有新华专业?" },
|
||||
{ content: "学校有新华专业?" },
|
||||
chatHistoryList3: [
|
||||
// {
|
||||
// "id": "今天",
|
||||
// "conversation": [
|
||||
// {
|
||||
// "title": "你好",
|
||||
// "id": "0d03f23c-9c5b-45ac-ae95-be51e9383a62",
|
||||
// "startTime": "2025-07-10T15:28:02.832316"
|
||||
// },
|
||||
// {
|
||||
// "title": "你知道今年的录取分数线吗",
|
||||
// "id": "771ab434-348c-4a35-bd03-adebc21436d8",
|
||||
// "startTime": "2025-07-10T15:11:32.885001"
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// "id": "周三",
|
||||
// "conversation": [
|
||||
// {
|
||||
// "title": "今天是周三",
|
||||
// "id": "0d03f23c-9c5b-45ac-ae95-be51e9383a62",
|
||||
// "startTime": "2025-07-09T15:28:02.832316"
|
||||
// },
|
||||
// {
|
||||
// "title": "你知道今年的录取分数线吗",
|
||||
// "id": "771ab434-348c-4a35-bd03-adebc21436d8",
|
||||
// "startTime": "2025-07-09T15:11:32.885001"
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
],
|
||||
activeIndex: 0,
|
||||
commonQuestions: [
|
||||
|
@ -352,57 +327,31 @@ export default {
|
|||
"我什么时候能推知道自己是否被录取?",
|
||||
],
|
||||
scrollToView: "",
|
||||
// 修改后的messageGroups数据结构
|
||||
messageGroups: [
|
||||
// {
|
||||
// time: "2025-07-01 10:00:00",
|
||||
// messages: [
|
||||
// { id: 1, content: "学校哪些专业比较好?", isUser: true },
|
||||
// {
|
||||
// id: 2,
|
||||
// content:
|
||||
// "我校有多个优势学科,包括计算机科学与技术、电子信息工程、机械工程、生物医学工程等。这些专业在国内都有较高的学术声誉和就业率。如果您对某个具体专业感兴趣,可以进一步咨询更多详情。",
|
||||
// isUser: false,
|
||||
// },
|
||||
// { id: 3, content: "计算机科学专业就业前景如何?", isUser: true },
|
||||
// {
|
||||
// id: 4,
|
||||
// content:
|
||||
// "计算机科学专业的就业前景非常好。根据最新数据,我校计算机专业毕业生就业率超过95%,平均起薪在全校名列前茅。主要就业方向包括互联网公司、IT企业、金融科技等领域,担任软件工程师、数据分析师、产品经理等职位。",
|
||||
// isUser: false,
|
||||
// },
|
||||
// ],
|
||||
// id: "9cac8661-bf09-4b63-ab15-1a0a36b921e0",
|
||||
// message: "你知道今年的录取分数线吗",
|
||||
// sendDate: "2025-07-10T15:11:32.886075",
|
||||
// isSend: true,
|
||||
// isRead: false,
|
||||
// interactMode: 0,
|
||||
// messageType: 0,
|
||||
// timeLabel: 1,
|
||||
// displayTime: "15:11",
|
||||
// },
|
||||
// {
|
||||
// time: "2025-07-02 09:15:36",
|
||||
// messages: [
|
||||
// { id: 5, content: "新生报到流程", isUser: true },
|
||||
// {
|
||||
// id: 6,
|
||||
// content:
|
||||
// "新生报到流程:个人信息完善 --预报到 -- 照片信息采集 --缴费 --入校验审 -- 人脸识别 --打印报到单",
|
||||
// isUser: false,
|
||||
// },
|
||||
// { id: 7, content: "预报到需要准备哪些材料?", isUser: true },
|
||||
// {
|
||||
// id: 8,
|
||||
// content:
|
||||
// "预报到需要准备以下材料:\n1. 身份证原件及复印件\n2. 录取通知书原件\n3. 2寸蓝底证件照4张\n4. 学籍档案(密封)\n5. 党团关系材料(如有)\n\n建议提前准备齐全,以便快速完成报到流程。",
|
||||
// isUser: false,
|
||||
// },
|
||||
// ],
|
||||
// id: "02306fc3-c821-4a23-ad66-0bd77d154105",
|
||||
// message:
|
||||
// "目前,2025年的录取分数线还没有正式公布,因为学校需要等招生工作结束后才会公布最终的录取分数线。不过,你可以参考2023-2024年的录取分数线作为大致的参考。\n\n如果你想知道具体专业的录取分数线,可以告诉我你所在省份和科类(历史类或物理类),我可以根据往年数据给你一些参考建议。如果需要更准确的信息,建议关注江西新能源科技职业学院的官网(www.jxnee.edu.cn)或者直接联系招生办(电话:0790-6764666/6765666)。",
|
||||
// sendDate: "2025-07-10T15:11:32.88644",
|
||||
// isSend: true,
|
||||
// isRead: false,
|
||||
// interactMode: 1,
|
||||
// messageType: 0,
|
||||
// timeLabel: 0,
|
||||
// displayTime: "",
|
||||
// },
|
||||
{
|
||||
time: "",
|
||||
messages: [
|
||||
// { id: 5, content: "新生报到流程", isUser: true },
|
||||
// {
|
||||
// id: 6,
|
||||
// content:
|
||||
// "新生报到流程:个人信息完善 --预报到 -- 照片信息采集 --缴费 --入校验审 -- 人脸识别 --打印报到单",
|
||||
// isUser: false,
|
||||
// },
|
||||
],
|
||||
},
|
||||
],
|
||||
scrollTop: 0,
|
||||
|
||||
|
@ -443,59 +392,15 @@ export default {
|
|||
});
|
||||
},
|
||||
methods: {
|
||||
// 测试Markdown渲染效果(仅开发阶段使用)
|
||||
testMarkdownRender() {
|
||||
const markdownSample = `# 这是标题
|
||||
|
||||
## 这是二级标题
|
||||
|
||||
这是**加粗文本**和*斜体文本*
|
||||
|
||||
> 这是引用文本
|
||||
|
||||
- 列表项1
|
||||
- 列表项2
|
||||
- 列表项3
|
||||
|
||||
\`\`\`javascript
|
||||
// 这是代码块
|
||||
function hello() {
|
||||
console.log('Hello World!');
|
||||
}
|
||||
\`\`\`
|
||||
|
||||
[这是链接](https://www.example.com)
|
||||
|
||||
| 表头1 | 表头2 |
|
||||
| ----- | ----- |
|
||||
| 内容1 | 内容2 |
|
||||
| 内容3 | 内容4 |
|
||||
`;
|
||||
|
||||
this.messageGroups[0].messages.push({
|
||||
id: this.messageGroups[0].messages.length + 1,
|
||||
content: "测试Markdown渲染",
|
||||
isUser: true,
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
this.messageGroups[0].messages.push({
|
||||
id: `test-${Date.now()}`,
|
||||
content: markdownSample,
|
||||
isUser: false,
|
||||
});
|
||||
}, 500);
|
||||
},
|
||||
|
||||
handleLeftClick() {
|
||||
this.$refs.uToast.show({
|
||||
title: "暂未开放",
|
||||
type: "warning",
|
||||
});
|
||||
this.$u.api.GetConversationPage().then((res) => {
|
||||
this.chatHistoryList3 = res.data;
|
||||
console.log("this.chatHistoryList3", this.chatHistoryList3);
|
||||
|
||||
return;
|
||||
this.popupShow = true;
|
||||
this.popupShow = true;
|
||||
});
|
||||
},
|
||||
|
||||
selectChatItem(index) {
|
||||
this.activeIndex = index;
|
||||
},
|
||||
|
@ -538,44 +443,121 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
// 修改发送消息的方法
|
||||
sendMessageFn() {
|
||||
if (!this.messageValue) {
|
||||
return;
|
||||
}
|
||||
|
||||
const sendMessage = this.messageValue;
|
||||
|
||||
console.log("发送消息", sendMessage);
|
||||
this.messageGroups[0].messages.push({
|
||||
id: this.messageGroups[0].messages.length + 1,
|
||||
content: sendMessage,
|
||||
isUser: true,
|
||||
});
|
||||
|
||||
// 创建新的用户消息对象
|
||||
const userMessage = {
|
||||
id: Math.random().toString(36).substring(2, 15),
|
||||
message: sendMessage,
|
||||
sendDate: "",
|
||||
isSend: true,
|
||||
isRead: false,
|
||||
interactMode: 0, // 用户消息
|
||||
messageType: 0,
|
||||
timeLabel: 0,
|
||||
displayTime: "",
|
||||
};
|
||||
|
||||
// 添加到消息列表
|
||||
this.messageGroups.push(userMessage);
|
||||
this.messageValue = "";
|
||||
|
||||
this.$u.api
|
||||
.SendMessageApi({
|
||||
query: sendMessage,
|
||||
conversationId: "",
|
||||
conversationId: this.currentConversationId,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("res.....", res);
|
||||
const data = res.data;
|
||||
|
||||
// 处理返回内容,确保Markdown格式正确
|
||||
let content = data.content;
|
||||
// 创建AI回复消息对象
|
||||
const aiMessage = {
|
||||
id:
|
||||
data.conversationId ||
|
||||
Math.random().toString(36).substring(2, 15),
|
||||
message: data.content,
|
||||
sendDate: "",
|
||||
isSend: true,
|
||||
isRead: false,
|
||||
interactMode: 1, // AI消息
|
||||
messageType: 0,
|
||||
timeLabel: 0,
|
||||
displayTime: "",
|
||||
};
|
||||
|
||||
// 如果返回的内容没有明确的Markdown格式,可以根据需要进行一些简单处理
|
||||
// 例如:将换行符转换为Markdown换行
|
||||
// content = content.replace(/\n/g, "\n\n");
|
||||
// 添加到消息列表
|
||||
this.messageGroups.push(aiMessage);
|
||||
});
|
||||
},
|
||||
|
||||
this.messageGroups[0].messages.push({
|
||||
id: data.conversationId,
|
||||
content: content,
|
||||
isUser: false,
|
||||
// 格式化时间的辅助方法
|
||||
formatTime(date) {
|
||||
const hours = date.getHours().toString().padStart(2, "0");
|
||||
const minutes = date.getMinutes().toString().padStart(2, "0");
|
||||
return `${hours}:${minutes}`;
|
||||
},
|
||||
|
||||
// 处理选中的对话
|
||||
handleSelectConversation(data) {
|
||||
// 关闭弹窗
|
||||
this.popupShow = false;
|
||||
|
||||
console.log("选中的对话:", data);
|
||||
// 根据conversationId加载对应的对话内容
|
||||
const conversationId = data.conversationId;
|
||||
|
||||
this.currentConversationId = conversationId;
|
||||
|
||||
this.isChat = true;
|
||||
|
||||
this.messageGroups = [];
|
||||
|
||||
this.$u.api
|
||||
.GetConversationDetail({
|
||||
"Item1.Id": conversationId,
|
||||
PageIndex: "1",
|
||||
PageSize: "20",
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("GetConversationDetail.....", res.item2);
|
||||
|
||||
// 将消息按sendDate升序排列,时间相同时用户消息(interactMode=0)排在前面
|
||||
this.messageGroups = res.item2.sort((a, b) => {
|
||||
const timeA = new Date(a.sendDate).getTime();
|
||||
const timeB = new Date(b.sendDate).getTime();
|
||||
|
||||
// 如果时间相同,按interactMode排序(0排在前,1排在后)
|
||||
if (timeA === timeB) {
|
||||
return a.interactMode - b.interactMode;
|
||||
}
|
||||
|
||||
// 否则按时间升序排列
|
||||
return timeA - timeB;
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
handleCreateConversation() {
|
||||
// 关闭弹窗
|
||||
this.popupShow = false;
|
||||
this.isChat = true;
|
||||
this.currentConversationId = "";
|
||||
this.messageGroups = [];
|
||||
},
|
||||
|
||||
handleStartChat() {
|
||||
this.isChat = true;
|
||||
this.currentConversationId = "";
|
||||
this.messageGroups = [];
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -331,27 +331,27 @@ export default {
|
|||
|
||||
// 登录
|
||||
login() {
|
||||
const res = {
|
||||
data: {
|
||||
// token:
|
||||
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOiJBZG1pbiIsIlVzZXJJbmZvIjoie1wiSWRcIjpcImI1MjY5ZWQxLTViYzgtMTFmMC05YTg5LTAwMTYzZTJkMmRkM1wiLFwiTmFtZVwiOlwi6J-56ICB5biIXCIsXCJQaG9uZU51bWJlclwiOlwiMTM1ODg4ODg4ODhcIixcIlNleFwiOjEsXCJBY2NvdW50VHlwZVwiOjJ9IiwibmJmIjoxNzUyMTE4ODU0LCJleHAiOjE3NTIyMDUyNTR9.aF0Q-X3ebIld7RIKMMW68tXjmmR4OO08dXLAtHWuuwc",
|
||||
token:
|
||||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOiJVc2VyIiwiVXNlckluZm8iOiJ7XCJJZFwiOlwiNTljNzIxNmMtMTRhZS00NmRmLTkxYTItNGYzMjFlZjM2YjQ5XCIsXCJOYW1lXCI6XCIxNzMzNTM3NDg4N1wiLFwiUGhvbmVOdW1iZXJcIjpcIjE3MzM1Mzc0ODg3XCIsXCJTZXhcIjoyLFwiQWNjb3VudFR5cGVcIjowfSIsIm5iZiI6MTc1MjExMDcwOSwiZXhwIjoxNzUyMTk3MTA5fQ.VDv2KjGq3s3BbZxZjB3P-BaeDU_1vIdqFEWGGvdpIxU",
|
||||
},
|
||||
};
|
||||
// const res = {
|
||||
// data: {
|
||||
// // token:
|
||||
// // "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOiJBZG1pbiIsIlVzZXJJbmZvIjoie1wiSWRcIjpcImI1MjY5ZWQxLTViYzgtMTFmMC05YTg5LTAwMTYzZTJkMmRkM1wiLFwiTmFtZVwiOlwi6J-56ICB5biIXCIsXCJQaG9uZU51bWJlclwiOlwiMTM1ODg4ODg4ODhcIixcIlNleFwiOjEsXCJBY2NvdW50VHlwZVwiOjJ9IiwibmJmIjoxNzUyMTE4ODU0LCJleHAiOjE3NTIyMDUyNTR9.aF0Q-X3ebIld7RIKMMW68tXjmmR4OO08dXLAtHWuuwc",
|
||||
// token:
|
||||
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOiJVc2VyIiwiVXNlckluZm8iOiJ7XCJJZFwiOlwiNTljNzIxNmMtMTRhZS00NmRmLTkxYTItNGYzMjFlZjM2YjQ5XCIsXCJOYW1lXCI6XCIxNzMzNTM3NDg4N1wiLFwiUGhvbmVOdW1iZXJcIjpcIjE3MzM1Mzc0ODg3XCIsXCJTZXhcIjoyLFwiQWNjb3VudFR5cGVcIjowfSIsIm5iZiI6MTc1MjExMDcwOSwiZXhwIjoxNzUyMTk3MTA5fQ.VDv2KjGq3s3BbZxZjB3P-BaeDU_1vIdqFEWGGvdpIxU",
|
||||
// },
|
||||
// };
|
||||
|
||||
const token = res.data.token;
|
||||
// 解析获取用户信息
|
||||
const userInfo = getUserInfoFromJWT(token);
|
||||
// 保存登录后得到的用户数据
|
||||
this.$u.vuex("vuex_token", token);
|
||||
this.$u.vuex("vuex_user", userInfo);
|
||||
// const token = res.data.token;
|
||||
// // 解析获取用户信息
|
||||
// const userInfo = getUserInfoFromJWT(token);
|
||||
// // 保存登录后得到的用户数据
|
||||
// this.$u.vuex("vuex_token", token);
|
||||
// this.$u.vuex("vuex_user", userInfo);
|
||||
|
||||
// 跳转至首页
|
||||
uni.reLaunch({
|
||||
url: "/pages/home/index/index",
|
||||
});
|
||||
return;
|
||||
// // 跳转至首页
|
||||
// uni.reLaunch({
|
||||
// url: "/pages/home/index/index",
|
||||
// });
|
||||
// return;
|
||||
|
||||
// 校验手机号
|
||||
if (!this.validatePhone()) {
|
||||
|
|
|
@ -14,5 +14,5 @@ export default {
|
|||
'/pages/login/recognitionResult/recognitionFailed'
|
||||
],
|
||||
//登录页
|
||||
loginPage:"/pages/login/login/login"
|
||||
loginPage:"/pages/login/login/index"
|
||||
}
|
|
@ -1,56 +1,58 @@
|
|||
import config from "./config.js"
|
||||
const initApp = function(vm) {
|
||||
/**
|
||||
* 页面跳转拦截器
|
||||
*/
|
||||
let that = vm;
|
||||
let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
|
||||
list.forEach(item => { //用遍历的方式分别为,uni.navigateTo,uni.redirectTo,uni.reLaunch,uni.switchTab这4个路由方法添加拦截器
|
||||
uni.addInterceptor(item, {
|
||||
invoke(e) { // 调用前拦截
|
||||
//获取用户的token
|
||||
// console.log(e)
|
||||
const token = that.vuex_token,
|
||||
//获取要跳转的页面路径(url去掉"?"和"?"后的参数)
|
||||
url = e.url.split('?')[0];
|
||||
let notNeed = config.whiteList.includes(url)
|
||||
// 如果在whiteList里面就不需要登录
|
||||
// console.log(notNeed)
|
||||
import config from "./config.js";
|
||||
const initApp = function (vm) {
|
||||
/**
|
||||
* 页面跳转拦截器
|
||||
*/
|
||||
let that = vm;
|
||||
let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
|
||||
list.forEach((item) => {
|
||||
//用遍历的方式分别为,uni.navigateTo,uni.redirectTo,uni.reLaunch,uni.switchTab这4个路由方法添加拦截器
|
||||
uni.addInterceptor(item, {
|
||||
invoke(e) {
|
||||
// 调用前拦截
|
||||
//获取用户的token
|
||||
// console.log(e)
|
||||
const token = that.vuex_token,
|
||||
//获取要跳转的页面路径(url去掉"?"和"?"后的参数)
|
||||
url = e.url.split("?")[0];
|
||||
let notNeed = config.whiteList.includes(url);
|
||||
// 如果在whiteList里面就不需要登录
|
||||
// console.log(notNeed)
|
||||
|
||||
if (notNeed) {
|
||||
return e
|
||||
} else {
|
||||
//需要登录
|
||||
if (token == '') {
|
||||
// uni.showToast({
|
||||
// title: '请先登录',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// uni.navigateTo({
|
||||
// url: config.loginPage
|
||||
// })
|
||||
uni.navigateTo({
|
||||
url: '/'
|
||||
})
|
||||
return false
|
||||
} else {
|
||||
return e
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
fail(err) { // 失败回调拦截
|
||||
console.log(err)
|
||||
// if (Debug) {
|
||||
// uni.showModal({
|
||||
// content: JSON.stringify(err),
|
||||
// showCancel: false
|
||||
// });
|
||||
// }
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
if (notNeed) {
|
||||
return e;
|
||||
} else {
|
||||
//需要登录
|
||||
if (token == "") {
|
||||
// uni.showToast({
|
||||
// title: '请先登录',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// uni.navigateTo({
|
||||
// url: config.loginPage
|
||||
// })
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/login/index",
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
// 失败回调拦截
|
||||
console.log(err);
|
||||
// if (Debug) {
|
||||
// uni.showModal({
|
||||
// content: JSON.stringify(err),
|
||||
// showCancel: false
|
||||
// });
|
||||
// }
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
export default {
|
||||
initApp: initApp
|
||||
}
|
||||
initApp: initApp,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue