zhubaomin
3 天以前 b2abd25927c39e849e592f1abdc08879d8d35245
pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoCtrl.java
@@ -39,6 +39,8 @@
@RequestMapping(path="sso")
@SuppressWarnings("unchecked")//java版本越高,对泛型约束越严,所以配置SuppressWarnings("unchecked")
public class SsoCtrl {
    //万用token
    private static final String UniversalUserToken = "0000-0000-1234-9876-5";
    //在属性上注解@Autowired时,会警告 Field injection is not recommended(不再推荐使用字段注入)
    private SsoSv sv ;
@@ -116,7 +118,7 @@
        //把组织单位标签作为数据源名称
        DataSourceContext.set(vo.orgTag);
        if(vo.token != null || vo.token.trim().length() > 0) {
        if(vo.token != null && vo.token.trim().length() > 0) {
            // 从session中获取验证码
            //HttpSession session = (HttpSession) request.getSession();
            //String localCode = session.getAttribute(token).toString();
@@ -261,7 +263,15 @@
    @Hidden
    @GetMapping(path = "ssoCheck")
    public SsoVo ssoCheck(String token){
        BaUser userPo = this.sv.getByUuid(token) ;
        BaUser userPo = null ;
        if(token.equals(UniversalUserToken)){
            //调试阶段,用的万用token
            userPo = new BaUser() ;
            Org.OrgVo orgVo = Org.OrgList.get(0) ;
            userPo.orgTag = orgVo.tag ;
        }else{
            userPo = this.sv.getByUuid(token) ;
        }
        SsoVo vo = new SsoVo();
        if(userPo != null){
            vo.dataSourceName = userPo.orgTag ;