提交修改

This commit is contained in:
quyixiao 2020-08-18 11:01:54 +08:00
parent 56ce29ff30
commit 0fe6a7f58a
4 changed files with 97 additions and 13 deletions

View File

@ -180,14 +180,14 @@ public class SysLoginController extends AbstractController {
if (user.getStatus() == 0) {
return R.error("账号已被停用,请联系管理员");
}
String verifyCode = form.getVerifyCode();
CodeRecordEntity codeRecordEntity = codeRecordService.getOne(new QueryWrapper<CodeRecordEntity>().eq("send_account", user.getMobile()).eq("verify_code", verifyCode).eq("is_check", 0).ge("gmt_create", DateUtils.addDateMinutes(new Date(), -30)));
//String verifyCode = form.getVerifyCode();
// CodeRecordEntity codeRecordEntity = codeRecordService.getOne(new QueryWrapper<CodeRecordEntity>().eq("send_account", user.getMobile()).eq("verify_code", verifyCode).eq("is_check", 0).ge("gmt_create", DateUtils.addDateMinutes(new Date(), -30)));
if (codeRecordEntity == null) {
/* if (codeRecordEntity == null) {
return R.error("短信验证码不正确!");
}
codeRecordEntity.setIsCheck(1);
codeRecordService.updateById(codeRecordEntity);
codeRecordService.updateById(codeRecordEntity);*/
//生成token并保存到数据库
R r = sysUserTokenService.createToken(user.getUserId());

View File

@ -26,8 +26,8 @@ import java.util.Date;
@TableName("sys_user_token")
public class SysUserTokenEntity implements Serializable {
private static final long serialVersionUID = 1L;
//用户ID
@TableId(type = IdType.INPUT)
//
@TableId(value = "user_id", type = IdType.AUTO)
private Long userId;
//token
private String token;
@ -35,7 +35,92 @@ public class SysUserTokenEntity implements Serializable {
private Date expireTime;
//更新时间
private Date updateTime;
// 0 表示系统用户1 表示普通员工
private int type ;
//0表示系统用户1表示普通员工
private Integer type;
/**
*
* @return
*/
public Long getUserId() {
return userId;
}
/**
*
* @param userId
*/
public void setUserId(Long userId) {
this.userId = userId;
}
/**
* token
* @return
*/
public String getToken() {
return token;
}
/**
* token
* @param token
*/
public void setToken(String token) {
this.token = token;
}
/**
* 过期时间
* @return
*/
public Date getExpireTime() {
return expireTime;
}
/**
* 过期时间
* @param expireTime
*/
public void setExpireTime(Date expireTime) {
this.expireTime = expireTime;
}
/**
* 更新时间
* @return
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* 更新时间
* @param updateTime
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 0表示系统用户1表示普通员工
* @return
*/
public Integer getType() {
return type;
}
/**
* 0表示系统用户1表示普通员工
* @param type
*/
public void setType(Integer type) {
this.type = type;
}
@Override
public String toString() {
return "SysUserToken{" +
",userId=" + userId +
",token=" + token +
",expireTime=" + expireTime +
",updateTime=" + updateTime +
",type=" + type +
"}";
}
}

View File

@ -6,4 +6,7 @@
<select id="queryByToken" resultType="com.lz.modules.sys.entity.SysUserTokenEntity">
select * from sys_user_token where token = #{value}
</select>
</mapper>

View File

@ -61,8 +61,7 @@ public class MysqlMain {
}
List<TablesBean> list = new ArrayList<TablesBean>();
list.add(new TablesBean("lz_staff"));
list.add(new TablesBean("lz_result_record"));
list.add(new TablesBean("sys_user_token"));
List<TablesBean> list2 = new ArrayList<TablesBean>();
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();
@ -95,12 +94,9 @@ public class MysqlMain {
MysqlUtilTable2Service.printServiceImpl(list2.get(i));
}
for (int i = 0; i < list2.size(); i++) {
MysqlUtilTable2XML.printXMLForMap(list2.get(i));
}
}
}