提交 52cc1b78 编写于 作者: DCloud_JSON's avatar DCloud_JSON

修复账号密码登录时,验证码错误没有自动刷新验证码的问题

上级 b43eebd9
......@@ -3,7 +3,7 @@
export default {
onLaunch: async function() {
console.log('App Launch')
// await uniIdPageInit()
await uniIdPageInit()
},
onShow: function() {
console.log('App Show')
......
......@@ -131,7 +131,7 @@
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2",
"vueVersion" : "3",
"h5" : {
"unipush" : {
"enable" : true
......
......@@ -81,8 +81,8 @@
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#FFF",
"backgroundColor": "#F8F8F8"
},
"condition" : { //模式配置,仅开发期间生效
}
,"condition" : { //模式配置,仅开发期间生效
"current": 0, //当前激活的模式(list 的索引项)
"list": [
{
......@@ -91,8 +91,8 @@
"query": "" //启动参数,在页面的onLoad函数里面得到
}
]
}
, "uniIdRouter": {
},
"uniIdRouter": {
"loginPage": "uni_modules/uni-id-pages/pages/login/login-withoutpwd",
"needLogin": [
"uni_modules/uni-id-pages/pages/userinfo/userinfo"
......
## 0.6.1(2022-06-23)
- 修复:部分返回值,不符合响应体规范的问题
## 0.6.0(2022-05-27)
- 新增:支持在`uni-config-center`中根据场景值配置
- 修复:弹窗式验证码,输入内容后点击取消,重新打开验证码的值仍然存在的问题
......
......@@ -4,7 +4,7 @@
<uni-icons class="loding" size="20px" color="#BBB" v-if="loging" type="spinner-cycle"></uni-icons>
<image class="captcha-img" :class="{opacity:loging}" @click="getImageCaptcha" :src="captchaBase64"
mode="widthFix"></image>
</view>
</view>
<input @blur="focusCaptchaInput = false" :focus="focusCaptchaInput" type="text" class="captcha"
:inputBorder="false" maxlength="4" v-model="val" placeholder="请输入验证码">
</view>
......
{
"id": "uni-captcha",
"displayName": "uni-captcha",
"version": "0.6.0",
"version": "0.6.1",
"description": "云端一体图形验证码组件",
"keywords": [
"uniCloud",
"captcha",
"验证码",
"图形验证码",
"人机验证"
"人机验证",
"防刷",
"防脚本"
],
"repository": "https://gitee.com/dcloud/uni-captcha",
"engines": {
......
## 1.0.1(2022-06-22)
## 1.0.1(2022-06-23)
新增,应用[pages_init](https://uniapp.dcloud.io/plugin/publish.html#pages-init)当导入插件到项目工程时,自动合并本插件的页面路由到项目的pages.json
## 1.0.0(2022-06-23)
正式版
## 1.0.0(2022-06-21)
初始化项目
......@@ -39,9 +39,9 @@
export default {
name: "uni-sms-form",
model: {
prop: 'modelValue',
prop: 'modelValue',
event: 'update:modelValue'
},
},
props: {
event: ['update:modelValue'],
/**
......@@ -153,7 +153,7 @@
this.getCode();
}).catch(e => {
console.log(JSON.stringify(e));
if (e.code == 40000) {
if (e.code == "uni-id-invalid-sms-template-id") {
this.modelValue = "123456"
uni.showToast({
title: '已启动测试模式,详情【控制台信息】',
......@@ -189,21 +189,23 @@
<style lang="scss" scoped>
.box {
position: relative;
margin-top: 10px;
margin-top: 10px;
}
.short-code-btn {
padding: 0;
position: absolute;
position: absolute;
top: 0;
right: 8px;
width: 200rpx;
max-width: 100px;
width: 260rpx;
max-width: 130px;
height: 44px;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
align-items: center;
}
.inner-text {
......@@ -219,7 +221,8 @@
width: 350rpx;
}
.input-box {
.input-box {
margin: 0;
padding: 4px;
background-color: #F8F8F8;
font-size: 14px;
......
......@@ -12,14 +12,14 @@ const {
export default async function() {
//有打开调试模式的情况下
// 有打开调试模式的情况下
if (debug) {
// 1. 检查本地uni-id-pages中配置的登录方式,服务器端是否已经配置正确。否则提醒并引导去配置
//调用云对象,获取服务端已正确配置的登陆方式
let {
supportedLoginType
} = await uniIdCo.getSupportedLoginType()
// console.log("supportedLoginType: " + JSON.stringify(supportedLoginType));
console.log("supportedLoginType: " + JSON.stringify(supportedLoginType));
//登陆方式,服务端和客户端的映射关系
let data = {
smsCode: 'mobile-code',
......
......@@ -10,7 +10,7 @@
"login",
"登录"
],
"repository": "",
"repository": "https://gitcode.net/dcloud/hello_uni-id-pages",
"engines": {
"HBuilderX": "^3.4.17"
},
......
......@@ -62,7 +62,7 @@
// 页面跳转,找回密码
toRetrievePwd() {
let url = '/uni_modules/uni-id-pages/pages/retrieve/retrieve'
//如果刚好用户名输入框的值为手机号码,就把它传到根据手机验证码找回密码页面
//如果刚好用户名输入框的值为手机号码,就把它传到retrieve页面,根据该手机号找回密码
if (/^1\d{10}$/.test(this.username)) {
url += `?phoneNumber=${this.username}`
}
......@@ -114,17 +114,11 @@
uniIdCo.login(data).then(e => {
this.loginSuccess(e)
}).catch(e => {
console.log(JSON.stringify(e));
switch (e.errCode){
case 'uni-id-captcha-required':
this.needCaptcha = true
break;
case 'uni-captcha-verify-fail':
//当验证码错误,重新获取
this.$refs.captcha.getImageCaptcha()
break;
default:
break;
if(e.errCode == 'uni-id-captcha-required'){
this.needCaptcha = true
}else if(this.needCaptcha){
//登录失败,自动重新获取验证码
this.$refs.captcha.getImageCaptcha()
}
})
},
......
......@@ -112,7 +112,9 @@
<style lang="scss">
@import "@/uni_modules/uni-id-pages/common/login-page.scss";
.uni-content{
margin-top: 15px;
}
.uni-content ::v-deep .uni-forms-item__label {
position: absolute;
left: -15px;
......
[
{
"path": "uni_modules/uni-id-pages/pages/userinfo/deactivate/deactivate",
"style": {
"navigationBarTitleText": "注销账号"
}
},
{
"path": "uni_modules/uni-id-pages/pages/userinfo/userinfo",
"style": {
"navigationBarTitleText": "个人资料"
}
},
{
"path": "uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile",
"style": {
"navigationBarTitleText": "绑定手机号码"
}
},
{
"path": "uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "uni_modules/uni-id-pages/pages/login/login-withoutpwd",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "uni_modules/uni-id-pages/pages/login/login-withpwd",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "uni_modules/uni-id-pages/pages/login/login-smscode",
"style": {
"navigationBarTitleText": "手机验证码登录"
}
},
{
"path": "uni_modules/uni-id-pages/pages/register/register",
"style": {
"navigationBarTitleText": "注册"
}
},
{
"path": "uni_modules/uni-id-pages/pages/retrieve/retrieve",
"style": {
"navigationBarTitleText": "重置密码"
}
}, {
"path": "uni_modules/uni-id-pages/pages/common/webview/webview",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
]
\ No newline at end of file
{
"pages": [
{
"path": "uni_modules/uni-id-pages/pages/userinfo/deactivate/deactivate",
"style": {
"navigationBarTitleText": "注销账号"
}
},
{
"path": "uni_modules/uni-id-pages/pages/userinfo/userinfo",
"style": {
"navigationBarTitleText": "个人资料"
}
},
{
"path": "uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile",
"style": {
"navigationBarTitleText": "绑定手机号码"
}
},
{
"path": "uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "uni_modules/uni-id-pages/pages/login/login-withoutpwd",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "uni_modules/uni-id-pages/pages/login/login-withpwd",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "uni_modules/uni-id-pages/pages/login/login-smscode",
"style": {
"navigationBarTitleText": "手机验证码登录"
}
},
{
"path": "uni_modules/uni-id-pages/pages/register/register",
"style": {
"navigationBarTitleText": "注册"
}
},
{
"path": "uni_modules/uni-id-pages/pages/retrieve/retrieve",
"style": {
"navigationBarTitleText": "重置密码"
}
}, {
"path": "uni_modules/uni-id-pages/pages/common/webview/webview",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd",
"style" :
{
"navigationBarTitleText": "修改密码",
"enablePullDownRefresh": false
}
}
]
}
\ No newline at end of file
......@@ -57,7 +57,7 @@ module.exports = async function (params = {}) {
scene
})
return {
errCode: 40000,
errCode: 'uni-id-invalid-sms-template-id',
errMsg: `未找到scene=${scene},的短信模版templateId。\n已启动测试模式,直接使用:123456作为短信验证码即可。\n如果是正式项目,请在路径:/common/uni-config-center/uni-id/config.json中service->sms中配置密钥等信息\n更多详情:https://uniapp.dcloud.io/uniCloud/uni-id.html#config`
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册