From 15e20646c2f9de066ee1ddb6db492dfaf757f4c4 Mon Sep 17 00:00:00 2001 From: TinyAnts Date: Wed, 7 Sep 2022 18:28:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B3=A8=E5=86=8C=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E5=AE=A2=E6=88=B7=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mdd/front/service/impl/LoginServiceImpl.java | 2 +- .../src/main/java/com/mdd/front/validate/RegParam.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/server/like-front/src/main/java/com/mdd/front/service/impl/LoginServiceImpl.java b/server/like-front/src/main/java/com/mdd/front/service/impl/LoginServiceImpl.java index 90a72b16..6723fad6 100644 --- a/server/like-front/src/main/java/com/mdd/front/service/impl/LoginServiceImpl.java +++ b/server/like-front/src/main/java/com/mdd/front/service/impl/LoginServiceImpl.java @@ -63,7 +63,7 @@ public class LoginServiceImpl implements ILoginService { user.setUsername(regParam.getUsername()); user.setPassword(pwd); user.setSalt(salt); - user.setChannel(0); + user.setChannel(regParam.getClient()); user.setCreateTime(System.currentTimeMillis() / 1000); user.setUpdateTime(System.currentTimeMillis() / 1000); userMapper.insert(user); diff --git a/server/like-front/src/main/java/com/mdd/front/validate/RegParam.java b/server/like-front/src/main/java/com/mdd/front/validate/RegParam.java index 4be02cce..ed0359ce 100644 --- a/server/like-front/src/main/java/com/mdd/front/validate/RegParam.java +++ b/server/like-front/src/main/java/com/mdd/front/validate/RegParam.java @@ -1,5 +1,6 @@ package com.mdd.front.validate; +import com.mdd.common.validator.annotation.IntegerContains; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -32,4 +33,9 @@ public class RegParam implements Serializable { @Length(min = 6, max = 12, message = "密码必须在6~12个字符内") private String password; + @NotNull(message = "client参数缺失") + @NotEmpty(message = "客户端不能为空") + @IntegerContains(values = {1, 2, 3, 4, 5, 6}, message = "不是合法客户端") + private Integer client; + }