wangguoyu 5 månader sedan
förälder
incheckning
225089c4a2
2 ändrade filer med 16 tillägg och 2 borttagningar
  1. 10 2
      pages/study/index.vue
  2. 6 0
      utils/request.js

+ 10 - 2
pages/study/index.vue

@@ -142,7 +142,11 @@
 
 
 
-	function onLeft(event) {
+	function onLeft(event) {
+		const authCode = getUserIdentity();
+		if (authCode !== 'VIP') {
+			return false
+		}
 		console.log('用户左滑了');
 		let req = {
 			nianji: selectZhang.value.nianji,
@@ -164,7 +168,11 @@
 		})
 	}
 
-	function onRight(event) {
+	function onRight(event) {
+		const authCode = getUserIdentity();
+		if (authCode !== 'VIP') {
+			return false
+		}
 		console.log('用户又滑了');
 		let req = {
 			nianji: selectZhang.value.nianji,

+ 6 - 0
utils/request.js

@@ -50,6 +50,9 @@ const request = config => {
 				if (code === 401) {
 					showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
 						if (res.confirm) {
+							if(cacheManager.get(auth)){
+								cacheManager.clearAll()
+							}
 							uni.reLaunch({
 								url: '/pages/login/index'
 							})
@@ -59,6 +62,9 @@ const request = config => {
 				} else if (code === 405) {
 					showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
 						if (res.confirm) {
+							if(cacheManager.get(auth)){
+								cacheManager.clearAll()
+							}
 							uni.reLaunch({
 								url: '/pages/login/index'
 							})