Harley %!s(int64=6) %!d(string=hai) anos
pai
achega
d63b37d1fd

+ 0 - 59
service/src/App.vue

@@ -229,65 +229,6 @@
 				receive.src = "../static/audio/receive.wav";
 				receive.play();
 			},
-
-			/*****************获取当前聊天用户信息****************/
-			get_user_info(type) {
-
-				let  getters = this.$store.getters;
-				//获取vuex数据
-				let session = getters.get_session;//会话列表
-				let offline  = getters.get_offline;//离线列表
-				let sessionType  = getters.get_type;//选择状态(会话/离线)
-				let dataIndex  = getters.get_num;//列表下标
-				let current_session  = getters.get_current;//当前会话
-				let session_name  = getters.get_session_name;//当前用户名
-
-
-					// _this.$store.dispatch("SET_CURRENT",list);//当前会话数据
-					// 	_this.$store.dispatch("SET_SESSION_NAME",name);//当前会话对象名
-					// 	_this.$store.dispatch("SET_NUM",index);
-					// 	_this.$store.dispatch("SET_TYPE",type);
-					// 	_this.$store.dispatch("SET_SESSION",session);
-					// 	_this.$store.dispatch("SET_OFFLINE",offline);
-				if (type.length > 0) {
-					// this.session_user_info = {};
-					if (dataIndex <= type.length) {
-
-						let obj = {
-							headers: {
-								"apiToken": this.$md5('accountInfo' + "customer-service" + 'service' + this.time[0] + 'service'),
-								'userToken': this.token
-							},
-							account_id: type[dataIndex].id
-						};
-
-						this.post('api' + this.$ports.userInfo.accountInfo, obj).then(res => {
-							if (res.data.code == 1) {
-								// console.log(res.data.data);
-								// this.session_user_info = res.data.data;
-								this.$store.dispatch("SET_SESSSION_USER",res.data.data)
-								// console.log(this.options);
-								// for (let i = 0; this.options.length > i; i++) {
-								// 	if (this.options[i].id == res.data.data.label_id) {
-								// 		this.value = this.options[i].name;
-								// 	}
-								// 	break;
-								// }
-								//this.value = res.data.data.label_id
-							}
-						})
-
-
-						//this.session_user_info = type[this.dataIndex].id;
-						// console.log(type[this.dataIndex].id);
-						// this.value = this.session_user_info.label;
-					}
-				} else {
-					// this.session_user_info = {};
-					this.$store.dispatch("SET_SESSSION_USER",{})
-				}
-			},
-
 			/***************************************/
 			//socket重连
 			reconnect(){

+ 1 - 1
service/src/components/hader.vue

@@ -107,7 +107,7 @@
 				this.$websocket.close();
 				this.$socket_open = false;
 				this.$token = '';
-				this.$router.push('/login')
+				this.$router.push({path:'/login',query: { pid:escape("~!@#¥%……&*()——+,./;'[]") }})
 			},
 
 			/**************************************/

+ 1 - 1
service/src/components/leftNav.vue

@@ -74,7 +74,7 @@
 
 				this.$store.dispatch("SET_NAVSTATE", str);
 				// this.$store.dispatch("SET_DRAWER",false);
-				this.$router.push(path);
+				this.$router.push({path,query: { pid:escape("~!@#¥%……&*()——+,./;'[]") }});
 			}
 		},
 		// computed: {

+ 1 - 1
service/src/pages/FastReply.vue

@@ -387,7 +387,7 @@
 					}else{
 						this.succeed(2)
 					}
-					console.log(res)
+					//console.log(res)
 				})
 			}
 		},

+ 8 - 10
service/src/pages/PersonalInformation.vue

@@ -66,15 +66,15 @@
                 <div style="margin-left:200px">
                   <div>
                     <p class="title_text">昵称</p>
-                    <input class="text_input" v-model="user_info.user_name" type="text" />
+                    <input class="text_input" readonly  v-model="user_info.user_name" type="text" />
                   </div>
                   <div>
                     <p class="title_text">手机</p>
-                    <input class="text_input" v-model="user_info.phone" type="text" />
+                    <input class="text_input" readonly v-model="user_info.phone" type="text" />
                   </div>
                   <div>
                     <p class="title_text">邮箱</p>
