Browse Source

Merge branch 'feature/dev_party_mange' of http://121.42.41.42:7070/r/epmet-oper-gov into feature/dev_party_mange

shibei_master
zhaoyongnian 3 years ago
parent
commit
18c881957a
  1. 22
      src/utils/validate.js
  2. 4
      src/views/main-shuju/main-content.vue

22
src/utils/validate.js

@ -2,38 +2,40 @@
* 邮箱
* @param {*} s
*/
export function isEmail (s) {
return /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s)
export function isEmail(s) {
return /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(
s
);
}
/**
* 手机号码
* @param {*} s
*/
export function isMobile (s) {
return /^1[0-9]{10}$/.test(s)
export function isMobile(s) {
return /^1[0-9]{10}$/.test(s);
}
/**
* 电话号码
* @param {*} s
*/
export function isPhone (s) {
return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s)
export function isPhone(s) {
return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s);
}
/**
* URL地址
* @param {*} s
*/
export function isURL (s) {
return /^http[s]?:\/\/.*/.test(s)
export function isURL(s) {
return /^http[s]?:\/\/.*/.test(s) || /^\/\/.*/.test(s);
}
/**
* 身份证
* @param {*} s
*/
export function isCard (s) {
return /^(\d{15}$)|(^\d{17}([0-9]|X)$)/.test(s)
export function isCard(s) {
return /^(\d{15}$)|(^\d{17}([0-9]|X)$)/.test(s);
}

4
src/views/main-shuju/main-content.vue

@ -61,8 +61,8 @@ export default {
// "&customerId=" +
// localStorage.getItem("customerId");
return /^http[s]?:\/\/.*/.test(url) || /^\/\/.*/.test(url);
// return isURL(url);
// return /^http[s]?:\/\/.*/.test(url);
return isURL(url);
},
// tabs, tab
tabSelectedHandle(tab) {

Loading…
Cancel
Save