From 66b565577ad073aa7bcb5a2a3a2be4e4648247b9 Mon Sep 17 00:00:00 2001 From: linju Date: Wed, 7 Sep 2022 14:38:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uni-id-pages/changelog.md | 12 + uni_modules/uni-id-pages/common/password.js | 30 +- uni_modules/uni-id-pages/config.js | 23 +- .../pages/login/login-withoutpwd.vue | 3 + .../pages/register/register-by-email.vue | 7 +- .../uni-id-pages/pages/register/register.vue | 7 +- .../uni-id-pages/pages/userinfo/userinfo.vue | 448 +++++++++--------- 7 files changed, 247 insertions(+), 283 deletions(-) diff --git a/uni_modules/uni-id-pages/changelog.md b/uni_modules/uni-id-pages/changelog.md index 9d10c85..210fd1b 100644 --- a/uni_modules/uni-id-pages/changelog.md +++ b/uni_modules/uni-id-pages/changelog.md @@ -1,3 +1,15 @@ +## 1.0.12(2022-09-07) +- 优化 适配pc端样式 +- 新增 邮箱验证码注册 +- 新增 邮箱验证码找回密码 +## 1.0.11(2022-09-01) +- 修复 iOS端,一键登录功能卡在showLoading的问题 +- 更新 合并密码强度与长度配置 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#config) +- uni-id-co 修复 调用 removeAuthorizedApp 接口报错的Bug +- uni-id-co 新增 管理端接口 updateUser [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#update-user) +- uni-id-co 调整 为兼容旧版本,未配置密码强度时提供最简单的密码规则校验(长度大于6即可) +- uni-id-co 调整 注册、登录时如果携带了token则尝试对此token进行登出操作 +- uni-id-co 调整 管理端接口 addUser 增加 mobile、email等参数 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#add-user) ## 1.0.10(2022-08-25) - 修复 导入uni-id-pages插件时未自动导入uni-open-bridge-common的Bug ## 1.0.9(2022-08-23) diff --git a/uni_modules/uni-id-pages/common/password.js b/uni_modules/uni-id-pages/common/password.js index 4944191..c3f677a 100644 --- a/uni_modules/uni-id-pages/common/password.js +++ b/uni_modules/uni-id-pages/common/password.js @@ -1,19 +1,8 @@ // 导入配置 import config from '@/uni_modules/uni-id-pages/config.js' -const passwordLength = config.password.length -const passwordStrength = config.password.strength +const {passwordStrength} = config -let minPasswordLength = 6 -let maxPasswordLength = 20 -if (passwordLength) { - if (passwordLength[0]) { - minPasswordLength = passwordLength[0] - } - if (passwordLength[1]) { - maxPasswordLength = passwordLength[1] - } -} // 密码强度表达式 const passwordRules = { // 密码必须包含大小写字母、数字和特殊符号 @@ -37,11 +26,6 @@ const ERROR = { strong: '密码必须包含字母、数字和特殊符号,密码长度必须在8-16位之间', medium: '密码必须为字母、数字和特殊符号任意两种的组合,密码长度必须在8-16位之间', weak: '密码必须包含字母,密码长度必须在6-16位之间' - }, - passwordLengthError: { - normal: '密码长度必须在' + minPasswordLength + '-' + maxPasswordLength + '位之间', - minLimit: '密码长度不得少于' + minPasswordLength + '位', - maxLimit: '密码长度不得超过' + maxPasswordLength + '位' } } @@ -52,16 +36,6 @@ function validPwd(password) { return ERROR.passwordStrengthError[passwordStrength] } } - //长度校验 - if (passwordLength) { - if (passwordLength[0] && password.length < passwordLength[0]) { - return ERROR.passwordLengthError.minLimit - } - if (passwordLength[1] && password.length > passwordLength[1]) { - return ERROR.passwordLengthError.maxLimit - } - } - return true } @@ -106,8 +80,6 @@ function getPwdRules(pwdName = 'password', rePwdName = 'password2') { export default { ERROR, - minPasswordLength, - maxPasswordLength, validPwd, getPwdRules } diff --git a/uni_modules/uni-id-pages/config.js b/uni_modules/uni-id-pages/config.js index 8d632d9..09fc92b 100644 --- a/uni_modules/uni-id-pages/config.js +++ b/uni_modules/uni-id-pages/config.js @@ -1,6 +1,6 @@ export default { //调试模式 - "debug": true, + "debug": false, /* 登录类型 未列举到的或运行环境不支持的,将被自动隐藏。 如果需要在不同平台有不同的配置,直接用条件编译即可 @@ -43,16 +43,13 @@ export default { "web": "xxxxxx" } }, - /** - * 密码强度 - * super(超强:密码必须包含大小写字母、数字和特殊符号) - * strong(强: 密码必须包含字母、数字和特殊符号) - * medium (中:密码必须为字母、数字和特殊符号任意两种的组合) - * weak(弱:密码必须包含字母) - * 为空或false则不验证密码强度 - */ - "password": { - "strength": "medium", - "length": [6, 20] //密码长度,默认在6-20位之间 - } + /** + * 密码强度 + * super(超强:密码必须包含大小写字母、数字和特殊符号,长度范围:8-16位之间) + * strong(强: 密密码必须包含字母、数字和特殊符号,长度范围:8-16位之间) + * medium (中:密码必须为字母、数字和特殊符号任意两种的组合,长度范围:8-16位之间) + * weak(弱:密码必须包含字母和数字,长度范围:6-16位之间) + * 为空或false则不验证密码强度 + */ + "passwordStrength":"medium" } diff --git a/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue b/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue index dba1be1..b58f78f 100644 --- a/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue +++ b/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue @@ -190,6 +190,9 @@ .quickLoginBtn { margin: 20px 0; width: 450rpx; + /* #ifndef APP-NVUE */ + max-width: 230px; + /* #endif */ height: 82rpx; } diff --git a/uni_modules/uni-id-pages/pages/register/register-by-email.vue b/uni_modules/uni-id-pages/pages/register/register-by-email.vue index 0c23930..1a34514 100644 --- a/uni_modules/uni-id-pages/pages/register/register-by-email.vue +++ b/uni_modules/uni-id-pages/pages/register/register-by-email.vue @@ -19,7 +19,7 @@ @@ -116,11 +116,6 @@ logo: "/static/logo.png" } }, - computed:{ - passwordLength(){ - return config.password.length - } - }, onReady() { this.$refs.form.setRules(this.rules) }, diff --git a/uni_modules/uni-id-pages/pages/register/register.vue b/uni_modules/uni-id-pages/pages/register/register.vue index 543afc4..abd1de1 100644 --- a/uni_modules/uni-id-pages/pages/register/register.vue +++ b/uni_modules/uni-id-pages/pages/register/register.vue @@ -19,7 +19,7 @@ @@ -67,11 +67,6 @@ logo: "/static/logo.png" } }, - computed:{ - passwordLength(){ - return config.password.length - } - }, onReady() { this.$refs.form.setRules(this.rules) }, diff --git a/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue b/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue index 1ce6e53..567eaba 100644 --- a/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue +++ b/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue @@ -1,79 +1,79 @@ -