Browse Source

修改账号有效期不置空问题。将业务配置员改为业务用户

xusl 1 năm trước cách đây
mục cha
commit
c2e0aae82c

+ 4 - 4
backend/src/main/java/com/jiayue/ssi/controller/SysParameterController.java

@@ -41,7 +41,7 @@ public class SysParameterController {
      * @return 执行结果
      */
     @PostMapping(value = "/addParameter")
-    @OperateLog(title = "参数管理", businessType = BusinessType.INSERT, auditType = AuditType.SYS,operdesc = "新增参数信息")
+    @OperateLog(title = "参数管理", businessType = BusinessType.INSERT, auditType = AuditType.BIZ,operdesc = "新增参数信息")
     @PreAuthorize("@ss.hasPermi('system:config:add')")
     @PreventReplay
     public ResponseVO addParameter(@RequestBody SysParameter sysParameter) throws CustomException {
@@ -93,7 +93,7 @@ public class SysParameterController {
      * @return 执行结果
      */
     @PostMapping(value = "/updateParameter")
-    @OperateLog(title = "参数管理", businessType = BusinessType.UPDATE, auditType = AuditType.SYS,operdesc = "修改参数信息")
+    @OperateLog(title = "参数管理", businessType = BusinessType.UPDATE, auditType = AuditType.BIZ,operdesc = "修改参数信息")
     @PreAuthorize("@ss.hasPermi('system:config:edit')")
     @PreventReplay
     public ResponseVO updateParameter(@RequestBody SysParameter sysParameter) throws CustomException {
@@ -155,7 +155,7 @@ public class SysParameterController {
      * 删除用户信息
      */
     @PostMapping(value = "/deleteParameter")
-    @OperateLog(title = "参数管理", businessType = BusinessType.DELETE, auditType = AuditType.SYS,operdesc = "删除参数信息")
+    @OperateLog(title = "参数管理", businessType = BusinessType.DELETE, auditType = AuditType.BIZ,operdesc = "删除参数信息")
     @PreAuthorize("@ss.hasPermi('system:config:remove')")
     @PreventReplay
     public ResponseVO deleteParameter(String id) throws CustomException {
@@ -190,7 +190,7 @@ public class SysParameterController {
      */
     @GetMapping(value = "/getAll")
     @PreAuthorize("@ss.hasPermi('system:config:list')")
-    @OperateLog(title = "参数管理", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "查询参数信息")
+    @OperateLog(title = "参数管理", businessType = BusinessType.QUERY, auditType = AuditType.BIZ,operdesc = "查询参数信息")
     @PreventReplay
     public ResponseVO getAll(String currentPage, String pageSize, String keywords) throws CustomException {
         try {

+ 2 - 0
backend/src/main/java/com/jiayue/ssi/controller/SysUserController.java

@@ -144,6 +144,7 @@ public class SysUserController {
      * 新增用户
      */
     @PostMapping(value = "/addUser")
+    @AgainVerify
     @OperateLog(title = "用户管理", businessType = BusinessType.INSERT, auditType = AuditType.SYS,operdesc = "新增用户")
     @PreAuthorize("@ss.hasPermi('system:user:add')")
     @PreventReplay
@@ -646,6 +647,7 @@ public class SysUserController {
      * 用户授权角色
      */
     @PostMapping("/authRole")
+    @AgainVerify
     @PreAuthorize("@ss.hasPermi('system:user:role')")
     @OperateLog(title = "用户管理", businessType = BusinessType.GRANT, auditType = AuditType.SYS,operdesc = "用户授权角色")
     @PreventReplay

+ 1 - 1
backend/src/main/java/com/jiayue/ssi/entity/SysUser.java

@@ -85,7 +85,7 @@ public class SysUser extends BaseEntity implements UserDetails {
     /**
      * 账号有效期
      */
-    @TableField(value = "exp_date",fill = FieldFill.INSERT_UPDATE)
+//    @TableField(value = "exp_date",fill = FieldFill.INSERT_UPDATE)
     @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
     private Date expDate;
 

+ 15 - 0
backend/src/main/java/com/jiayue/ssi/mapper/SysUserMapper.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Update;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -30,4 +31,18 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
      */
     @Update("update sys_user t set t.password=#{password},t.last_update_pwd_time=null where t.id=#{id}")
     public int resetPassword(Long id, String password);
+    /**
+     * 修改审核标识
+     *
+     * @param signstr 新密码
+     * @return 结果
+     */
+    @Update("update sys_user t set t.signstr=#{signstr} where t.id=#{id}")
+    public int updateSignstr(Long id, String signstr);
+    /**
+     * 修改基本信息
+     * @return 结果
+     */
+    @Update("update sys_user t set t.signstr=#{signstr},t.nickname=#{nickname},t.mailbox=#{mailbox},t.phonenumber=#{phonenumber},t.exp_date=#{exp_date} where t.id=#{id}")
+    public int updateBaseInfo(Long id, String signstr, String nickname, String mailbox, String phonenumber, Date exp_date);
 }

+ 12 - 8
backend/src/main/java/com/jiayue/ssi/service/impl/SysApproveServiceImpl.java

@@ -66,17 +66,21 @@ public class SysApproveServiceImpl extends ServiceImpl<SysApproveMapper, SysAppr
             }
             else if (newsysApprove.getOperation().equals(String.valueOf(ApproveOperaterEnum.UPDATE.getCode()))){
                 // 修改操作
-                SysUser sysUser = new SysUser();
-                sysUser.setId(Long.parseLong(newsysApprove.getMasterId()));
+
                 if ("0".equals(newsysApprove.getApproveResult())){
                     // 审核通过,修改姓名、邮箱、手机号、有效日期
-                    sysUser.setNickname(newsysApprove.getNickname());
-                    sysUser.setMailbox(newsysApprove.getMailbox());
-                    sysUser.setPhonenumber(newsysApprove.getPhonenumber());
-                    sysUser.setExpDate(newsysApprove.getExpDate());
+//                    sysUser.setNickname(newsysApprove.getNickname());
+//                    sysUser.setMailbox(newsysApprove.getMailbox());
+//                    sysUser.setPhonenumber(newsysApprove.getPhonenumber());
+//                    sysUser.setExpDate(newsysApprove.getExpDate());
+                    sysUserMapper.updateBaseInfo(Long.parseLong(newsysApprove.getMasterId()), "0", newsysApprove.getNickname(), newsysApprove.getMailbox(), newsysApprove.getPhonenumber(), newsysApprove.getExpDate());
+                }
+                else{
+                    SysUser sysUser = new SysUser();
+                    sysUser.setId(Long.parseLong(newsysApprove.getMasterId()));
+                    sysUser.setSignstr("0");
+                    sysUserMapper.updateById(sysUser);
                 }
-                sysUser.setSignstr("0");
-                sysUserMapper.updateById(sysUser);
             }
             else if (newsysApprove.getOperation().equals(String.valueOf(ApproveOperaterEnum.DELETE.getCode()))){
                 // 注销操作

+ 109 - 55
ui/src/views/sysManager/userManager/index.vue

@@ -712,30 +712,58 @@ export default {
             }).catch((e) => {
             })
           } else {
-            let sysTime
-            let lk
-            await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
-              sysTime = res.data.sysTime
-              lk = res.data.lk
-            }).catch((error) => {
-            })
-
-            this.form.sysTime = sysTime
-            this.form.lk = lk
-            await this.$axios.post('/sysUserController/addUser', this.form).then((res) => {
-              if (res.code == 0) {
-                this.$message.success(res.data)
-                this.open = false;
-                this.reset();
-                this.getList();
-              }
-              if (res.code == 1) {
-                this.$message.error(res.data)
+            this.$prompt('请输入登录密码', '鉴别操作', {
+              confirmButtonText: '确定',
+              cancelButtonText: '取消',
+              inputType: 'text',
+              customClass:'no-autofill-pwd',
+              inputValidator: (val) => {
+                if (val === null || val.length < 1 || val.length > 20) {
+                  return false;
+                }
+              },
+              inputErrorMessage: '不能为空,最多可录入20个字符',
+              beforeClose(action, instance, done) {
+                if (action === "confirm") {
+                  instance.$refs["confirm"].$el.onclick = (function (e) {
+                    e = e || window.event;
+                    if (e.detail != 0) {
+                      done();
+                    }
+                  })();
+                } else {
+                  done();
+                }
               }
-              this.loading = false
-            }).catch((error) => {
-              // this.$message.error(error)
-              this.loading = false
+            }).then(async ({value}) => {
+              let sysTime
+              let lk
+              await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
+                sysTime = res.data.sysTime
+                lk = res.data.lk
+              }).catch((error) => {
+              })
+              this.form.sysTime = sysTime
+              this.form.lk = lk
+              this.form.againPwd = value
+
+              // 更新操作
+              await this.$axios.post('/sysUserController/addUser', this.form).then((res) => {
+                if (res.code == 0) {
+                  this.$message.success(res.data)
+                  this.open = false;
+                  this.reset();
+                  this.getList();
+                }
+                if (res.code == 1) {
+                  this.$message.error(res.data)
+                }
+                this.loading = false
+              }).catch((error) => {
+                // this.$message.error(error)
+                this.loading = false
+              })
+            }).catch((e) => {
             })
           }
         }
@@ -1256,42 +1284,68 @@ export default {
 
     /** 角色分配提交按钮 */
     jssubmitForm: debounce(async function () {
+      this.$prompt('请输入登录密码', '鉴别操作', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        inputType: 'text',
+        customClass:'no-autofill-pwd',
+        inputValidator: (val) => {
+          if (val === null || val.length < 1 || val.length > 20) {
+            return false;
+          }
+        },
+        inputErrorMessage: '不能为空,最多可录入20个字符',
+        beforeClose(action, instance, done) {
+          if (action === "confirm") {
+            instance.$refs["confirm"].$el.onclick = (function (e) {
+              e = e || window.event;
+              if (e.detail != 0) {
+                done();
+              }
+            })();
+          } else {
+            done();
+          }
+        }
+      }).then(async ({value}) => {
+        let sysTime
+        let lk
+        await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
+          sysTime = res.data.sysTime
+          lk = res.data.lk
+        }).catch((error) => {
+        })
 
-      let sysTime
-      let lk
-      await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
-        sysTime = res.data.sysTime
-        lk = res.data.lk
-      }).catch((error) => {
-      })
-
-      // 提交后台角色分配
-      const param = {
-        userId: this.jsuserid,
-        roleId: this.userRoleId,
-        sysTime: sysTime,
-        lk: lk
-      }
-      await this.$axios.post('/sysUserController/authRole', param).then((res) => {
-        if (res.code == 0) {
-          this.$message({
-            type: 'success',
-            message: res.data
-          });
-          this.jscancel()
-          this.getList()
-        } else {
+        // 提交后台角色分配
+        const param = {
+          userId: this.jsuserid,
+          roleId: this.userRoleId,
+          sysTime: sysTime,
+          lk: lk,
+          againPwd: value
+        }
+        await this.$axios.post('/sysUserController/authRole', param).then((res) => {
+          if (res.code == 0) {
+            this.$message({
+              type: 'success',
+              message: res.data
+            });
+            this.jscancel()
+            this.getList()
+          } else {
+            this.$message({
+              type: 'error',
+              message: res.data
+            });
+          }
+        }).catch((error) => {
           this.$message({
             type: 'error',
-            message: res.data
+            message: '角色分配失败!'
           });
-        }
-      }).catch((error) => {
-        this.$message({
-          type: 'error',
-          message: '角色分配失败!'
-        });
-        this.loading = false
+          this.loading = false
+        })
+      }).catch((e) => {
       })
     }, 1000)
   }