aXin-0810 před 1 týdnem
rodič
revize
2f634f97f4
4 změnil soubory, kde provedl 83 přidání a 81 odebrání
  1. 0 3
      src/App.vue
  2. 8 6
      src/common/utils/util.js
  3. 72 72
      src/common/utils/verify.js
  4. 3 0
      src/main.js

+ 0 - 3
src/App.vue

@@ -11,12 +11,9 @@ import {
 } from '@/common/utils/util'
 import wx from 'weixin-js-sdk'
 import api from '@/common/http/'
-var getUserValTimeId = null
 import store from '@/store/index.js'
 export default {
   async onLaunch() {
-    this.$setStorage('realAuthUrl', window.location.href.split('#')[0])
-
     api
       .get('/user/user/log', {})
       .then(res => {})

+ 8 - 6
src/common/utils/util.js

@@ -1036,22 +1036,24 @@ export const wxConfig = function (configInfo, userInfo, cb, _url) {
         })
 
         wx.error(function (res) {
-          if (jishu < 60) {
+          if (jishu < 30) {
             jishu++
             setTimeout(function () {
               wxConfig(
                 configInfo,
                 userInfo,
                 cb,
-                jishu % 4 === 0
+                jishu % 5 === 0
                   ? window.location.href.split('#')[0]
-                  : jishu % 4 === 1
+                  : jishu % 5 === 1
                   ? getStorage('realAuthUrl')
-                  : jishu % 4 === 2
-                  ? `${process.env.VUE_APP_HREF}/pages/index/index?appid=${
+                  : jishu % 5 === 2
+                  ? getStorage('realAuthUrl2')
+                  : jishu % 5 === 3
+                  ? decodeURIComponent(getStorage('realAuthUrl2'))
+                  : `${process.env.VUE_APP_HREF}/pages/index/index?appid=${
                       getQueryVariable('appid') || getQueryVariable('appId')
                     }`
-                  : process.env.VUE_APP_HREF
               )
             }, 1000)
           } else {

+ 72 - 72
src/common/utils/verify.js

@@ -2,78 +2,78 @@
  * 验证类
  */
 module.exports = {
-	/**
-	 * 是否为空
-	 */
-	isEmpty(str) {
-		return str.trim() == '';
-	},
-	/**
-	 * 匹配2代身份证
-	 */
-	isIdCard(str){
-		return /^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}[\dXx]$/g.test(str);
-	},
-	/**
-	 * 匹配是否金额
-	 */
-	isMoney(str){
-		return /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(str);
-	},
-	/**
-	 * 匹配phone
-	 */
-	isPhone(str) {
-		let reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/;
-		return reg.test(str);
-	},
-	/**
-	 * 匹配6-32位密码 
-	 */
-	isPws(str) {
-		return /^.{6,32}$/.test(str);
-	},
-	/**
-	 * 匹配Email地址
-	 */
-	isEmail(str) {
-		if (str == null || str == "") return false;
-		var result = str.match(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/);
-		if (result == null) return false;
-		return true;
-	},
-	/**
-	 * 判断数值类型,包括整数和浮点数
-	 */
-	isNumber(str) {
-		if (this.isDouble(str) || this.isInteger(str)) return true;
-		return false;
-	},
+  /**
+   * 是否为空
+   */
+  isEmpty(str) {
+    return str.trim() == ''
+  },
+  /**
+   * 匹配2代身份证
+   */
+  isIdCard(str) {
+    return /^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}[\dXx]$/g.test(str)
+  },
+  /**
+   * 匹配是否金额
+   */
+  isMoney(str) {
+    return /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(str)
+  },
+  /**
+   * 匹配phone
+   */
+  isPhone(str) {
+    let reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/
+    return reg.test(str)
+  },
+  /**
+   * 匹配6-32位密码
+   */
+  isPws(str) {
+    return /^.{6,32}$/.test(str)
+  },
+  /**
+   * 匹配Email地址
+   */
+  isEmail(str) {
+    if (str == null || str == '') return false
+    var result = str.match(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/)
+    if (result == null) return false
+    return true
+  },
+  /**
+   * 判断数值类型,包括整数和浮点数
+   */
+  isNumber(str) {
+    if (this.isDouble(str) || this.isInteger(str)) return true
+    return false
+  },
 
-	/**
-	 * 判断是否为正整数(只能输入数字[0-9])
-	 */
-	isPositiveInteger(str) {
-		return /(^[0-9]\d*$)/.test(str);
-	},
+  /**
+   * 判断是否为正整数(只能输入数字[0-9])
+   */
+  isPositiveInteger(str) {
+    return /(^[0-9]\d*$)/.test(str)
+  },
 
-	/**
-	 * 匹配integer
-	 */
-	isInteger(str) {
-		if (str == null || str == "") return false;
-		var result = str.match(/^[-\+]?\d+$/);
-		if (result == null) return false;
-		return true;
-	},
+  /**
+   * 匹配integer
+   */
+  isInteger(str) {
+    if (str == null || str == '') return false
+    var result = str.match(/^[-\+]?\d+$/)
+    if (result == null) return false
+    return true
+  },
 
-	/**
-	 * 匹配double或float
-	 */
-	isDouble(str) {
-		if (str == null || str == "") return false;
-		var result = str.match(/^[-\+]?\d+(\.\d+)?$/);
-		if (result == null) return false;
-		return true;
-	},
-};
+  /**
+   * 匹配double或float
+   */
+  isDouble(str) {
+    if (str == null || str == '') return false
+    var result = str.match(/^[-\+]?\d+(\.\d+)?$/)
+    if (result == null) return false
+    return true
+  }
+}

+ 3 - 0
src/main.js

@@ -156,6 +156,9 @@ Vue.component('my-link', Mylink)
 // 渲染图片文件
 Vue.prototype.$imageUrl = process.env.VUE_APP_BASE_URL + process.env.VUE_APP_BASE_API + '/common/img/get?key='
 
+setStorage('realAuthUrl', window.location.href.split('#')[0])
+setStorage('realAuthUrl2', encodeURIComponent(window.location.href))
+
 import { translaBeforeRegistration } from './global-text-processor' // 导入插件
 Vue.prototype.$setLanguage = function (type) {
   window.localStorage.setItem('Vue_Translation_Of_Text_Type', type)