1.前端打包复制到springboot项目中
2.配置
thymeleaf:
prefix: classpath:/templates/
suffix: .html
cache: false
servlet:
content-type: text/html
enabled: true
encoding: UTF-8
mode: LEGACYHTML5\
3.控制层视图
package com.lys.lys_admin_api.module.sys.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class ViewController {
@GetMapping(value = "/index")
public String ws(){
return "index";
}
}
4.效果