zhangbin 1 рік тому
батько
коміт
fac55409ed

+ 2 - 1
xpgx-admin/src/main/java/com/miaxis/app/controller/birthday/BirthdayLogController.java

@@ -74,7 +74,8 @@ public class BirthdayLogController extends BaseController {
     @PostMapping
     @ApiOperation("新增查询记录")
     public Response<Integer> add(@RequestBody BirthdayLog birthdayLog) {
-        birthdayLog.setUserId(SecurityUtils.getLoginUser().getStudent().getId());
+        Long userId = SecurityUtils.getLoginUser().getStudent().getId();
+        birthdayLog.setUserId(userId);
         return toResponse(birthdayLogService.saveBirthdayLog(birthdayLog) ? 1 : 0);
     }
 

+ 8 - 9
xpgx-common/src/main/java/com/miaxis/common/core/domain/model/LoginUser.java

@@ -129,6 +129,8 @@ public class LoginUser implements UserDetails
         this.id = "sysUser:"+user.getUserId();
     }
 
+
+
     @JsonIgnore
     @Override
     public String getPassword()
@@ -286,17 +288,14 @@ public class LoginUser implements UserDetails
         this.student = student;
     }
 
-    @Override
-    public Collection<? extends GrantedAuthority> getAuthorities()
-    {
-        if (this.getStudent() != null){
-            return null;
-        }else {
-            return null;
-        }
-    }
+
     public void setAuthorities(Collection<? extends GrantedAuthority> collection){
 
     }
 
+    @Override
+    public Collection<? extends GrantedAuthority> getAuthorities() {
+        return Collections.emptyList();
+    }
+
 }

+ 7 - 0
xpgx-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -99,6 +99,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		where app_openid = #{openid}
 	</select>
 
+
+	<select id="getStudentByXcxOpenId" parameterType="String" resultType="com.miaxis.common.core.domain.entity.UserInfo">
+		select * from user_info
+		where xcx_openid = #{openid}
+	</select>
+
+
 	<select id="getStudentByGzhOpenId" parameterType="String" resultType="com.miaxis.common.core.domain.entity.UserInfo">
 		select * from user_info
 		where gzh_openid = #{openid}