Browse Source

bugfix-登录返回手机号

Aslee 3 years ago
parent
commit
bf16bcae5e

+ 5 - 0
src/main/java/com/caimei/model/vo/UserLoginVo.java

@@ -27,6 +27,11 @@ public class UserLoginVo implements Serializable {
      */
     @ApiModelProperty("用户名")
     private String name;
+    /**
+     * 手机号
+     */
+    @ApiModelProperty("手机号")
+    private String mobile;
     /**
      * 登录账号
      */

+ 4 - 4
src/main/java/com/caimei/service/vip/impl/VipServiceImpl.java

@@ -105,8 +105,8 @@ public class VipServiceImpl implements VipService {
                 if (authVip.getBeginTime().compareTo(beginTime) >= 0) {
                     // 删除原有角色关联
                     systemMapper.deleteUserRoleRelation(authUserId);
-                    // 续费重新分配角色
-                    sysUserService.saveRoleRelation(authUserId, "1,2");
+                    // 会员过期重新分配角色
+                    sysUserService.saveRoleRelation(authUserId, "1");
                 }
             } else {
                 // 新增会员信息
@@ -114,7 +114,7 @@ public class VipServiceImpl implements VipService {
                 // 删除原有角色关联
                 systemMapper.deleteUserRoleRelation(authUserId);
                 // 分配角色
-                sysUserService.saveRoleRelation(authUserId, "1,2");
+                sysUserService.saveRoleRelation(authUserId, "1");
             }
         }
         if (null != vipHistory.getId() && vipHistory.getId() > 0) {
@@ -334,7 +334,7 @@ public class VipServiceImpl implements VipService {
         // 删除原有角色关联
         systemMapper.deleteUserRoleRelation(authUserId);
         // 保存用户角色关系
-        sysUserService.saveRoleRelation(authUserId, roleIds + ",1,2");
+        sysUserService.saveRoleRelation(authUserId, roleIds + ",1");
         return ResponseJson.success();
     }
 }

+ 4 - 2
src/main/resources/mapper/UserMapper.xml

@@ -7,11 +7,11 @@
         where authUserId = #{authUserId};
     </update>
     <select id="getAdminUserByName" resultType="com.caimei.model.vo.UserLoginVo">
-        select authUserId, name, password, userIdentity
+        select authUserId, name, password, userIdentity, mobile
         from cm_brand_auth_user
         where name = #{name}
           and status = 1
-        limit 1;
+        limit 1
     </select>
     <select id="getShopUserByMobile" resultType="com.caimei.model.vo.UserLoginVo">
         select u.authUserId,
@@ -21,6 +21,7 @@
                userIdentity,
                u.status as shopStatus,
                shopType,
+               u.mobile,
                if(u.shopType = 1, b.id, null) as brandId
         from cm_brand_auth_user u
                  left join cm_brand_auth_shop_info i on u.authUserId = i.authUserId
@@ -41,6 +42,7 @@
                userIdentity,
                u.status as shopStatus,
                shopType,
+               u.mobile,
                if(u.shopType = 1, b.id, null) as brandId
         from cm_brand_auth_user u
                  left join cm_brand_auth_shop_info i on u.authUserId = i.authUserId