新增用户工程问题bug解决和用户绑定登录权限

This commit is contained in:
liang.chao 2025-04-14 15:36:13 +08:00
parent c41ef3ef77
commit 1b7ed4f52c
5 changed files with 24 additions and 23 deletions

View File

@ -226,7 +226,7 @@ public class UserController {
UserDto userDto = userService.getById(data.getData().getId()); UserDto userDto = userService.getById(data.getData().getId());
List<SelectVo> projects = userService.getProjects(userDto); List<SelectVo> projects = userService.getProjects(userDto);
userDto.setProjects(projects); userDto.setProjects(projects);
/*String loginType = userDto.getLoginType(); String loginType = userDto.getLoginType();
if (loginType != null && !loginType.isEmpty()){ if (loginType != null && !loginType.isEmpty()){
String[] loginTypeArr = loginType.split(","); String[] loginTypeArr = loginType.split(",");
List<Long> loginTypes = new ArrayList<>(); List<Long> loginTypes = new ArrayList<>();
@ -234,7 +234,7 @@ public class UserController {
loginTypes.add(Long.parseLong(type.trim())); loginTypes.add(Long.parseLong(type.trim()));
} }
userDto.setLoginTypes(loginTypes); userDto.setLoginTypes(loginTypes);
}*/ }
return ServerResponse.createSuccess(userDto); return ServerResponse.createSuccess(userDto);
}catch (Exception e){ }catch (Exception e){
log.error(e.toString(),e); log.error(e.toString(),e);

View File

@ -53,7 +53,7 @@ public class UserServiceImpl implements UserService {
if (StringUtils.isNotBlank(project)){ if (StringUtils.isNotBlank(project)){
for (String proId : project.split(",")) { for (String proId : project.split(",")) {
// 新增工程 // 新增工程
userDao.saveUserProject(userDto.getId(), proId); userDao.saveUserProject(user.getId(), proId);
} }
} }
if (num > 0) { if (num > 0) {

View File

@ -52,12 +52,12 @@
</if> </if>
</select> </select>
<!--新增用户--> <!--新增用户-->
<insert id="saveUser" parameterType="com.bonus.imgTool.model.SysUser" > <insert id="saveUser" parameterType="com.bonus.imgTool.model.SysUser" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
insert into sys_user(login_name, user_name, insert into sys_user(login_name, user_name,
<if test="userCode != null and userCode != ''"> <if test="userCode != null and userCode != ''">
user_code, user_code,
</if> </if>
sex, org_id,login_type, role_id, phone, user_type, state, sex, org_id,login_type, role_id, user_type, state,
password, password,
<if test="teamId != null and teamId != ''"> <if test="teamId != null and teamId != ''">
team_id, team_id,
@ -67,7 +67,7 @@
<if test="userCode != null and userCode != ''"> <if test="userCode != null and userCode != ''">
#{userCode}, #{userCode},
</if> </if>
#{sex}, #{orgId},#{loginType}, #{roleId}, #{phone}, #{userType}, #{sex}, #{orgId},#{loginType}, #{roleId}, #{userType},
#{state}, #{state},
#{password}, #{password},
<if test="teamId != null and teamId != ''"> <if test="teamId != null and teamId != ''">

View File

@ -43,7 +43,7 @@ function setParams(params) {
let loginName = $('#loginName').val(); let loginName = $('#loginName').val();
if (loginName) { if (loginName) {
if (!(/^1[3456789]\d{9}$/.test(loginName))) { if (!(/^1[3456789]\d{9}$/.test(loginName))) {
return layer.alert("请输入正确的手机号", {icon: 2}) return layer.alert("登录账号请输入正确的手机号", {icon: 2})
} }
} }
if (!validatePassword(data.field.password)) { if (!validatePassword(data.field.password)) {
@ -287,15 +287,16 @@ function setFormData(data) {
formSelects.value('project', selectedValues); formSelects.value('project', selectedValues);
/*$('#teamId').val(data.teamId) /*$('#teamId').val(data.teamId)
$('#teamId option[value=' + data.teamId + ']').attr('selected', true)*/ $('#teamId option[value=' + data.teamId + ']').attr('selected', true)*/
// var arrCB = data.loginTypes; var arrCB = data.loginTypes;
// for (var j = 0; j < arrCB.length; j++) { console.log(arrCB+"arrCB");
// var cbthis = $("input[name='loginType']"); for (var j = 0; j < arrCB.length; j++) {
// for (var i = 0; i < cbthis.length; i++) { var cbthis = $("input[name='loginType']");
// if (cbthis[i].value == arrCB[j]) { for (var i = 0; i < cbthis.length; i++) {
// cbthis[i].checked = true; if (cbthis[i].value == arrCB[j]) {
// } cbthis[i].checked = true;
// } }
// } }
}
layui.form.render(); layui.form.render();
} }
} }
@ -309,16 +310,16 @@ function saveData(data) {
let loadingMsg = layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0}); let loadingMsg = layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0});
let url = dataUrl + "/users/addTemp"; let url = dataUrl + "/users/addTemp";
let params = data.field; let params = data.field;
// var arr_box = [];//固定复选框 var arr_box = [];//固定复选框
// $('#cbGuDing input[type=checkbox]:checked').each(function () { $('#cbGuDing input[type=checkbox]:checked').each(function () {
// arr_box.push($(this).val()); arr_box.push($(this).val());
// }); });
// var arr_pro = [];//固定复选框 // var arr_pro = [];//固定复选框
// $('#project input[type=checkbox]:checked').each(function () { // $('#project input[type=checkbox]:checked').each(function () {
// arr_pro.push($(this).val()); // arr_pro.push($(this).val());
// }); // });
// params.loginType = arr_box.join() params.loginType = arr_box.join()
// params.project = arr_pro.join() // params.project = arr_pro.join()
// params.orgId = params.orgId_select_nodeId; // params.orgId = params.orgId_select_nodeId;
if (params.id != "") { if (params.id != "") {

View File

@ -115,7 +115,7 @@
</div> </div>
</div>--> </div>-->
<!-- <div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><i style="padding: 0 10px;">*</i>登录权限</label> <label class="layui-form-label"><i style="padding: 0 10px;">*</i>登录权限</label>
<div class="layui-input-inline" id="cbGuDing" > <div class="layui-input-inline" id="cbGuDing" >
<input type="checkbox" name="loginType" value="1" title="后台" lay-skin="primary" checked> <input type="checkbox" name="loginType" value="1" title="后台" lay-skin="primary" checked>
@ -123,7 +123,7 @@
<input type="checkbox" name="loginType" value="3" title="app" lay-skin="primary"> <input type="checkbox" name="loginType" value="3" title="app" lay-skin="primary">
<input type="hidden" id="loginType" /> <input type="hidden" id="loginType" />
</div> </div>
</div>--> </div>
<div class="layui-form-item" style="margin-top: 2%;" id="pwd"> <div class="layui-form-item" style="margin-top: 2%;" id="pwd">
<label class="layui-form-label"><i style="padding: 0 10px;">*</i>密码</label> <label class="layui-form-label"><i style="padding: 0 10px;">*</i>密码</label>