diff --git a/all/sql/ucenter.sql b/all/sql/ucenter.sql index d3496d5..707b2c4 100644 --- a/all/sql/ucenter.sql +++ b/all/sql/ucenter.sql @@ -49,7 +49,7 @@ DROP TABLE IF EXISTS ucenter_user; CREATE TABLE ucenter_user ( `id` INT(10) UNSIGNED AUTO_INCREMENT NOT NULL COMMENT '编号', - `password` VARCHAR(32) NOT NULL + `password` VARCHAR(200) NOT NULL COMMENT '密码(MD5(密码+salt))', `salt` VARCHAR(32) DEFAULT NULL COMMENT '盐值', diff --git a/all/sql/upms.sql b/all/sql/upms.sql index 9dbe23a..b094532 100644 --- a/all/sql/upms.sql +++ b/all/sql/upms.sql @@ -67,7 +67,7 @@ CREATE TABLE upms_user ( COMMENT '用户的编号', `username` VARCHAR(20) NOT NULL COMMENT '用户名', - `password` VARCHAR(32) NOT NULL + `password` VARCHAR(200) NOT NULL COMMENT '密码加密后的md5值(密码+盐值)', `salt` VARCHAR(32) DEFAULT NULL COMMENT '盐值', diff --git a/boot-starter/boot-starter-security/boot-starter-security-core/src/main/java/com/micro/fast/security/core/validate/code/filter/ValidateCodeFilter.java b/boot-starter/boot-starter-security/boot-starter-security-core/src/main/java/com/micro/fast/security/core/validate/code/filter/ValidateCodeFilter.java index 803faa6..981cc4d 100644 --- a/boot-starter/boot-starter-security/boot-starter-security-core/src/main/java/com/micro/fast/security/core/validate/code/filter/ValidateCodeFilter.java +++ b/boot-starter/boot-starter-security/boot-starter-security-core/src/main/java/com/micro/fast/security/core/validate/code/filter/ValidateCodeFilter.java @@ -18,6 +18,7 @@ import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; import java.io.IOException; import java.util.*; @@ -86,7 +87,6 @@ public class ValidateCodeFilter extends OncePerRequestFilter implements Initiali , HttpServletResponse httpServletResponse , FilterChain filterChain) throws ServletException, IOException { - //判断是否需要验证码校验 boolean filter = false; //进行校验的类型 @@ -139,7 +139,7 @@ public class ValidateCodeFilter extends OncePerRequestFilter implements Initiali if (validateCode.isExpire()) { throw new ValidateCodeException("验证码已过期"); } - //一次校验完成之后删除验证码 + //如果校验通过之后删除验证码 sessionStrategy.removeAttribute(servletWebRequest, ValidateCodeProcessor.SESSION_KEY_PREFIX + validateType); } diff --git a/boot-starter/boot-starter-ssm/src/main/java/com/micro/fast/common/exception/handler/ExceptionHandlerController.java b/boot-starter/boot-starter-ssm/src/main/java/com/micro/fast/common/exception/handler/BaseExceptionHandlerController.java similarity index 96% rename from boot-starter/boot-starter-ssm/src/main/java/com/micro/fast/common/exception/handler/ExceptionHandlerController.java rename to boot-starter/boot-starter-ssm/src/main/java/com/micro/fast/common/exception/handler/BaseExceptionHandlerController.java index 97997d5..fb80f36 100644 --- a/boot-starter/boot-starter-ssm/src/main/java/com/micro/fast/common/exception/handler/ExceptionHandlerController.java +++ b/boot-starter/boot-starter-ssm/src/main/java/com/micro/fast/common/exception/handler/BaseExceptionHandlerController.java @@ -16,8 +16,7 @@ import java.util.Map; * 异常处理类 * @author lsy */ -@RestControllerAdvice -public class ExceptionHandlerController { +public class BaseExceptionHandlerController { /** * 处理系统异常 * @param se diff --git a/boot-starter/boot-starter-ssm/src/main/java/com/micro/fast/common/response/ServerResponse.java b/boot-starter/boot-starter-ssm/src/main/java/com/micro/fast/common/response/ServerResponse.java index 6bdc596..7ce87e8 100644 --- a/boot-starter/boot-starter-ssm/src/main/java/com/micro/fast/common/response/ServerResponse.java +++ b/boot-starter/boot-starter-ssm/src/main/java/com/micro/fast/common/response/ServerResponse.java @@ -2,17 +2,18 @@ package com.micro.fast.common.response; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.annotation.JsonSerialize; /** * 统一服务响应类,方法返回值 - * + * 序列化中不包含为空值的字段 * @author lishouyu 18332763730@163.com 2017/10/02 * @version 1.0 * @since 1.0 */ @JsonIgnoreProperties(ignoreUnknown = true) -@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)//序列化中不包含为空的字段 +@JsonInclude(JsonInclude.Include.NON_EMPTY) public class ServerResponse { /** * 获取数据返回的提示数据字典码 diff --git a/ms-web/src/components/Register.vue b/ms-web/src/components/Register.vue index b9353ad..5254be9 100644 --- a/ms-web/src/components/Register.vue +++ b/ms-web/src/components/Register.vue @@ -22,18 +22,6 @@ - - 真实姓名: - - - - - - 手机号码: - - - - 邮箱: @@ -41,18 +29,12 @@ - 性别: - - - - - - - 提交 - - - 重置 - + + 提交 + + + 重置 + @@ -63,10 +45,7 @@ username: '', password: '', validatePassword: '', - realname: '', - phone: '', - email: '', - sex: '' + email: '' } export default { name: 'Register', @@ -76,16 +55,40 @@ methods: { signUp () { let that = this - this.$http.post(that.$msConfig.reqUpms + '/upms/user', signUp) + let baseConfig = this.$msConfig + this.$http.post(baseConfig.reqBaseUrl + baseConfig.upms + '/upms/user', that.$querystring.stringify(signUp)) .then(response => { - console.log(response) - }, error => { - console.log(error) + if (response.status === 200) { + this.$message({ + message: '恭喜您,注册成功!', + type: 'success', + center: true + }) + } + }) + .catch(onError => { + let response = onError.response + if (response.status === 400) { + // es6中对象的遍历 + for (let [key, value] of Object.entries(response.data)) { + console.log(key) + this.$message({ + message: value, + type: 'warning', + center: true + }) + } + } + if (response.status >= 500) { + this.$message.error('系统异常请稍后再试') + } }) }, reset () { signUp.username = '' signUp.password = '' + signUp.email = '' + signUp.validatePassword = '' } } } diff --git a/ms-web/src/components/SignIn.vue b/ms-web/src/components/SignIn.vue index ecf6b20..4556568 100644 --- a/ms-web/src/components/SignIn.vue +++ b/ms-web/src/components/SignIn.vue @@ -44,7 +44,7 @@ methods: { signIn () { let that = this - that.$http.post(that.$msConfig.reqUpms + '/user/login', that.$querystring.stringify(signIn)) + that.$http.post(that.$msConfig.reqBaseUrl + that.$msConfig.upms + '/user/login', that.$querystring.stringify(signIn)) .then(response => { console.log(response.data) }, error => { diff --git a/ms-web/src/main.js b/ms-web/src/main.js index 212190d..cade71f 100644 --- a/ms-web/src/main.js +++ b/ms-web/src/main.js @@ -24,7 +24,7 @@ Vue.prototype.$msConfig = { // ms系统的请求的基础路径 reqBaseUrl: 'http://fthipw.natappfree.cc', // 权限管理系统请求的基础路径 - reqUpms: this.reqBaseUrl + ':10006/upms' + upms: ':10006/upms' } // admin模块的state和action const admin = new Vuex.Store({