ccjgmwz 4 年之前
父节点
当前提交
d029d97686

+ 1 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/user/UserService.java

@@ -61,6 +61,7 @@ public interface UserService {
             @NotNull @TextFormat(lengthMin = 6, lengthMax = 18, notChinese = true) @HttpParam(name = "password", type = HttpParamType.COMMON, description = "用户密码") String password,
             @HttpParam(name = "loginType", type = HttpParamType.COMMON, description = "登录方式") Integer loginType,
             @HttpParam(name = "raw", type = HttpParamType.COMMON, description = "第三方平台返回的数据") String raw,
+            @HttpParam(name = "cid", type = HttpParamType.COMMON, description = "cid") String cid,
             @NotNull @HttpParam(name = "ip", type = HttpParamType.IP, description = "登录IP") String ip) throws ServiceException;
     @HttpMethod(description = "PC端用户登录")
     UserDTO loginPC(

+ 2 - 1
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/user/UserServiceImpl.java

@@ -314,7 +314,7 @@ public class UserServiceImpl implements UserService {
 
     @Override
     @Transactional
-    public UserDTO login(String phone, String password, Integer loginType, String raw, String ip) throws ServiceException {
+    public UserDTO login(String phone, String password, Integer loginType, String raw, String cid,String ip) throws ServiceException {
         String cryptPassword = Md5Crypt.md5Crypt(password.getBytes(), "$1$" + phone.substring(0, 7));
         UserDTO userDTO = userMapper.login(phone, cryptPassword);
 
@@ -363,6 +363,7 @@ public class UserServiceImpl implements UserService {
         //返回用户DTO
         cacheComponent.del(VERIFY_CODE_PREFIX + phone);
         String accessToken = GeneratorUtil.genSessionId();
+        userDO.setCid(cid);
         BeanUtils.copyProperties(userDO,userDTO);
         userDTO.setAccessToken(accessToken);
         //放入SESSION专用Redis数据源中

+ 2 - 1
unimall-app/pages/public/login.vue

@@ -174,7 +174,8 @@
 				})
 				this.$api.request('user', 'login',{
 					password:that.password,
-					phone:that.phone
+					phone:that.phone,
+					cid:uni.getStorageSync("clientId")
 				}, failres => {
 			           that.$api.msg(failres.errmsg)
 			           uni.hideLoading()

二进制
unimall-app/static/img/liangxin.png