Selaa lähdekoodia

关联二维码设置有效期

wgl 4 vuotta sitten
vanhempi
commit
9ea90228f2

+ 1 - 1
src/projects/pension/router/master.js

@@ -295,7 +295,7 @@ const routesMaster = [
 				],
 			},
 
-			//关联亲属
+			//我的亲属
 			{
 				path: 'relatives',
 				component: () => import('../views/Layout.vue'),

+ 1 - 1
src/projects/pension/views/Master/Relatives/Home.vue

@@ -42,7 +42,7 @@
 		},
 		data() {
 			return {
-				pageTitle: '关联亲属',
+				pageTitle: '我的亲属',
 
 				isLoading: false,
 

+ 6 - 1
src/projects/pension/views/Master/User/MyCode.vue

@@ -38,6 +38,10 @@
 		convertCanvasToImage,
 	} from '$project/utils'
 	import QRCode from 'qrcodejs2'
+	import {
+		currentTimeStamp,
+		parseUnixTime
+	} from '$project/utils'
 	export default {
 		name: 'MasterUserMyCode',
 		components: {
@@ -58,7 +62,8 @@
 		},
 		created() {
 			var host = window.location.href.split("#")[0];
-			this.qrCodeUrl = host + '#/master/user/relationPersonRegister?id=' + this.person_popedom.id;
+			this.qrCodeUrl = host + '#/master/user/relationPersonRegister?id=' + this.person_popedom.id + '&_t=' +
+				currentTimeStamp();
 		},
 		methods: {
 			//生成二维码

+ 12 - 1
src/projects/pension/views/Master/User/RelationPersonRegister.vue

@@ -42,6 +42,7 @@
 	} from 'vuex'
 	import {
 		checkPhone,
+		currentTimeStamp,
 	} from '$project/utils'
 	import * as types from '$project/store/mutation-types'
 	import * as WxJsApi from '$project/utils/wxJsApi'
@@ -67,11 +68,20 @@
 				},
 				sendMsgWz: '发送验证码',
 				isSendMsg: false,
+
+				_t: this.$route.query._t,
 			}
 		},
 		created() {
+			//验证验证码是否过期
+			if (this._t && currentTimeStamp() - this._t >= 30 * 60 * 1000) {
+				mui.alert('该二维码已过期');
+				this.$router.push({
+					name: 'Master'
+				})
+			}
 			if (this.person_data) {
-				//如果用户存在直接调用扫码功能
+				//如果用户存在,并且不是通过扫关联二维码进来的,则直接调用扫码功能
 				this.subForm.name = this.person_data.name;
 				this.subForm.telephone = this.person_data.phone;
 				if (!this.id) {
@@ -166,6 +176,7 @@
 				}
 			},
 			asynCallBack() {
+				//如果用户存在,并且是从关联二维码扫码进来的则跳转到填写关联信息页面
 				if (this.person_data && this.id) {
 					this.set_old_relation_form_data(this.subForm);
 					this.$router.push({