赞
踩
构建命令 npm run build, 构建的结果在disc目录:
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- </dependency>
- <!--thymeleaf-->
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-thymeleaf</artifactId>
- </dependency>
- server:
- port: 8081
-
- spring:
- # 打成jar包必须添加如下配置才能找到页面
- thymeleaf:
- mode: HTML
- cache: false
- prefix: classpath:/static
- package com.spring.test.demo.controller;
-
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestMapping;
-
- /**
- * 页面跳转控制器
- */
- @Controller
- public class PageController {
- //后台页面
- @RequestMapping("/{backPage}")
- public String backPage(@PathVariable String backPage) {
- return "/" + backPage;
- }
- }
-
访问后台页面: http://localhost:8081/index
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。