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
6fec6b58
"jetbrains:/idea/checkout/git" did not exist on "7c8a9bd04f5a5dbf6e7e8be0db62a34da7109c54"
Unverified
Commit
6fec6b58
authored
Oct 09, 2019
by
beaver383
Committed by
GitHub
Oct 09, 2019
Browse files
Merge pull request #1 from linlinjava/master
同步
parents
c04bf486
5238b74e
Changes
25
Show whitespace changes
Inline
Side-by-side
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java
View file @
6fec6b58
...
@@ -239,10 +239,12 @@ public class WxAuthController {
...
@@ -239,10 +239,12 @@ public class WxAuthController {
String
password
=
JacksonUtil
.
parseString
(
body
,
"password"
);
String
password
=
JacksonUtil
.
parseString
(
body
,
"password"
);
String
mobile
=
JacksonUtil
.
parseString
(
body
,
"mobile"
);
String
mobile
=
JacksonUtil
.
parseString
(
body
,
"mobile"
);
String
code
=
JacksonUtil
.
parseString
(
body
,
"code"
);
String
code
=
JacksonUtil
.
parseString
(
body
,
"code"
);
// 如果是小程序注册,则必须非空
// 其他情况,可以为空
String
wxCode
=
JacksonUtil
.
parseString
(
body
,
"wxCode"
);
String
wxCode
=
JacksonUtil
.
parseString
(
body
,
"wxCode"
);
if
(
StringUtils
.
isEmpty
(
username
)
||
StringUtils
.
isEmpty
(
password
)
||
StringUtils
.
isEmpty
(
mobile
)
if
(
StringUtils
.
isEmpty
(
username
)
||
StringUtils
.
isEmpty
(
password
)
||
StringUtils
.
isEmpty
(
mobile
)
||
StringUtils
.
isEmpty
(
wxCode
)
||
StringUtils
.
isEmpty
(
code
))
{
||
StringUtils
.
isEmpty
(
code
))
{
return
ResponseUtil
.
badArgument
();
return
ResponseUtil
.
badArgument
();
}
}
...
@@ -264,7 +266,10 @@ public class WxAuthController {
...
@@ -264,7 +266,10 @@ public class WxAuthController {
return
ResponseUtil
.
fail
(
AUTH_CAPTCHA_UNMATCH
,
"验证码错误"
);
return
ResponseUtil
.
fail
(
AUTH_CAPTCHA_UNMATCH
,
"验证码错误"
);
}
}
String
openId
=
null
;
String
openId
=
""
;
// 非空,则是小程序注册
// 继续验证openid
if
(!
StringUtils
.
isEmpty
(
wxCode
))
{
try
{
try
{
WxMaJscode2SessionResult
result
=
this
.
wxService
.
getUserService
().
getSessionInfo
(
wxCode
);
WxMaJscode2SessionResult
result
=
this
.
wxService
.
getUserService
().
getSessionInfo
(
wxCode
);
openId
=
result
.
getOpenid
();
openId
=
result
.
getOpenid
();
...
@@ -284,6 +289,7 @@ public class WxAuthController {
...
@@ -284,6 +289,7 @@ public class WxAuthController {
return
ResponseUtil
.
fail
(
AUTH_OPENID_BINDED
,
"openid已绑定账号"
);
return
ResponseUtil
.
fail
(
AUTH_OPENID_BINDED
,
"openid已绑定账号"
);
}
}
}
}
}
LitemallUser
user
=
null
;
LitemallUser
user
=
null
;
BCryptPasswordEncoder
encoder
=
new
BCryptPasswordEncoder
();
BCryptPasswordEncoder
encoder
=
new
BCryptPasswordEncoder
();
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java
View file @
6fec6b58
...
@@ -395,7 +395,7 @@ public class WxCartController {
...
@@ -395,7 +395,7 @@ public class WxCartController {
LitemallAddress
checkedAddress
=
null
;
LitemallAddress
checkedAddress
=
null
;
if
(
addressId
==
null
||
addressId
.
equals
(
0
))
{
if
(
addressId
==
null
||
addressId
.
equals
(
0
))
{
checkedAddress
=
addressService
.
findDefault
(
userId
);
checkedAddress
=
addressService
.
findDefault
(
userId
);
// 如果仍然没有地址,则是没有收
获
地址
// 如果仍然没有地址,则是没有收
货
地址
// 返回一个空的地址id=0,这样前端则会提醒添加地址
// 返回一个空的地址id=0,这样前端则会提醒添加地址
if
(
checkedAddress
==
null
)
{
if
(
checkedAddress
==
null
)
{
checkedAddress
=
new
LitemallAddress
();
checkedAddress
=
new
LitemallAddress
();
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCatalogController.java
View file @
6fec6b58
...
@@ -30,6 +30,20 @@ public class WxCatalogController {
...
@@ -30,6 +30,20 @@ public class WxCatalogController {
@Autowired
@Autowired
private
LitemallCategoryService
categoryService
;
private
LitemallCategoryService
categoryService
;
@GetMapping
(
"/getfirstcategory"
)
public
Object
getFirstCategory
()
{
// 所有一级分类目录
List
<
LitemallCategory
>
l1CatList
=
categoryService
.
queryL1
();
return
ResponseUtil
.
ok
(
l1CatList
);
}
@GetMapping
(
"/getsecondcategory"
)
public
Object
getSecondCategory
(
@NotNull
Integer
id
)
{
// 所有二级分类目录
List
<
LitemallCategory
>
currentSubCategory
=
categoryService
.
queryByPid
(
id
);
return
ResponseUtil
.
ok
(
currentSubCategory
);
}
/**
/**
* 分类详情
* 分类详情
*
*
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCouponController.java
View file @
6fec6b58
...
@@ -79,7 +79,7 @@ public class WxCouponController {
...
@@ -79,7 +79,7 @@ public class WxCouponController {
*/
*/
@GetMapping
(
"mylist"
)
@GetMapping
(
"mylist"
)
public
Object
mylist
(
@LoginUser
Integer
userId
,
public
Object
mylist
(
@LoginUser
Integer
userId
,
@NotNull
Short
status
,
Short
status
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
defaultValue
=
"10"
)
Integer
limit
,
@RequestParam
(
defaultValue
=
"10"
)
Integer
limit
,
@Sort
@RequestParam
(
defaultValue
=
"add_time"
)
String
sort
,
@Sort
@RequestParam
(
defaultValue
=
"add_time"
)
String
sort
,
...
...
litemall-wx/pages/index/index.wxml
View file @
6fec6b58
...
@@ -147,7 +147,7 @@
...
@@ -147,7 +147,7 @@
</view>
</view>
</view>
</view>
<view class="a-section a-topic" wx:if="topics.length > 0">
<view class="a-section a-topic" wx:if="topics.length > 0"
hidden="{{topics.length <= 0}}"
>
<view class="h">
<view class="h">
<view>
<view>
<navigator url="/pages/topic/topic">
<navigator url="/pages/topic/topic">
...
...
Prev
1
2
Next
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