mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue
Conflicts: ruoyi-ui/package.json ruoyi-ui/src/views/system/menu/index.vue ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java ruoyi/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java ruoyi/src/main/java/com/ruoyi/common/utils/sign/Md5Utils.java ruoyi/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java ruoyi/src/main/java/com/ruoyi/project/system/controller/SysLoginController.java ruoyi/src/main/java/com/ruoyi/project/system/domain/SysUser.java ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysUserServiceImpl.java
This commit is contained in:
		@@ -65,9 +65,6 @@
 | 
			
		||||
    "vuex": "3.1.0"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@babel/core": "7.0.0",
 | 
			
		||||
    "@babel/register": "7.0.0",
 | 
			
		||||
    "@babel/parser": "^7.7.4",
 | 
			
		||||
    "@vue/cli-plugin-babel": "3.5.3",
 | 
			
		||||
    "@vue/cli-plugin-eslint": "^3.9.1",
 | 
			
		||||
    "@vue/cli-plugin-unit-jest": "3.5.3",
 | 
			
		||||
 
 | 
			
		||||
@@ -49,16 +49,16 @@
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <el-button size="mini"
 | 
			
		||||
            type="text"
 | 
			
		||||
            icon="el-icon-edit"
 | 
			
		||||
          <el-button size="mini" 
 | 
			
		||||
            type="text" 
 | 
			
		||||
            icon="el-icon-edit" 
 | 
			
		||||
            @click="handleUpdate(scope.row)"
 | 
			
		||||
            v-hasPermi="['system:menu:edit']"
 | 
			
		||||
          >修改</el-button>
 | 
			
		||||
          <el-button
 | 
			
		||||
            size="mini"
 | 
			
		||||
            type="text"
 | 
			
		||||
            icon="el-icon-plus"
 | 
			
		||||
          <el-button 
 | 
			
		||||
            size="mini" 
 | 
			
		||||
            type="text" 
 | 
			
		||||
            icon="el-icon-plus" 
 | 
			
		||||
            @click="handleAdd(scope.row)"
 | 
			
		||||
            v-hasPermi="['system:menu:add']"
 | 
			
		||||
          >新增</el-button>
 | 
			
		||||
