Browse Source

更新小程序接口

chenyi406 3 years ago
parent
commit
161b374645

+ 1 - 2
src/main/java/com/zy/bms/common/aspect/AdminAuthorWxAop.java

@@ -28,13 +28,12 @@ public class AdminAuthorWxAop {
     @Resource
     private IUserService userService;
 
-
     @Around(value = "@annotation(com.zy.bms.common.annotation.AdminAuthorWx)")
     public Object doAround(ProceedingJoinPoint joinPoint) {
         try {
             //获取request对象
             HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
-            String userId = AesUtil.decrypt(request.getHeader("app_user"));
+            String userId = AesUtil.decrypt(request.getHeader("appUser"));
             User user = userService.getOne(new QueryWrapper<User>().eq("id", userId));
             if (user != null && user.getAdmin() == 1) return joinPoint.proceed();
         } catch (Throwable throwable) {

+ 1 - 1
src/main/java/com/zy/bms/entity/User.java

@@ -30,7 +30,7 @@ public class User implements Serializable {
     private String username;
 
     /**
-     * 用户名
+     * 微信openId
      */
     private String openId;
 

+ 1 - 1
src/main/resources/application.yml

@@ -1,3 +1,3 @@
 spring:
   profiles:
-    active: prod
+    active: dev

+ 1 - 6
src/main/resources/mapper/UserMapper.xml

@@ -11,17 +11,12 @@
             <if test="io.key != null and io.key != ''">
                 AND (username LIKE('%',#{io.key},'%')
                 OR phone LIKE('%',#{io.key},'%')
+                OR random_code LIKE('%',#{io.key},'%')
                 OR nickname LIKE('%',#{io.key},'%'))
             </if>
-            <if test="io.gender != null">
-                AND gender = #{io.gender}
-            </if>
             <if test="io.status != null">
                 AND status = #{io.status}
             </if>
-            <if test="io.itemId != null">
-                AND item_id = #{io.itemId}
-            </if>
         </where>
     </select>