-                    <input class="text_input" v-model="user_info.user_email" type="text" />
+                    <input class="text_input" readonly  v-model="user_info.user_email" type="text" />
                   </div>
                 </div>
               </div>
@@ -83,17 +83,17 @@
                   <div style="width:84px;">
                    <p class="title_text">个性签名</p>
                   </div>
-                  <input style="width:400px;height:40px;" v-model="user_info.signature" type="text"/>
+                  <input style="width:400px;height:40px;" readonly  v-model="user_info.signature" type="text"/>
                 </div>
-                <div @click="save_user_info()" class="user_btn">
+                <!-- <div @click="save_user_info()" class="user_btn">
                   <span>保存</span>
-                </div>
+                </div> -->
               </div>
             </div>
           </div>
 
           <!-- 密码模块 -->
-          <div class="userInfo">
+          <!-- <div class="userInfo">
             <div class="row item-center user_head" >密码设置</div>
             <div class="userInfoBox" >
               <div class="password_style">
@@ -101,7 +101,6 @@
                   <div class="title_text">
                     <span>原密码</span>
                   </div>
-                  <!-- @blur=" " -->
                   <div>
                     <input class="text_input"  v-model="originalPwd"   type="password" />
                     <span v-if="errorPwdState == 1" style="margin-left:10px;color:#f60">原密码不能未空</span>
@@ -126,7 +125,6 @@
                       <input class="text_input" v-model="confirmPwd" type="password" />
                       <span v-if="errorPwdState ==2" style="margin-left: 10px;color:#f60">两次输入的新密码不相等,请重新输入</span>
                     </div>
-                    <!-- <span v-if="errorTo.affirmPasswordInfoB" style="color:#f60">请先输入密码再确认</span> -->
                   </div>
                    <div @click="change_password()" class="row center" style="width:80px;height: 40px;background:rgba(83,153,245,1);color: #fff;border-radius:5px;">
                     <span>修改</span>
@@ -134,7 +132,7 @@
                 </div>
               </div>
             </div>
-          </div>
+          </div> -->
         </div>
       </div>
     </div>

+ 122 - 124
service/src/pages/TheCurrentSession.vue

@@ -32,7 +32,7 @@
 							<template slot="title">
 								<span>已离线<span>({{offlineList.length }})</span></span>
 							</template>
-							<div :class="{session_choose:dataIndex ==index &&  sessionType ==2}"
+							<div :class="{session_choose:dataIndex == index &&  sessionType ==2}"
 								 class="user session_style" @click="chooseDialogue(2,index)"
 								 v-for="(item,index) in offlineList">
 								<div class="row allAlignment item-center">
@@ -240,8 +240,8 @@
 					<div style="color:#666;font-weight:bold;font-size:14px;">访问信息</div>
 					<div style="margin-top:10px;color:#999;font-size:14px;" class="userData wrap">
 						<!-- <p>来源:{{session_user_info.website}}</p>  -->
-						<p @dblclick="get_ip_Info" class="get_ip" :data-clipboard-text="session_user_info.ip" >IP地址:{{session_user_info.ip}}</p>
-						<p>来源终端:{{session_user_info.system}}-{{session_user_info.browse}}</p>
+						<p @dblclick="get_ip_Info" class="get_ip" :data-clipboard-text="terminal_IP.ip" >IP地址:{{terminal_IP.ip}}</p>
+						<p>来源终端:{{terminal_IP.system}}</p>
 					</div>
 
 					<div style="color:#666;font-weight:bold;font-size:14px; margin-top:30px;">用户信息</div>
@@ -330,20 +330,14 @@
 				inputValue: "", //输入框内容
 				isFrce: false, //表情包开关
 				frceArr: [], //表情包数组
-				// data: [], //当前对话数据
-				// dataIndex:0,//定位当前会话,默认是0
 				FastReply: "", //快捷回复
 				FastReplySwitch: "one", //快捷回复开关
 				user_info: '',//用户信息
 				token: "",
 				time: "",
-				// sessionList: [],//会话列表
-				// offlineList: [],//离线列表
 				transferList: [],//转接列表
