From dd5bb9e27d2ac0a879ccb62df985d51ac9562198 Mon Sep 17 00:00:00 2001
From: 彭雪彬 <1724387007@qq.com>
Date: Mon, 14 Jul 2025 19:43:53 +0800
Subject: [PATCH] 骑手到店上报、已取商品

---
 oying-system/src/main/java/com/oying/modules/security/rest/AuthController.java |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/oying-system/src/main/java/com/oying/modules/security/rest/AuthController.java b/oying-system/src/main/java/com/oying/modules/security/rest/AuthController.java
index 8a48e10..4141c9b 100644
--- a/oying-system/src/main/java/com/oying/modules/security/rest/AuthController.java
+++ b/oying-system/src/main/java/com/oying/modules/security/rest/AuthController.java
@@ -147,22 +147,18 @@
     public static final String OLD = "OLD";
     public static final String NEW = "NEW";
 
-    @Log("微信授权登录")
-    @ApiOperation("微信授权登录")
+    @Log("小程序:微信授权登录")
+    @ApiOperation("小程序:微信授权登录")
     @AnonymousPostMapping(value = "/login/weixin")
     public ResponseEntity<Object> loginWeixin(@Validated @RequestBody AuthUserWeixinDto authUser, HttpServletRequest request) throws Exception {
         JSONObject jsonObject;
-        switch (authUser.getCode()) {
+        switch (authUser.getType()) {
             case OLD:
                 jsonObject = weiXinService.code2Session(authUser.getCode());
                 String openid = jsonObject.getString("openid");
                 User userDto = userService.findByOpenid(openid);
                 if (userDto == null) {
-                    Map<String, Object> authInfo = new HashMap<String, Object>(2) {{
-                        put("token", openid);
-                        put("member", null);
-                    }};
-                    return ResponseEntity.ok(authInfo);
+                    return ResponseEntity.ok(R.success(openid));
                 }
                 authUser.setUsername(userDto.getUsername());
                 break;
@@ -176,6 +172,8 @@
                     user.setUsername(phone);
                     user.setNickName("OYING-" + phone);
                     user.setUserType(ConstantsKey.BUYER);
+                    user.setPhone(phone);
+                    user.setGender("男");
                     user.setEnabled(true);
                     getRole(user);
                     user.setPassword(passwordEncoder.encode(phone.substring(phone.length() - 6)));
@@ -221,7 +219,7 @@
         Set<Role> roles = new HashSet<>();
         Role role = new Role();
         DictDetail detail = dictDetailService.getDictByName(ConstantsKey.USER_TYPE_BUYER).get(0);
-        role.setId(Long.valueOf(detail.getLabel()));
+        role.setId(Long.valueOf(detail.getValue()));
         roles.add(role);
         user1.setRoles(roles);
     }

--
Gitblit v1.9.3