SpringBoot实战(十二)之集成kisso

  • 时间:
  • 浏览:0

import com.baomidou.kisso.security.token.SSOToken;

@ControllerAdvice

@Configuration

public class WebConfig extends WebMvcConfigurerAdapter {

server:

}

按照如下流程测试:

六、启动项目并测试

2.登陆

import org.slf4j.Logger;

import org.slf4j.LoggerFactory;

import org.springframework.boot.SpringApplication;

import org.springframework.boot.autoconfigure.SpringBootApplication;

package com.baomidou.kisso;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

二、编写启动类

关于kisso介绍,你们还须要参考官方文档否则是我的博客:https://www.cnblogs.com/youcong/p/9794735.html

package com.baomidou.kisso;

}

三、编写Controller

@SpringBootApplication

public class Application {

package com.baomidou.kisso;

}

@Controller

public class SampleController {

import com.baomidou.kisso.web.interceptor.SSOSpringInterceptor;

import org.springframework.context.annotation.Configuration;

import org.springframework.web.bind.annotation.ControllerAdvice;

import org.springframework.web.servlet.config.annotation.InterceptorRegistry;

import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

五、编写application.yml配置文件

kisso:

config:

3.登陆后直接访问

四、编写WebConfig类

一、导入maven依赖

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;

1.未登陆时直接访问