-				// sessionType:1,//选择列表状态默认未1(1是会话中,2是离线)
 				lineUp: [],//排队列表
 				conversationId: '',//会话工单
-				// sessionName:'',//当前会话用户名字
 				session_user_info: {},//当前会话用户信息
 				img_http:'http://kfadmin.bocai186.com',//图片路径域
 				// img_http: 'http://192.168.2.187:8090',//图片路径域
@@ -364,7 +358,8 @@
 				dialogImageUrl: '', // 放大的图片
 				dialogUrl: false,
 				pasteUrl:'',//截屏图片
-				// fit:'contain',//
+				userSwitching:true,//是否切换完成
+				terminal_IP:{},//访客设备信息
 			}
 		},
 		/**
@@ -408,47 +403,17 @@
 				//用户离线后会话窗口切换
 				if (redata.message_type == "userClose") {
 					console.log(redata)
-					// let _this = this;
-					// let arr = [
-					// 	redata.data,
-					// 	this.sessionList,
-					// 	this.offlineList,
-					// 	this.sessionType,
-					// 	this.dataIndex,
-					// 	this.sessionName,
-					// 	this.data
-					// ]
-					// _this.$public.userOffline(arr, function (session, offline, type, index, name, list, userInfo) {
-					// 	this.$store.dispatch("SET_CURRENT", list);//当前会话数据
-					// 	_this.$store.dispatch("SET_NUM", index);
-					// 	_this.$store.dispatch("SET_TYPE", type);
-					// 	_this.$store.dispatch("SET_SESSION", session);
-					// 	_this.$store.dispatch("SET_OFFLINE", offline);
-					// 	_this.get_user_info(userInfo);
-					// })
 				}
 
 				// //用户会话结束窗口切换
-				// if (redata.message_type == "delUser") {
-				// 	let _this = this;
-				// 	let arr = [
-				// 		redata.data,
-				// 		this.sessionList,
-				// 		this.offlineList,
-				// 		this.sessionType,
-				// 		this.dataIndex,
-				// 		this.sessionName,
-				// 		this.data
-				// 	]
-				// 	_this.$public.sessionEnd(arr, function (session, offline, type, index, name, list, userInfo) {
-				// 		_this.$store.dispatch("SET_CURRENT", list);//当前会话数据
-				// 		_this.$store.dispatch("SET_NUM", index);
-				// 		_this.$store.dispatch("SET_TYPE", type);
-				// 		_this.$store.dispatch("SET_SESSION", session);
-				// 		_this.$store.dispatch("SET_OFFLINE", offline);
-				// 		_this.get_user_info(userInfo);
-				// 	})
-				// }
+				if (redata.message_type == "delUser") {
+					redata.data ;
+					console.log(redata.data,this.session_user_info)
+					if(redata.data.id == this.session_user_info.id){
+						this.session_user_info={};
+						this.value = '请选择';
+					}
+				}	
 
 
 				//获取标签数据信息
@@ -456,7 +421,7 @@
 					if (Object.values(redata.data).length > 0) {
 						this.options = [];
 						this.options = Object.values(redata.data);
-						this.value = this.options[0].name;
+						// this.value = this.options[0].name;
 					}
 
 				}
@@ -615,23 +580,31 @@
 
 			/*****************切换用户会话对象******************/
 			chooseDialogue(type, index) {
-				let data = [];
-				this.$store.dispatch("SET_TYPE", type);
-				this.$store.dispatch("SET_NUM", index);
-				if (type == 1) {
-					data = this.sessionList[index].data;
-					this.session_user_info = this.sessionList[index];
-					this.$set(this.sessionList[index], 'num', 0);
-					this.$store.dispatch("SET_SESSION_NAME", this.sessionList[index].name);
-				} else if (type == 2) {
-					data = this.offlineList[index].data;
-					this.$store.dispatch("SET_SESSION_NAME", this.offlineList[index].name);
-					this.session_user_info = this.offlineList[index];
+				console.log(this.sessionList);
+				if(this.userSwitching){
+					let data = [];
+					let order_id =  '';
+					this.$store.dispatch("SET_TYPE", type);
+					this.$store.dispatch("SET_NUM", index);
+					if (type == 1) {
+						data = this.sessionList[index].data;
+						order_id = this.sessionList[index].id;
+						this.$set(this.sessionList[index], 'num', 0);
+						this.$store.dispatch("SET_SESSION_NAME", this.sessionList[index].name);
+					} else if (type == 2) {
+						data = this.offlineList[index].data;
+						this.$store.dispatch("SET_SESSION_NAME", this.offlineList[index].name);
+						order_id = this.offlineList[index].id;
+					}
+					this.$store.dispatch("SET_CURRENT", data);//当前会话数据
+					this.userSwitching =false;
+					this.get_user(order_id)
+				}else{
+					this.$message({
+						message: '警告!,操作太频繁',
+						type: 'warning'
+					});
 				}
-				this.$store.dispatch("SET_CURRENT", data);//当前会话数据
-
-				// this.value  = this.session_user_info.label;
-				//console.log(this.session_user_info);
 			},
 
 			/***************关闭当前和用户聊天对话***************/
@@ -787,6 +760,8 @@
 						conversationId: this.sessionList[this.dataIndex].conversationId,
 						to_id: this.sessionList[this.dataIndex].id,
 					}