@@ -314,8 +314,10 @@ export default {
 | 
			
		||||
    handleAdd(row) {
 | 
			
		||||
      this.reset();
 | 
			
		||||
      this.getTreeselect();
 | 
			
		||||
      if (row != null) {
 | 
			
		||||
      if (row != null && row.menuId) {
 | 
			
		||||
        this.form.parentId = row.menuId;
 | 
			
		||||
      } else {
 | 
			
		||||
        this.form.parentId = 0;
 | 
			
		||||
      }
 | 
			
		||||
      this.open = true;
 | 
			
		||||
      this.title = "添加菜单";
 | 
			
		||||
@@ -369,4 +371,4 @@ export default {
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
</script>
 | 
			
		||||
@@ -9,13 +9,13 @@ import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException;
 | 
			
		||||
import com.ruoyi.common.exception.file.FileSizeLimitExceededException;
 | 
			
		||||
import com.ruoyi.common.exception.file.InvalidExtensionException;
 | 
			
		||||
import com.ruoyi.common.utils.DateUtils;
 | 
			
		||||
import com.ruoyi.common.utils.IdUtils;
 | 
			
		||||
import com.ruoyi.common.utils.StringUtils;
 | 
			
		||||
import com.ruoyi.common.utils.security.Md5Utils;
 | 
			
		||||
import com.ruoyi.framework.config.RuoYiConfig;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 文件上传工具类
 | 
			
		||||
 *
 | 
			
		||||
 * 
 | 
			
		||||
 * @author ruoyi
 | 
			
		||||
 */
 | 
			
		||||
public class FileUploadUtils
 | 
			
		||||
@@ -35,8 +35,6 @@ public class FileUploadUtils
 | 
			
		||||
     */
 | 
			
		||||
    private static String defaultBaseDir = RuoYiConfig.getProfile();
 | 
			
		||||
 | 
			
		||||
    private static int counter = 0;
 | 
			
		||||
 | 
			
		||||
    public static void setDefaultBaseDir(String defaultBaseDir)
 | 
			
		||||
    {
 | 
			
		||||
        FileUploadUtils.defaultBaseDir = defaultBaseDir;
 | 
			
		||||
@@ -82,7 +80,6 @@ public class FileUploadUtils
 | 
			
		||||
        }
 | 
			
		||||
        catch (Exception e)
 | 
			
		||||
        {
 | 
			
		||||
            e.printStackTrace();
 | 
			
		||||
            throw new IOException(e.getMessage(), e);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
@@ -126,7 +123,7 @@ public class FileUploadUtils
 | 
			
		||||
    {
 | 
			
		||||
        String fileName = file.getOriginalFilename();
 | 
			
		||||
        String extension = getExtension(file);
 | 
			
		||||
        fileName = DateUtils.datePath() + "/" + encodingFilename(fileName) + "." + extension;
 | 
			
		||||
        fileName = DateUtils.datePath() + "/" + IdUtils.fastUUID() + "." + extension;
 | 
			
		||||
        return fileName;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -154,16 +151,6 @@ public class FileUploadUtils
 | 
			
		||||
        return pathFileName;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 编码文件名
 | 
			
		||||
     */
 | 
			
		||||
    private static final String encodingFilename(String fileName)
 | 
			
		||||
    {
 | 
			
		||||
        fileName = fileName.replace("_", " ");
 | 
			
		||||
        fileName = Md5Utils.hash(fileName + System.nanoTime() + counter++);
 | 
			
		||||
        return fileName;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件大小校验
 | 
			
		||||
     *
 | 
			
		||||
@@ -229,7 +216,7 @@ public class FileUploadUtils
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取文件名的后缀
 | 
			
		||||
     *
 | 
			
		||||
     * 
 | 
			
		||||
     * @param file 表单文件
 | 
			
		||||
     * @return 后缀名
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -204,7 +204,7 @@ public class HttpUtils
 | 
			
		||||
            String ret = "";
 | 
			
		||||
            while ((ret = br.readLine()) != null)
 | 
			
		||||
            {
 | 
			
		||||
                if (ret != null && !ret.trim().equals(""))
 | 
			
		||||
                if (ret != null && !"".equals(ret.trim()))
 | 
			
		||||
                {
 | 
			
		||||
                    result.append(new String(ret.getBytes("ISO-8859-1"), "utf-8"));
 | 
			
		||||
                }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package com.ruoyi.common.utils.security;
 | 
			
		||||
package com.ruoyi.common.utils.sign;
 | 
			
		||||
 | 
			
		||||
import java.security.MessageDigest;
 | 
			
		||||
import org.slf4j.Logger;
 | 
			
		||||
@@ -40,7 +40,7 @@ public class SysLoginService
 | 
			
		||||
     * 
 | 
			
		||||
     * @param username 用户名
 | 
			
		||||
     * @param password 密码
 | 
			
		||||
     * @param captcha 验证码
 | 
			
		||||
     * @param code 验证码
 | 
			
		||||
     * @param uuid 唯一标识
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RestController;
 | 
			
		||||
import com.ruoyi.common.exception.job.TaskException;
 | 
			
		||||
import com.ruoyi.common.utils.SecurityUtils;
 | 
			
		||||
import com.ruoyi.common.utils.job.CronUtils;
 | 
			
		||||
import com.ruoyi.common.utils.poi.ExcelUtil;
 | 
			
		||||
import com.ruoyi.framework.aspectj.lang.annotation.Log;
 | 
			
		||||
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 | 
			
		||||
@@ -77,6 +79,11 @@ public class SysJobController extends BaseController
 | 
			
		||||
    @PostMapping
 | 
			
		||||
    public AjaxResult add(@RequestBody SysJob sysJob) throws SchedulerException, TaskException
 | 
			
		||||
    {
 | 
			
		||||
        if (!CronUtils.isValid(sysJob.getCronExpression()))
 | 
			
		||||
        {
 | 
			
		||||
            return AjaxResult.error("cron表达式不正确");
 | 
			
		||||
        }
 | 
			
		||||
        sysJob.setCreateBy(SecurityUtils.getUsername());
 | 
			
		||||
        return toAjax(jobService.insertJob(sysJob));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -88,6 +95,11 @@ public class SysJobController extends BaseController
 | 
			
		||||
    @PutMapping
 | 
			
		||||
    public AjaxResult edit(@RequestBody SysJob sysJob) throws SchedulerException, TaskException
 | 
			
		||||
    {
 | 
			
		||||
        if (!CronUtils.isValid(sysJob.getCronExpression()))
 | 
			
		||||
        {
 | 
			
		||||
            return AjaxResult.error("cron表达式不正确");
 | 
			
		||||
        }
 | 
			
		||||
        sysJob.setUpdateBy(SecurityUtils.getUsername());
 | 
			
		||||
        return toAjax(jobService.updateJob(sysJob));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -42,7 +42,7 @@ public class SysLoginController
 | 
			
		||||
    /**
 | 
			
		||||
     * 登录方法
 | 
			
		||||
     * 
 | 
			
		||||
     * @param loginBody 登陆信息
 | 
			
		||||
     * @param loginBody 登录信息
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    @PostMapping("/login")
 | 
			
		||||
 
 | 
			
		||||
@@ -297,7 +297,7 @@ public class SysUser extends BaseEntity
 | 
			
		||||
    {
 | 
			
		||||
        this.postIds = postIds;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
 | 
			
		||||
 
 | 
			
		||||
@@ -454,5 +454,4 @@ public class SysUserServiceImpl implements ISysUserService
 | 
			
		||||
        }
 | 
			
		||||
        return successMsg.toString();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user