From 82be1991acab9b8d15c78fb6e2d6e9d9069074fa Mon Sep 17 00:00:00 2001
From: cshenfu <men883234@gmail.com>
Date: 星期五, 02 六月 2023 14:09:58 +0800
Subject: [PATCH] add cliend_id

---
 pages/mine/mine.vue      |    5 
 pages/index/write.vue    |  100 ++++++++++--
 pages/index/chat.vue     |  124 +++++++++++++-
 pages/index/home.vue     |    1 
 common/config.js         |    4 
 pages/index/question.vue |   89 +++++++++-
 pages/index/index.vue    |  128 ++++++++++++++-
 7 files changed, 385 insertions(+), 66 deletions(-)

diff --git a/common/config.js b/common/config.js
index 427e785..a329b3b 100755
--- a/common/config.js
+++ b/common/config.js
@@ -3,8 +3,8 @@
   // ws: 'ws://192.168.0.104:7272',  // 鏈湴socket
 	// base_url: 'https://newgpt.nauzone.cn',
 	// ws: 'wss://newgpt.nauzone.cn/wss',
-	base_url: 'http://ai.shsening.com',
-	ws: 'ws://ai.shsening.com/wss',
+	base_url: 'https://ai.shsening.com',
+	ws: 'wss://ai.shsening.com/wss',
 	official_accounts_appid: 'wxa447f988edc97797'
 }
 