+					this.sessionList[this.dataIndex].isEva =10;
+					this.$store.dispatch("SET_SESSION",this.sessionList); 
 					this.websocketsend(JSON.stringify({type, data}));
 					this.is_eva_btn = true;
 				} else if (this.sessionType == 2) {
@@ -829,44 +804,24 @@
 
 			},
 
-			// /*****************获取当前聊天用户信息****************/
-			// get_user_info(type) {
-			// 	if (type.length > 0) {
-			// 		this.session_user_info = {};
-			// 		if (this.dataIndex <= type.length) {
-
-			// 			let obj = {
-			// 				headers: {
-			// 					"apiToken": this.$md5('accountInfo' + "customer-service" + 'service' + this.time[0] + 'service'),
-			// 					'userToken': this.token
-			// 				},
-			// 				account_id: type[this.dataIndex].id
-			// 			};
-
-			// 			this.post('api' + this.$ports.userInfo.accountInfo, obj).then(res => {
-			// 				if (res.data.code == 1) {
-			// 					// console.log(res.data.data);
-			// 					this.session_user_info = res.data.data;
-			// 					// console.log(this.options);
-			// 					for (let i = 0; this.options.length > i; i++) {
-			// 						if (this.options[i].id == res.data.data.label_id) {
-			// 							this.value = this.options[i].name;
-			// 						}
-			// 						break;
-			// 					}
-			// 					//this.value = res.data.data.label_id
-			// 				}
-			// 			})
-
-
-			// 			//this.session_user_info = type[this.dataIndex].id;
-			// 			// console.log(type[this.dataIndex].id);
-			// 			// this.value = this.session_user_info.label;
-			// 		}
-			// 	} else {
-			// 		this.session_user_info = {};
-			// 	}
-			// },
+			/*****************获取当前聊天用户信息****************/
+			get_user(id) {
+				let obj = {
+					headers: {
+						"apiToken": this.$md5('accountInfo' + "customer-service" + 'service' + this.time[0] + 'service'),
+						'userToken': this.token
+					},
+					account_id: id
+				};
+
+				this.post('api' + this.$ports.userInfo.accountInfo, obj).then(res => {
+					if (res.data.code == 1) {
+						this.session_user_info = res.data.data;
+						this.value = res.data.data.label
+						this.userSwitching = true;
+					}
+				})
+			},
 
 			/********************获取配置信息********************/
 			get_config_info() {
@@ -1033,7 +988,55 @@
 				// 释放内存
 				clipboard.destroy()
 				})
