陈昶聿
4 天以前 8107dedd85ceec29491293d8ebf69f7d7213aa6b
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
@@ -20,6 +20,7 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.view.RedirectView;
@@ -58,6 +59,9 @@
    @Autowired
    @Qualifier("sysUserDeptSystemMapper")
    private SysUserDeptMapper sysUserDeptMapper;
    @Value("${spring.profiles.active}")
    private String active;
//    @Value("${wx_appid}")
//    private String wxAppid;
@@ -125,14 +129,21 @@
//    @IpWhitelist
    @GetMapping("/SSOLogin")
    public RedirectView SSOLogin(@RequestParam(required = false) String campusid, @RequestParam(required = false) String deptId, @RequestParam(required = false) String systype, String orgid, String userName, String token) {
      log.info("SSOLogin的入参,campusid:{},  deptId:{},  systype:{},  orgid:{},  userName:{},  token:{}",campusid,deptId,systype,orgid,userName,token);
        log.info("SSOLogin的入参,campusid:{},  deptId:{},  systype:{},  orgid:{},  userName:{},  token:{}", campusid, deptId, systype, orgid, userName, token);
        if (StringUtils.isEmpty(userName) && StringUtils.isEmpty(token) && StringUtils.isEmpty(orgid)) {
            throw new BaseException("参数不能为空");
        }
        String path = null;
        if (StringUtils.isEmpty(systype)) path = sysConfigService.selectConfigByKey("sys.qddz");
        else path = sysConfigService.selectConfigByKey("sys.qddz.yd");
        log.info("qddz的查询值为,path:{}",path);
        if (active.equals("nhfy")){
            //南华附一的,先不走免登,直接跳到登陆页
            path = sysConfigService.selectConfigByKey("sys.qddz.yd");
            log.info("【NHFYSSO登录】重定向地址:{}", path);
            return buildRedirect(path);
        }
            log.info("qddz的查询值为,path:{}", path);
        if (StringUtils.isEmpty(path)) {
            throw new BaseException("请配置前端地址");