diff --git a/pages/index/chat.vue b/pages/index/chat.vue
index fd7290c..023e3ff 100755
--- a/pages/index/chat.vue
+++ b/pages/index/chat.vue
@@ -122,6 +122,7 @@
 		mixins: [mixin],
 		data() {
 			return {
+				client_id: "",
 				prompt: '',
 				arr: [],
 				timer: null,
@@ -183,19 +184,58 @@
 			});
 			uni.onSocketMessage(function(res) {
 				// console.log('鏀跺埌鏈嶅姟鍣ㄥ唴瀹癸細' + res.data);
-				let json = JSON.parse(res.data)
+				let json = JSON.parse(res.data);
 				// console.log(json)
-				if (json.hasOwnProperty('id')) {
-					that.typeingId = json.id
-					if (!json.choices[0].delta.finish_reason) {
-						if (json.choices[0].delta.hasOwnProperty('content')) {
-							that.typeingText += json.choices[0].delta.content
-							// 姝ゅ鑷鏂熼厡鏄惁鏇挎崲
-							// that.typeingText = that.typeingText.replace(/[cogptn]+/ig, "ChatGLM-6B")
+				if (json.hasOwnProperty('type') && json.type == 'content') {
+					that.typeingText = json.content;
+					that.$nextTick(() => {
+						uni.pageScrollTo({
+							scrollTop: 20000,
+							duration: 100
+						});
+					});
+				}
+				if (json.hasOwnProperty('client_id') && json.client_id != '') {
+					console.log('鏇存柊id')
+					that.client_id = json.client_id
+				}
+			
+				if (json.status == 200) {
+					if (json.msg == '杩炴帴鎴愬姛') {
+						uni.sendSocketMessage({
+							data: JSON.stringify({
+								type: 'login',
+								uid: that.userInfo.member_id
+								// uid: 3
+							})
+						})
+					}
+					if (json.type == 'content') {
+						that.loading = false;
+						that.typeingText = "";
+						that.typeingId = "";
+						that.arr.push({
+							role: json.content.role,
+							content: json.content.content,
+						});
+						if (!that.chat_id) {
+							that.chat_id = json.content.chat_id
+							that.chatList[0].chat_id = json.content.chat_id
+							that.chatList[0].title = json.content.content
 						}
+						if (json.content.finish_reason == 'length') {
+							that.goon = true;
+						}
+						that.$store.commit('useNum', 1);
+						that.$nextTick(() => {
+							uni.pageScrollTo({
+								scrollTop: 20000,
+								duration: 100
+							});
+						});
 					}
 				}
-
+			
 			});
 			// socket鏂紑鏃堕�氱煡鍚庣鏀瑰彉鐧诲綍鐘舵��
 			uni.onSocketClose(function(res) {
@@ -334,14 +374,32 @@
 					this.$failToast("璇疯緭鍏ュ唴瀹�");
 					return;
 				}
-
+			
 				this.loading = true;
+				if (!this.client_id) {
+					let userInfo = uni.getStorageSync('userInfo')
+					uni.sendSocketMessage({
+						data: JSON.stringify({
+							type: 'login',
+							uid: userInfo.member_id,
+							// uid: 3
+						}),
+						success: (r) => {
+							setTimeout(() => {
+								this.sendout()
+							}, 300)
+						}
+					})
+					return
+				}
+			
 				this.arr.push({
 					role: 'user',
 					content: this.prompt,
 					message_id: this.arr.length + 1
 				});
 				let message = this.prompt;
+			
 				this.prompt = ""
 				this.$nextTick(() => {
 					uni.pageScrollTo({
@@ -354,12 +412,14 @@
 				}, 200);
 			},
 			sub(message) {
+				this.goon = false;
 				// 鏉′欢缂栬瘧澶勭悊锛宧5绔痷ni.request涓巗ocket浼氫簰鐩搁樆濉�
 				// #ifndef H5
 				this.$request("/api/Message/sendV2", "POST", {
 					message: message,
 					chat_id: this.chat_id,
-					model_id: this.now_model.assistant_id
+					model_id: this.now_model.assistant_id,
+					client_id: this.client_id
 					// member_id: 3 // 璋冭瘯涔嬬敤锛岀嚎涓婄幆澧冧负token瑙g爜
 				}).then((res) => {
 					console.log(res);
@@ -378,6 +438,9 @@
 							this.chatList[0].title = message
 							this.chat_id = res.data.chat_id
 						}
+						if (res.data.finish_reason == 'length') {
+							this.goon = true;
+						}
 						this.$store.commit('useNum', 1);
 						this.$nextTick(() => {
 							uni.pageScrollTo({
@@ -393,6 +456,13 @@
 						uni.showModal({
 							content: res.msg
 						})
+					} else if (res.status == 403) {
+						this.loading = false;
+						this.$failToast(res.msg);
+						this.arr.pop()
+						this.prompt = res.data
+					} else if (res.status == 600) {
+			
 					} else {
 						this.loading = false;
 						this.$failToast(res.msg);
@@ -410,7 +480,8 @@
 					data: {
 						message: message,
 						chat_id: this.chat_id,
-						model_id: this.now_model.assistant_id
+						model_id: this.now_model.assistant_id,
+						client_id: this.client_id
 					},
 					headers: {
 						'content-type': 'application/x-www-form-urlencoded;charset=utf-8',
@@ -419,6 +490,23 @@
 				}).then(response => {
 					console.log(response)
 					let res = response.data
+					if (res.status == 101 || res.status == 102 || (res.status == 411 && res.msg == '璇风櫥褰�')) {
+						console.log(1)
+						this.$store.commit('logout')
+						uni.removeStorageSync('userInfo')
+						uni.removeStorageSync('token')
+						uni.showModal({
+							title: "鎻愮ず",
+							content: res.msg,
+							success() {
+								uni.reLaunch({
+									url: "/pages/login/newlogin"
+								})
+							}
+						})
+						uni.hideLoading()
+						return
+					}
 					if (res.status == 200) {
 						this.loading = false;
 						this.typeingText = "";
@@ -431,6 +519,9 @@
 							this.chatList[0].chat_id = res.data.chat_id
 							this.chatList[0].title = message
 							this.chat_id = res.data.chat_id
+						}
+						if (res.data.finish_reason == 'length') {
+							this.goon = true;
 						}
 						this.$store.commit('useNum', 1);
 						this.$nextTick(() => {
@@ -447,6 +538,13 @@
 						uni.showModal({
 							content: res.msg
 						})
+					} else if (res.status == 403) {
+						this.loading = false;
+						this.$failToast(res.msg);
+						this.arr.pop()
+						this.prompt = res.data
+					} else if (res.status == 600) {
+			
 					} else {
 						this.loading = false;
 						this.$failToast(res.msg);
@@ -455,7 +553,7 @@
 					// reject(error);
 				});
 				// #endif
-
+			
 			},
 			copy(item) {
 				uni.setClipboardData({
diff --git a/pages/index/home.vue b/pages/index/home.vue
index 55ab615..3354816 100755
--- a/pages/index/home.vue
+++ b/pages/index/home.vue
@@ -96,6 +96,7 @@
 		mixins: [mixin],
 		data() {
 			return {
+				client_id: "",
 				showTab: false,
 				tabIndex: 0,
 				setting_data:'null',
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 4d60ef5..5244757 100755
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -78,6 +78,7 @@
 	export default {
 		data() {
 			return {
+				client_id: "",
 				prompt: '',
 				arr: [],
 				timer: null,
@@ -138,19 +139,56 @@
 			});
 			uni.onSocketMessage(function(res) {
 				// console.log('鏀跺埌鏈嶅姟鍣ㄥ唴瀹癸細' + res.data);
-				let json = JSON.parse(res.data)
+				let json = JSON.parse(res.data);
 				// console.log(json)
-				if (json.hasOwnProperty('id')) {
-					that.typeingId = json.id
-					if (!json.choices[0].delta.finish_reason) {
-						if (json.choices[0].delta.hasOwnProperty('content')) {
-							that.typeingText += json.choices[0].delta.content
-							// 姝ゅ鑷鏂熼厡鏄惁鏇挎崲
-							// that.typeingText = that.typeingText.replace(/[cogptn]+/ig, "ChatGLM-6B")
+				if (json.hasOwnProperty('type') && json.type == 'content') {
+					that.typeingText = json.content;
+					that.$nextTick(() => {
+						uni.pageScrollTo({
+							scrollTop: 20000,
+							duration: 100
+						});
+					});
+				}
+				if (json.hasOwnProperty('client_id') && json.client_id != '') {
+					console.log('鏇存柊id')
+					that.client_id = json.client_id
+				}
+			
+				if (json.status == 200) {
+					if (json.msg == '杩炴帴鎴愬姛') {
+						uni.sendSocketMessage({
+							data: JSON.stringify({
+								type: 'login',
+								uid: that.userInfo.member_id
+								// uid: 3
+							})
+						})
+					}
+					if (json.type == 'content') {
+						that.loading = false;
+						that.typeingText = "";
+						that.typeingId = "";
+						that.arr.push({
+							role: json.content.role,
+							content: json.content.content,
+						});
+						if (!that.chat_id) {
+							that.chat_id = json.content.chat_id
 						}
+						if (json.content.finish_reason == 'length') {
+							that.goon = true;
+						}
+						that.$store.commit('useNum', 1);
+						that.$nextTick(() => {
+							uni.pageScrollTo({
+								scrollTop: 20000,
+								duration: 100
+							});
+						});
 					}
 				}
-
+			
 			});
 			// socket鏂紑鏃堕�氱煡鍚庣鏀瑰彉鐧诲綍鐘舵��
 			uni.onSocketClose(function(res) {
@@ -219,8 +257,24 @@
 					this.$failToast("璇疯緭鍏ュ唴瀹�");
 					return;
 				}
-
+			
 				this.loading = true;
+				if (!this.client_id) {
+					let userInfo = uni.getStorageSync('userInfo')
+					uni.sendSocketMessage({
+						data: JSON.stringify({
+							type: 'login',
+							uid: userInfo.member_id,
+							// uid: 3
+						}),
+						success: (r) => {
+							setTimeout(() => {
+								this.sendout()
+							}, 300)
+						}
+					})
+					return
+				}
 				this.arr.push({
 					role: 'user',
 					content: this.prompt,
@@ -239,12 +293,14 @@
 				}, 200);
 			},
 			sub(message) {
+				this.goon = false;
 				// 鏉′欢缂栬瘧澶勭悊锛宧5绔痷ni.request涓巗ocket浼氫簰鐩搁樆濉�
 				// #ifndef H5
 				this.$request("/api/Message/sendV2", "POST", {
 					message: message,
 					chat_id: this.chat_id,
-					model_id: this.now_model.assistant_id
+					model_id: this.now_model.assistant_id,
+					client_id: this.client_id
 					// member_id: 3 // 璋冭瘯涔嬬敤锛岀嚎涓婄幆澧冧负token瑙g爜
 				}).then((res) => {
 					console.log(res);
@@ -254,12 +310,15 @@
 						this.typeingId = "";
 						this.arr.push({
 							role: res.data.role,
-							// 姝ゅ鑷鏂熼厡鏄惁鏇挎崲
 							content: res.data.content,
-							// content: res.data.content.replace(/[cogptn]+/ig, "ChatGLM-6B")
 						});
 						if (!this.chat_id) {
+							this.chatList[0].chat_id = res.data.chat_id
+							this.chatList[0].title = message
 							this.chat_id = res.data.chat_id
+						}
+						if (res.data.finish_reason == 'length') {
+							this.goon = true;
 						}
 						this.$store.commit('useNum', 1);
 						this.$nextTick(() => {
@@ -276,6 +335,13 @@
 						uni.showModal({
 							content: res.msg
 						})
+					} else if (res.status == 403) {
+						this.loading = false;
+						this.$failToast(res.msg);
+						this.arr.pop()
+						this.prompt = res.data
+					} else if (res.status == 600) {
+			
 					} else {
 						this.loading = false;
 						this.$failToast(res.msg);
@@ -293,15 +359,35 @@
 					data: {
 						message: message,
 						chat_id: this.chat_id,
-						model_id: this.now_model.assistant_id
+						model_id: this.now_model.assistant_id,
+						client_id: this.client_id
 					},
 					headers: {
 						'content-type': 'application/x-www-form-urlencoded;charset=utf-8',
 						'Authorization': this.$store.state.token
 					}
 				}).then(response => {
+			
 					console.log(response)
 					let res = response.data
+					console.log(res)
+					if (res.status == 101 || res.status == 102 || (res.status == 411 && res.msg == '璇风櫥褰�')) {
+						console.log(1)
+						this.$store.commit('logout')
+						uni.removeStorageSync('userInfo')
+						uni.removeStorageSync('token')
+						uni.showModal({
+							title: "鎻愮ず",
+							content: res.msg,
+							success() {
+								uni.reLaunch({
+									url: "/pages/login/newlogin"
+								})
+							}
+						})
+						uni.hideLoading()
+						return
+					}
 					if (res.status == 200) {
 						this.loading = false;
 						this.typeingText = "";
@@ -311,7 +397,12 @@
 							content: res.data.content
 						});
 						if (!this.chat_id) {
+							this.chatList[0].chat_id = res.data.chat_id
+							this.chatList[0].title = message
 							this.chat_id = res.data.chat_id
+						}
+						if (res.data.finish_reason == 'length') {
+							this.goon = true;
 						}
 						this.$store.commit('useNum', 1);
 						this.$nextTick(() => {
@@ -328,6 +419,13 @@
 						uni.showModal({
 							content: res.msg
 						})
+					} else if (res.status == 403) {
+						this.loading = false;
+						this.$failToast(res.msg);
+						this.arr.pop()
+						this.prompt = res.data
+					} else if (res.status == 600) {
+			
 					} else {
 						this.loading = false;
 						this.$failToast(res.msg);
@@ -336,7 +434,7 @@
 					// reject(error);
 				});
 				// #endif
-
+			
 			},
 			copy(item) {
 				uni.setClipboardData({
diff --git a/pages/index/question.vue b/pages/index/question.vue
index c68e7af..339555f 100755
--- a/pages/index/question.vue
+++ b/pages/index/question.vue
@@ -49,6 +49,7 @@
 		mixins: [mixin],
 		data() {
 			return {
+				client_id: "",
 				hot_question: [],
 				answer: defaultAnswer,
 				answerStatus: 0, // 0 鏄粯璁ょ姸鎬侊紝1鏄敓鎴愪腑锛�2鏄凡鐢熸垚
@@ -94,20 +95,39 @@
 			});
 			uni.onSocketMessage(function(res) {
 				// console.log('鏀跺埌鏈嶅姟鍣ㄥ唴瀹癸細' + res.data);
-				let json = JSON.parse(res.data)
+				let json = JSON.parse(res.data);
 				// console.log(json)
-				if (json.hasOwnProperty('id')) {
-					if (that.answerStatus != 1) {
-						that.answer = ""
-						that.answerStatus = 1;
+				if (json.hasOwnProperty('type') && json.type == 'content') {
+					that.answer = json.content;
+				}
+				if (json.hasOwnProperty('client_id') && json.client_id != '') {
+					console.log('鏇存柊id')
+					that.client_id = json.client_id
+				}
+				
+				if (json.status == 200) {
+					if (json.msg == '杩炴帴鎴愬姛') {
+						uni.sendSocketMessage({
+							data: JSON.stringify({
+								type: 'login',
+								uid: userInfo.member_id
+								// uid: 3
+							})
+						})
 					}
-					that.typeingId = json.id
-					if (!json.choices[0].delta.finish_reason) {
-						if (json.choices[0].delta.hasOwnProperty('content')) {
-							that.answer += json.choices[0].delta.content
-							// 姝ゅ鑷鏂熼厡鏄惁鏇挎崲
-							// that.typeingText = that.typeingText.replace(/[cogptn]+/ig, "ChatGLM-6B")
+					if (json.type == 'content') {
+						that.answerStatus = 2;
+						that.answer = json.content.content
+						if (json.content.finish_reason == 'length') {
+							that.goon = true;
 						}
+						that.$store.commit('useNum', 1);
+						that.$nextTick(() => {
+							uni.pageScrollTo({
+								scrollTop: 20000,
+								duration: 100
+							});
+						});
 					}
 				}
 			
@@ -153,6 +173,22 @@
 					this.$failToast("璇疯緭鍏ュ唴瀹�");
 					return;
 				}
+				if (!this.client_id) {
+					let userInfo = uni.getStorageSync('userInfo')
+					uni.sendSocketMessage({
+						data: JSON.stringify({
+							type: 'login',
+							uid: userInfo.member_id,
+							// uid: 3
+						}),
+						success: (r) => {
+							setTimeout(() => {
+								this.submit()
+							}, 300)
+						}
+					})
+					return
+				}
 				
 				this.answer = answerIng;
 				this.sub()
@@ -160,8 +196,10 @@
 			sub(message) {
 				// 鏉′欢缂栬瘧澶勭悊锛宧5绔痷ni.request涓巗ocket浼氫簰鐩搁樆濉�
 				// #ifndef H5
-				this.$request("/api/Message/completions", "POST", {
+				this.$request("/api/Message/sendV2", "POST", {
 					message: this.prompt,
+					client_id: this.client_id,
+					type: 'question'
 				}).then((res) => {
 					console.log(res);
 					if (res.status == 200) {
@@ -184,6 +222,8 @@
 						uni.showModal({
 							content: res.msg
 						})
+					} else if(res.status == 600) {
+						
 					} else {
 						this.loading = false;
 						this.$failToast(res.msg);
@@ -197,9 +237,11 @@
 				// #ifdef H5
 				axios({
 					method: 'post',
-					url: setting.base_url + "/api/Message/completions",
+					url: setting.base_url + "/api/Message/sendV2",
 					data: {
 						message: this.prompt,
+						client_id: this.client_id,
+						type: 'question'
 					},
 					headers: {
 						'content-type': 'application/x-www-form-urlencoded;charset=utf-8',
@@ -208,10 +250,27 @@
 				}).then(response => {
 					console.log(response)
 					let res = response.data
+					if (res.status == 101 || res.status == 102 || (res.status == 411 && res.msg == '璇风櫥褰�')) {
+						console.log(1)
+						this.$store.commit('logout')
+						uni.removeStorageSync('userInfo')
+						uni.removeStorageSync('token')
+						uni.showModal({
+							title: "鎻愮ず",
+							content: res.msg,
+							success() {
+								uni.reLaunch({
+									url: "/pages/login/newlogin"
+								})
+							}
+						})
+						uni.hideLoading()
+						return
+					}
 					if (res.status == 200) {
 						this.answerStatus = 2;
 						setTimeout(() => {
-							this.answer = res.data
+							this.answer = res.data.content
 						}, 500);
 						this.$store.commit('useNum', 1);
 						this.$nextTick(() => {
@@ -228,6 +287,8 @@
 						uni.showModal({
 							content: res.msg
 						})
+					} else if(res.status == 600) {
+						
 					} else {
 						this.loading = false;
 						this.$failToast(res.msg);
diff --git a/pages/index/write.vue b/pages/index/write.vue
index 86d5ad0..63486be 100755
--- a/pages/index/write.vue
+++ b/pages/index/write.vue
@@ -87,6 +87,7 @@
 				answer: defaultAnswer,
 				answerStatus: 0, // 0 鏄粯璁ょ姸鎬侊紝1鏄敓鎴愪腑锛�2鏄凡鐢熸垚
 				desc: "",
+				client_id: "",
 				title: "",
 				showTab: false,
 				tabIndex: 0
@@ -129,23 +130,42 @@
 			});
 			uni.onSocketMessage(function(res) {
 				// console.log('鏀跺埌鏈嶅姟鍣ㄥ唴瀹癸細' + res.data);
-				let json = JSON.parse(res.data)
+				let json = JSON.parse(res.data);
 				// console.log(json)
-				if (json.hasOwnProperty('id')) {
-					if (that.answerStatus != 1) {
-						that.answer = ""
-						that.answerStatus = 1;
+				if (json.hasOwnProperty('type') && json.type == 'content') {
+					that.answer = json.content;
+				}
+				if (json.hasOwnProperty('client_id') && json.client_id != '') {
+					console.log('鏇存柊id')
+					that.client_id = json.client_id
+				}
+				
+				if (json.status == 200) {
+					if (json.msg == '杩炴帴鎴愬姛') {
+						uni.sendSocketMessage({
+							data: JSON.stringify({
+								type: 'login',
+								uid: userInfo.member_id
+								// uid: 3
+							})
+						})
 					}
-					that.typeingId = json.id
-					if (!json.choices[0].delta.finish_reason) {
-						if (json.choices[0].delta.hasOwnProperty('content')) {
-							that.answer += json.choices[0].delta.content
-							// 姝ゅ鑷鏂熼厡鏄惁鏇挎崲
-							// that.typeingText = that.typeingText.replace(/[cogptn]+/ig, "ChatGLM-6B")
+					if (json.type == 'content') {
+						that.answerStatus = 2;
+						that.answer = json.content.content
+						if (json.content.finish_reason == 'length') {
+							that.goon = true;
 						}
+						that.$store.commit('useNum', 1);
+						that.$nextTick(() => {
+							uni.pageScrollTo({
+								scrollTop: 20000,
+								duration: 100
+							});
+						});
 					}
 				}
-
+			
 			});
 			// socket鏂紑鏃堕�氱煡鍚庣鏀瑰彉鐧诲綍鐘舵��
 			uni.onSocketClose(function(res) {
@@ -188,16 +208,35 @@
 					this.$failToast("璇疯緭鍏ュ唴瀹�");
 					return;
 				}
-
+				
+				if (!this.client_id) {
+					let userInfo = uni.getStorageSync('userInfo')
+					uni.sendSocketMessage({
+						data: JSON.stringify({
+							type: 'login',
+							uid: userInfo.member_id,
+							// uid: 3
+						}),
+						success: (r) => {
+							setTimeout(() => {
+								this.submit()
+							}, 300)
+						}
+					})
+					return
+				}
+			
 				this.answer = answerIng;
 				this.sub()
 			},
 			sub(message) {
 				// 鏉′欢缂栬瘧澶勭悊锛宧5绔痷ni.request涓巗ocket浼氫簰鐩搁樆濉�
 				// #ifndef H5
-				this.$request("/api/Message/write", "POST", {
+				this.$request("/api/Message/sendV2", "POST", {
 					title: this.title,
 					desc: this.desc,
+					client_id: this.client_id,
+					type: 'write'
 				}).then((res) => {
 					console.log(res);
 					if (res.status == 200) {
@@ -214,23 +253,27 @@
 						uni.showModal({
 							content: res.msg
 						})
+					} else if(res.status == 600) {
+						
 					} else {
-						this.loading = false;
+						this.answerStatus = 2;
 						this.$failToast(res.msg);
 					}
 				}).catch(err => {
 					console.log(err)
-					this.loading = false;
+					this.answerStatus = 2;
 					this.$failToast(err.errMsg);
 				})
 				// #endif
 				// #ifdef H5
 				axios({
 					method: 'post',
-					url: setting.base_url + "/api/Message/write",
+					url: setting.base_url + "/api/Message/sendV2",
 					data: {
 						title: this.title,
 						desc: this.desc,
+						client_id: this.client_id,
+						type: 'write'
 					},
 					headers: {
 						'content-type': 'application/x-www-form-urlencoded;charset=utf-8',
@@ -239,10 +282,27 @@
 				}).then(response => {
 					console.log(response)
 					let res = response.data
+					if (res.status == 101 || res.status == 102 || (res.status == 411 && res.msg == '璇风櫥褰�')) {
+						console.log(1)
+						this.$store.commit('logout')
+						uni.removeStorageSync('userInfo')
+						uni.removeStorageSync('token')
+						uni.showModal({
+							title: "鎻愮ず",
+							content: res.msg,
+							success() {
+								uni.reLaunch({
+									url: "/pages/login/newlogin"
+								})
+							}
+						})
+						uni.hideLoading()
+						return
+					}
 					if (res.status == 200) {
 						this.answerStatus = 2;
 						setTimeout(() => {
-							this.answer = res.data
+							this.answer = res.data.content
 						}, 500);
 						this.$store.commit('useNum', 1);
 						
@@ -254,8 +314,10 @@
 						uni.showModal({
 							content: res.msg
 						})
+					} else if(res.status == 600) {
+						
 					} else {
-						this.loading = false;
+						this.answerStatus = 2;
 						this.$failToast(res.msg);
 					}
 				}).catch(error => {
diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue
index 7ec7338..ea4fd38 100755
--- a/pages/mine/mine.vue
+++ b/pages/mine/mine.vue
@@ -75,8 +75,8 @@
 				</view>
 			</view>
 			
-			<!-- #ifndef MP-WEIXIN -->
-			<view v-show="isPC" @click="logout" class="flex item align-center">
+		
+			<view @click="logout" class="flex item align-center">
 				<u-icon name="/static/icon/quit.png" size="18"></u-icon>
 				<view class="flex align-center justify-between solid-bottom margin-left-sm">
 					<view class="title">閫�鍑虹櫥褰�</view>
@@ -85,7 +85,6 @@
 					</view>
 				</view>
 			</view>
-			<!-- #endif -->
 			<!-- #ifdef MP-WEIXIN -->
 			<button open-type="share" class="flex item align-center">
 				<u-icon name="/static/icon/mine-share.png" size="18"></u-icon>

--
Gitblit v1.9.1