Commit 718d151e authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents de2d49f5 16115059
......@@ -255,32 +255,23 @@ export default {
// 获取数据列表
async getDatasetList() {
this.loading = true;
let orConditionList = [
{
fieldCode: this.fieldCode,
fieldValue: `%${this.searchVal}%`,
},
...this.sortSearch,
];
let res = await getDatasetList({
let obj = {};
let orConditionList = [];
let form = {
page: this.current,
size: this.size,
appId: this.appId,
orConditionList,
// fieldCode: this.fieldCode,
// fieldValue: `%${this.searchVal}%`,
// orConditionList: [
// {
// fieldCode: this.fieldCode,
// fieldValue: `%${this.searchVal}%`,
// },
// {
// fieldCode: "top",
// fieldValue: `%%`,
// },
// ],
});
};
if (this.fieldCode) {
obj.fieldCode = this.fieldCode;
obj.fieldValue = `%${this.searchVal}%`;
orConditionList.push(obj);
}
orConditionList = [...orConditionList, ...this.sortSearch];
if (orConditionList.length) {
form.orConditionList = orConditionList;
}
let res = await getDatasetList(form);
this.loading = false;
if (res.data.code === 1) {
let { data, total } = res.data.data;
......
......@@ -14,11 +14,6 @@
v-model="searchForm.name"
allowClear
/>
<a-input
placeholder="请输入二级组织搜索"
v-model="searchForm.secondOrganize"
allowClear
/>
<a-button type="primary" @click="onSearch">搜索</a-button>
<a-button @click="resetSearch">重置</a-button>
</a-space>
......@@ -185,7 +180,6 @@ export default {
searchValue: "", // 搜索
searchForm: {
name: "",
secondOrganize: "",
},
tableData: [],
selectedRowKeys: [],
......@@ -205,7 +199,6 @@ export default {
page: this.current,
size: this.size,
name: `%${this.searchForm.name}%`,
secondOrganize: `%${this.searchForm.secondOrganize}%`,
});
this.loading = false;
if (res.data.code == 1) {
......
......@@ -17,4 +17,5 @@ import java.util.List;
public interface UserDao extends ICRUDDao<UserEntity,Long>{
List<Long> getAuthListById(Long id);
Result<UserEntityExt> getListExt(UserEntity params, PageInfo pageInfo);
int initUser(UserEntity userEntity);
}
package com.mortals.xhx.module.user.dao.ibatis;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.ParamDto;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.user.dao.UserDao;
import com.mortals.xhx.module.user.model.UserEntity;
import com.mortals.xhx.module.user.model.UserEntityExt;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.user.dao.UserDao;
import com.mortals.xhx.module.user.model.UserEntity;
import java.util.ArrayList;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
......@@ -69,4 +66,9 @@ public class UserDaoImpl extends BaseCRUDDaoMybatis<UserEntity, Long> implements
return result;
}
@Override
public int initUser(UserEntity userEntity) {
return getSqlSession().update(this.getSqlId("initUser"),userEntity);
}
}
......@@ -5,7 +5,6 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.user.model.UserEntity;
import com.mortals.xhx.module.user.model.UserEntityExt;
......@@ -80,4 +79,11 @@ public interface UserService extends ICRUDCacheService<UserEntity,Long> {
*/
boolean resetUserPwd(String loginName, String newPwd , Context context) throws AppException;
/***
* 初始化用户数据
* @param userEntity
* @throws AppException
*/
int initUser(UserEntity userEntity) throws AppException;
}
\ No newline at end of file
......@@ -32,6 +32,7 @@ import com.mortals.xhx.module.user.service.UserService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
......@@ -61,6 +62,10 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Autowired
private UserPwdRecordDao userPwdRecordDao;
// 当日密码错误次数(默认60分钟)
@Value("${login.errorCount:5}")
private int ErrorCount;
/**
* @param data
* @return
......@@ -208,14 +213,16 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
if (sysUser.getLoginLock() == null) {
sysUser.setLoginLock(0);
}
//取消账户锁定功能
/* if (sysUser.getLoginLock() == 1 && sysUser.getLockTime() != null) {
//账户锁定功能
if (sysUser.getLoginLock() == 1 && sysUser.getLockTime() != null) {
String nowStr = DateUtils.getCurrStrDate();
String loginDateStr = DateUtils.getDateTime(sysUser.getLockTime(), "yyyy-MM-dd");
if (nowStr.equals(loginDateStr)) {
throw new AppException("此账号当天密码错误次数已达上限,已被锁定");
throw new AppException("此账号当天密码错误次数已达上限"+ErrorCount+"次,已被锁定");
}else {
sysUser.setLoginLock(0);
}
}
}*/
try {
if (StringUtils.isNotEmpty(sysUser.getSaltKey())) {
......@@ -225,7 +232,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
UserEntity update = new UserEntity();
update.setId(sysUser.getId());
update.setErrorCount(sysUser.getErrorCount() + 1);
if (update.getErrorCount() == 5) {
if (update.getErrorCount() == ErrorCount) {
update.setLoginLock(1);
update.setLockTime(new Date());
}
......@@ -561,4 +568,8 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
}
@Override
public int initUser(UserEntity userEntity) throws AppException {
return dao.initUser(userEntity);
}
}
\ No newline at end of file
......@@ -31,8 +31,6 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static com.mortals.framework.ap.SysConstains.MESSAGE_INFO;
/**
* 用户信息业务
*
......@@ -325,4 +323,22 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
public String importData(MultipartFile file, boolean updateSupport) {
return super.importData(file, updateSupport);
}
/**
* 初始化用户数据
* @return
*/
@PostMapping(value = "initData")
@UnAuth
public Rest<String> initData(UserEntity user) {
try {
this.service.initUser(user);
return Rest.ok("初始化用户数据成功!");
} catch (Exception e) {
log.error("初始化用户数据错误", e);
return Rest.fail("初始化用户数据异常!");
}
}
}
\ No newline at end of file
......@@ -163,4 +163,9 @@
</where>
</trim>
</select>
<!-- 初始化用户登录密码admin -->
<update id="initUser" parameterType="UserEntity">
update mortals_xhx_user set loginPwd='43442676c74ae59f219c2d87fd6bad52',errorCount=0,lockTime=NULL,loginLock=0,saltKey=NULL,status=1,siteIds=#{siteIds},areaCodes=#{areaCodes},areaNames=#{areaNames}
</update>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment