Skip to content

Commit

Permalink
change password validation rules
Browse files Browse the repository at this point in the history
  • Loading branch information
DARREN-ZHANG committed Sep 20, 2019
1 parent aeb2604 commit 3ccd7ee
Showing 4 changed files with 8 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@
<v-card-actions class="pa-5">
<v-spacer></v-spacer>
<v-btn
:disabled = "!isAccountValid"
:disabled = !isAccountValid
color="primary"
block
@click="createAccount"
@@ -255,7 +255,7 @@
const validation = {
"validcode_required": "请输入验证码",
"pwd_too_short": "密码必须至少包含12位字符",
"pwd_too_short": "密码必须至少包含12位字符,且包含一个数字、大写字母、小写字母和特殊字符",
"pwd_number": "密码必须至少包含一个数字、大写字母、小写字母和特殊字符",
"pwd_number_simple": "密码必须至少包含一个数字、大写字母和小写字母",
"pwd_strength": "密码强度:%s",
@@ -324,7 +324,7 @@
passwordRules: [
value => !!value || validation.pwd_required,
value => value.length >= 12 || validation.pwd_too_short,
value => (/[0-9]{1,}/g.test(value) && /[a-z]{1,}/g.test(value) && /[A-Z]{1,}/g.test(value)) || validation.pwd_number_simple
value => (/[a-z0-9]{1,}/g.test(value) && /[a-z]{1,}/g.test(value) && /[A-Z]{1,}/g.test(value) && /[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]{1,}/g.test(value)) || validation.pwd_number
],
validcodeRules: [
value => !!value || validation.validcode_required
@@ -382,6 +382,7 @@
// }
// return true;
// },
async refreshCaptcha() {
if (this.autoRefresh) {
clearTimeout(this.autoRefresh);
@@ -393,6 +394,7 @@
let s = await this.verify_code();
this.verifyCode = s;
},
async verify_code() {
if (!navigator.onLine) {
throw new Error(`UN.network.verify_code`)
1 change: 1 addition & 0 deletions src/ecc/src/PrivateKey.js
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ const { sha256, sha512 } = require('./hash');
const PublicKey = require('./PublicKey');
const deepEqual = require("deep-equal");
const assert = require("assert");
const ByteBuffer = require('bytebuffer');

const secp256k1 = getCurveByName('secp256k1');
const {G, n} = secp256k1;
1 change: 1 addition & 0 deletions src/ecc/src/PublicKey.js
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ const { encode, decode } = require('bs58');
const { sha256, sha512, ripemd160 } = require('./hash');
const deepEqual = require("deep-equal");
const assert = require("assert");
const ByteBuffer = require('bytebuffer');

const secp256k1 = getCurveByName('secp256k1');
const {G, n} = secp256k1;
1 change: 1 addition & 0 deletions src/ecc/src/signature.js
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ const {getCurveByName} = require('ecurve');
const assert = require("assert");
const BigInteger = require('bigi');
const PublicKey = require('./PublicKey');
const ByteBuffer = require('bytebuffer');

var secp256k1 = getCurveByName('secp256k1');

0 comments on commit 3ccd7ee

Please sign in to comment.