zjh
2024-07-09 92614e60db568c9dc2e9cc7806821fb97646545b
zjh 2024/07/9-1
2个文件已修改
45 ■■■■ 已修改文件
ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysConfigController.java 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-framework/src/main/java/com/ltkj/framework/config/SecurityConfig.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysConfigController.java
@@ -1,24 +1,25 @@
package com.ltkj.web.controller.system;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.ltkj.common.core.domain.entity.SysMenu;
import com.ltkj.common.utils.SecurityUtils;
import com.ltkj.hosp.domain.DictHosp;
import com.ltkj.hosp.service.IDictHospService;
import com.ltkj.system.service.ISysMenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.ltkj.common.annotation.Log;
import com.ltkj.common.constant.UserConstants;
import com.ltkj.common.core.controller.BaseController;
@@ -42,6 +43,11 @@
    private ISysConfigService configService;
    @Autowired
    private ISysMenuService menuService;
    @Resource
    private IDictHospService dictHospService;
    @Value ("${token.secret_key}")
    private String secret;
    /**
     * 获取参数配置列表
     */
@@ -152,4 +158,24 @@
        return success();
    }
    @GetMapping ("/zx")//执行
    public AjaxResult zx(@RequestParam int day) {
        try {
            List<DictHosp> list = dictHospService.list();
            DateTime dateTime1 = DateUtil.offsetMonth(new Date(), day);
            for (DictHosp dictHosp : list) {
                String mallMerchantSecretKey = SecurityUtils.getMallMerchantSecretKey(secret, dictHosp.getHospAreaId(), dictHosp.getHospAreaName(), dateTime1);
                dictHosp.setSecretKey(mallMerchantSecretKey);
                dictHosp.setExpirationTime(dateTime1);
                dictHosp.setUpdateTime(new Date());
                dictHospService.updateById(dictHosp);
            }
            return AjaxResult.success();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return AjaxResult.error();
    }
}
ltkj-framework/src/main/java/com/ltkj/framework/config/SecurityConfig.java
@@ -108,7 +108,8 @@
                // 过滤请求
                .authorizeRequests()
                // 对于登录login 注册register 验证码captchaImage 允许匿名访问
                .antMatchers("/login", "/register", "/captchaImage","/cus/**","/getCaptchaConfigKey","/report/jmreport/**","/sqlserver/getdata/**","/api/His/**").permitAll()
                .antMatchers("/login", "/register", "/captchaImage","/cus/**","/getCaptchaConfigKey","/report/jmreport/**",
                        "/sqlserver/getdata/**","/api/His/**","/system/config/zx").permitAll()
                .antMatchers("/common/uploadImgExe","/common/listExeVal").permitAll()
                // 静态资源,可匿名访问
                .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()