用户注册提示
This commit is contained in:
+1
-1
@@ -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 '盐值',
|
||||
|
||||
+1
-1
@@ -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 '盐值',
|
||||
|
||||
+2
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -16,8 +16,7 @@ import java.util.Map;
|
||||
* 异常处理类
|
||||
* @author lsy
|
||||
*/
|
||||
@RestControllerAdvice
|
||||
public class ExceptionHandlerController {
|
||||
public class BaseExceptionHandlerController {
|
||||
/**
|
||||
* 处理系统异常
|
||||
* @param se
|
||||
+3
-2
@@ -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<T> {
|
||||
/**
|
||||
* 获取数据返回的提示数据字典码
|
||||
|
||||
@@ -22,18 +22,6 @@
|
||||
<el-input type="password" v-model="validatePassword" placeholder="确认密码" suffixIcon="ms-web-need" clearable></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="row-line">
|
||||
<el-col :lg="2" class="left-font" >真实姓名:</el-col>
|
||||
<el-col :lg="4">
|
||||
<el-input v-model="realname" placeholder="真实姓名" clearable></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="row-line">
|
||||
<el-col :lg="2" class="left-font" >手机号码:</el-col>
|
||||
<el-col :lg="4">
|
||||
<el-input v-model="phone" placeholder="手机号码" clearable></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="row-line">
|
||||
<el-col :lg="2" class="left-font" >邮箱:</el-col>
|
||||
<el-col :lg="4">
|
||||
@@ -41,18 +29,12 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="row-line">
|
||||
<el-col :lg="2" class="left-font" >性别:</el-col>
|
||||
<el-col :lg="4">
|
||||
<el-input v-model="sex" placeholder="性别" clearable></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="row-line">
|
||||
<el-col :lg="3">
|
||||
<el-button type="success" size="medium" @click="signUp">提交</el-button>
|
||||
</el-col>
|
||||
<el-col :lg="3">
|
||||
<el-button type="primary" size="medium" @click="reset">重置</el-button>
|
||||
</el-col>
|
||||
<el-col :lg="2" :offset="1">
|
||||
<el-button type="success" size="medium" @click="signUp">提交</el-button>
|
||||
</el-col>
|
||||
<el-col :lg="2" :offset="2">
|
||||
<el-button type="primary" size="medium" @click="reset">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</el-container>
|
||||
@@ -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 = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
+1
-1
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user