Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
fe595203
Commit
fe595203
authored
Nov 16, 2018
by
Junling Bu
Browse files
fix[litemall-wx, litemall-wx-api]: 注册时验证码验证不正确
parent
59592ca0
Changes
4
Hide whitespace changes
Inline
Side-by-side
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java
View file @
fe595203
...
...
@@ -244,11 +244,11 @@ public class WxAuthController {
String
username
=
JacksonUtil
.
parseString
(
body
,
"username"
);
String
password
=
JacksonUtil
.
parseString
(
body
,
"password"
);
String
mobile
=
JacksonUtil
.
parseString
(
body
,
"mobile"
);
String
captcha
=
JacksonUtil
.
parseString
(
body
,
"captcha"
);
String
code
=
JacksonUtil
.
parseString
(
body
,
"code"
);
String
wxCode
=
JacksonUtil
.
parseString
(
body
,
"wxCode"
);
if
(
StringUtils
.
isEmpty
(
username
)
||
StringUtils
.
isEmpty
(
password
)
||
StringUtils
.
isEmpty
(
mobile
)
||
StringUtils
.
isEmpty
(
captcha
)
||
StringUtils
.
isEmpty
(
code
))
{
||
StringUtils
.
isEmpty
(
wxCode
)
||
StringUtils
.
isEmpty
(
code
))
{
return
ResponseUtil
.
badArgument
();
}
...
...
@@ -272,7 +272,7 @@ public class WxAuthController {
String
openId
=
null
;
try
{
WxMaJscode2SessionResult
result
=
this
.
wxService
.
getUserService
().
getSessionInfo
(
c
ode
);
WxMaJscode2SessionResult
result
=
this
.
wxService
.
getUserService
().
getSessionInfo
(
wxC
ode
);
openId
=
result
.
getOpenid
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
litemall-wx/pages/auth/register/register.js
View file @
fe595203
...
...
@@ -9,7 +9,7 @@ Page({
password
:
''
,
confirmPassword
:
''
,
mobile
:
''
,
c
aptcha
:
''
c
ode
:
''
},
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
...
...
@@ -31,7 +31,7 @@ Page({
// 页面关闭
},
sendC
aptcha
:
function
()
{
sendC
ode
:
function
()
{
let
that
=
this
;
if
(
this
.
data
.
mobile
.
length
==
0
)
{
...
...
@@ -79,7 +79,7 @@ Page({
}
});
},
requestRegister
:
function
(
c
ode
)
{
requestRegister
:
function
(
wxC
ode
)
{
let
that
=
this
;
wx
.
request
({
url
:
api
.
AuthRegister
,
...
...
@@ -87,8 +87,8 @@ Page({
username
:
that
.
data
.
username
,
password
:
that
.
data
.
password
,
mobile
:
that
.
data
.
mobile
,
c
aptcha
:
that
.
data
.
c
aptcha
,
c
ode
:
c
ode
c
ode
:
that
.
data
.
c
ode
,
wxC
ode
:
wxC
ode
},
method
:
'
POST
'
,
header
:
{
...
...
@@ -139,7 +139,7 @@ Page({
return
false
;
}
if
(
this
.
data
.
mobile
.
length
==
0
||
this
.
data
.
c
aptcha
.
length
==
0
)
{
if
(
this
.
data
.
mobile
.
length
==
0
||
this
.
data
.
c
ode
.
length
==
0
)
{
wx
.
showModal
({
title
:
'
错误信息
'
,
content
:
'
手机号和验证码不能为空
'
,
...
...
@@ -195,10 +195,10 @@ Page({
mobile
:
e
.
detail
.
value
});
},
bindC
aptcha
Input
:
function
(
e
)
{
bindC
ode
Input
:
function
(
e
)
{
this
.
setData
({
c
aptcha
:
e
.
detail
.
value
c
ode
:
e
.
detail
.
value
});
},
clearInput
:
function
(
e
)
{
...
...
@@ -223,9 +223,9 @@ Page({
mobile
:
''
});
break
;
case
'
clear-c
aptcha
'
:
case
'
clear-c
ode
'
:
this
.
setData
({
c
aptcha
:
''
c
ode
:
''
});
break
;
}
...
...
litemall-wx/pages/auth/register/register.wxml
View file @
fe595203
...
...
@@ -21,12 +21,12 @@
<image wx:if="{{ mobile.length > 0 }}" id="clear-mobile" class="clear" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
<view class="form-item-c
aptcha
" >
<view class="form-item c
aptcha
-item">
<input class="c
aptcha
" value="{{c
aptcha
}}" bindinput="bindC
aptcha
Input" placeholder="验证码"/>
<image class="clear" id="clear-c
aptcha
" wx:if="{{ c
aptcha
.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearInput"></image>
<view class="form-item-c
ode
" >
<view class="form-item c
ode
-item">
<input class="c
ode
" value="{{c
ode
}}" bindinput="bindC
ode
Input" placeholder="验证码"/>
<image class="clear" id="clear-c
ode
" wx:if="{{ c
ode
.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
<view class="c
aptcha
-btn" bindtap="sendC
aptcha
">获取验证码</view>
<view class="c
ode
-btn" bindtap="sendC
ode
">获取验证码</view>
</view>
<button type="primary" class="register-btn" bindtap="startRegister">注册</button>
...
...
litemall-wx/pages/auth/register/register.wxss
View file @
fe595203
...
...
@@ -14,7 +14,7 @@
border-bottom: 1px solid #d9d9d9;
}
.form-item .username, .form-item .password, .form-item .mobile, .form-item .c
aptcha
{
.form-item .username, .form-item .password, .form-item .mobile, .form-item .c
ode
{
position: absolute;
top: 26rpx;
left: 0;
...
...
@@ -26,19 +26,19 @@
font-size: 30rpx;
}
.form-item-c
aptcha
{
.form-item-c
ode
{
margin-top:32rpx;
height: auto;
overflow: hidden;
width: 100%;
}
.form-item-c
aptcha
.form-item{
.form-item-c
ode
.form-item{
float: left;
width: 350rpx;
}
.form-item-c
aptcha .captcha
-btn{
.form-item-c
ode .code
-btn{
float: right;
padding: 20rpx 40rpx;
border: 1px solid #d9d9d9;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment