From 468fd06cf93cde9dd0bc522d708882e68ad81054 Mon Sep 17 00:00:00 2001 From: jyy <935090232@qq.com> Date: Wed, 17 Mar 2021 13:28:32 +0800 Subject: [PATCH] 新增查询根据OpenID查询用户信息 --- zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java | 19 +++++++++++++++---- 1 files changed, 15 insertions(+), 4 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java index 44c4ecd..81a6904 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java @@ -23,10 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import java.util.Collections; import java.util.Date; @@ -144,6 +141,20 @@ return res; } + /** + * 根据OpenID查询用户信息 + */ + @GetMapping(value = "/findUserInfo/{openId}") + public @ResponseBody + AjaxResult findUserInfo(@PathVariable String openId) { + BizUser bizUser = bizUserService.findByOpenId(openId); + BizUser bizUserQuery=new BizUser(); + bizUserQuery.setNickName(bizUser.getNickName()); + bizUserQuery.setAvatarUrl(bizUser.getAvatarUrl()); + bizUserQuery.setOpenId(openId); + return AjaxResult.buildSuccessInstance(bizUserQuery); + } + /** * 接收用户信息 -- Gitblit v1.9.1