+			},
+			/****************访问信息和评价状态***************/
+			accessTerminal(data){
+				if(this.sessionType == 1){
+					let List = this.sessionList[this.dataIndex];
+					if(data == 'eva'){
+						if(!List) return false
+						console.log(List);
+						if(List.isEva == 10 ){
+							this.is_eva_btn = true;
+						}else if(List.isEva != 10){
+							if (this.data.length > this.trigger_condition){
+								List.isEva = 100;
+								this.is_eva_btn = false;
+							}else{
+								this.is_eva_btn = true;
+							}
+						}
+						this.sessionList[this.dataIndex] = List
+						this.$store.dispatch("SET_SESSION",this.sessionList)
+					}else{
+						if(List){
+							this.terminal_IP = {
+								system:List.system+'-'+List.browse,
+								ip:List.ip 
+							}	
+						}else{
+							this.terminal_IP ={}
+						}
+					}
+				}else if(this.sessionType == 2){
+					let List = this.offlineList[this.dataIndex];
+					// if(data == 'eva'){
+					// 	if (this.data.length > this.trigger_condition){
+					// 		List.isEva = 100;
+					// 	}
+					// }else{
+						if(List){
+							this.terminal_IP = {
+								system:List.system+'-'+List.browse,
+								ip:List.ip 
+							}	
+						}else{
+							this.terminal_IP ={}
+						}
+					// }
+				}
 			}
+
 		},
 		/**
 		 * 挂载前执行
@@ -1067,6 +1070,15 @@
 			this.frceArr = this.$frce;
 			//调用截图粘贴捆绑方法
 			this.paste();
+			//
+			this.accessTerminal();
+		
+			//
+			if(this.sessionList.length > 0){
+				if(this.sessionList[this.dataIndex].isEva == 100 && this.sessionList[this.dataIndex]){
+					this.is_eva_btn = false;
+				}
+			}
 			
 		},
 		beforeDestroy(){
@@ -1081,33 +1093,18 @@
 				this.chatMessage(e)
 			},
 
-			get_session_user(e){
-				console.log(e)
+			sessionList(e){
+				this.accessTerminal(e)
+			},
+			offlineList(e){
+				this.accessTerminal(e)
 			},
 			
 			/*****************评价按钮显示隐藏处理*****************/
 			get_is_eva_btn(data) {
-				if (this.sessionType != 2) {
-					if (this.data.length > this.trigger_condition) {
-						if (!this.data[this.dataIndex].isEva) {
-							//   this.is_eva_btn = true;
-							// }else{
-							this.data[this.dataIndex].isEva = true;
-							this.is_eva_btn = false;
-						}
-					} else {
-						this.is_eva_btn = true;
-					}
-				} else {
-					this.is_eva_btn = true;
-				}
+				this.accessTerminal('eva')
 			}
 		},
-	// _this.$store.dispatch("SET_SESSION", list);
-	// 					_this.$store.dispatch("SET_OFFLINE", offline);
-	// 					_this.$store.dispatch("SET_TYPE", type);//选择类型(会话/离线)
-	// 					_this.$store.dispatch("SET_NUM", num);//列表下标
-	// 					_this.$store.dispatch("SET_CURRENT", dataList);//当前会话数
 		/**
 		 * 计算属性
 		 */
@@ -1120,6 +1117,7 @@
 				dataIndex:'get_num',
 				sessionType:'get_type',
 				get_user_info:'get_session_user',
+				// is_eva_btn:'get_is_eva_btn',
 			}),
 
 			get_session_message() {

+ 5 - 1
service/src/pages/login.vue

@@ -73,7 +73,10 @@
 								this.$store.dispatch("SET_USER",res.data.data.user);
 								this.$store.dispatch("SET_IS_INIT",true);
 								Vue.prototype.$token = res.data.data.user.token;
-								this.$router.push('/')
+								this.$router.push({
+									path:'/',
+									query: { pid:escape("~!@#¥%……&*()——+,./;'[]") }
+								})
 							}else{
 								this.$notify({
 									title: "错误",
@@ -164,6 +167,7 @@
 		top:0;
 		bottom: 0;
 		margin:auto 0;
+		height: 55%;
 	}
 	.boxData input{
 		width: 100%;

+ 5 - 2
service/src/router/index.js

@@ -54,9 +54,12 @@ const routers = new Router({
 //路由守卫
 routers.beforeEach((to, from, next) => { 
   let token = Vue.prototype.$token;
-  if(to.fullPath !='/login'){
+  if(to.path !='/login'){
     if(!token){
-      routers.push({path:'/login'})
+      routers.push({
+        path:'/login',
+        query: { pid:escape("~!@#¥%……&*()——+,./;'[]") }
+      })
     }
   }
   next();