用户登录问题修改
This commit is contained in:
		
							parent
							
								
									e94ea40959
								
							
						
					
					
						commit
						3370b734a2
					
				| 
						 | 
				
			
			@ -9,7 +9,6 @@ import { saveAs } from 'file-saver'
 | 
			
		|||
import { encryptCBC, decryptCBC } from '@/utils/aescbc'
 | 
			
		||||
import { CONFIG } from '@/utils/configure'
 | 
			
		||||
import { hashWithSM3AndSalt } from '@/utils/sm'
 | 
			
		||||
import data from '@/views/system/dict/data.vue'
 | 
			
		||||
 | 
			
		||||
//let token = localStorage.getItem("tokens");
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -199,32 +199,32 @@ export function validateNewPassword(rule, value, callback) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
function containsConsecutiveCharacters(password, maxConsecutive) {
 | 
			
		||||
  let count = 1; // 初始化计数器
 | 
			
		||||
  let previousChar = ""; // 保存上一个字符
 | 
			
		||||
 | 
			
		||||
  let count = 1 // 初始化计数器
 | 
			
		||||
  let previousChar = '' // 保存上一个字符
 | 
			
		||||
  maxConsecutive = maxConsecutive + 1
 | 
			
		||||
  for (let i = 0; i < password.length; i++) {
 | 
			
		||||
    // 检查当前字符与前一个字符是否相同
 | 
			
		||||
    if (password[i] === previousChar) {
 | 
			
		||||
      count++; // 计数器加1
 | 
			
		||||
      count++ // 计数器加1
 | 
			
		||||
    } else {
 | 
			
		||||
      count = 1; // 如果字符不同,重置计数器
 | 
			
		||||
      count = 1 // 如果字符不同,重置计数器
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 检查是否超过最大连续字符数
 | 
			
		||||
    if (count > maxConsecutive) {
 | 
			
		||||
      return true;
 | 
			
		||||
      return true
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 检查当前字符是否是数字
 | 
			
		||||
    if (/\d/.test(password[i])) {
 | 
			
		||||
      // 检查是否有超过指定数量的连续数字
 | 
			
		||||
      if (i > 0 && password[i] === password[i - 1]) {
 | 
			
		||||
        count++; // 计数器加1
 | 
			
		||||
        count++ // 计数器加1
 | 
			
		||||
        if (count > maxConsecutive) {
 | 
			
		||||
          return true;
 | 
			
		||||
          return true
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        count = 1; // 重置计数器
 | 
			
		||||
        count = 1 // 重置计数器
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -232,18 +232,18 @@ function containsConsecutiveCharacters(password, maxConsecutive) {
 | 
			
		|||
    if (/[a-zA-Z]/.test(password[i])) {
 | 
			
		||||
      // 检查是否有超过指定数量的连续字母
 | 
			
		||||
      if (i > 0 && password[i] === password[i - 1]) {
 | 
			
		||||
        count++; // 计数器加1
 | 
			
		||||
        count++ // 计数器加1
 | 
			
		||||
        if (count > maxConsecutive) {
 | 
			
		||||
          return true;
 | 
			
		||||
          return true
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        count = 1; // 重置计数器
 | 
			
		||||
        count = 1 // 重置计数器
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    previousChar = password[i]; // 更新上一个字符
 | 
			
		||||
    previousChar = password[i] // 更新上一个字符
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return false; // 如果没有找到问题,则返回符合要求的提示
 | 
			
		||||
  return false // 如果没有找到问题,则返回符合要求的提示
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue