Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue_backup

这个是一个vue使用的spring boot demo

后端

创建SpringBoot项目

设置****server.port=8443

package com.example.vue_backup.controller;

import com.example.vue_backup.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin // 设置跨域支持
@RestController
@RequestMapping("api")
public class TestController {
    @Autowired
    private TestService testService;
    @RequestMapping("test")
    public String getmessage()
    {
        return testService.getmessage("hello my name is liang rui");
    }
}

热部署时


        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        
        <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <executable>true</executable>
                </configuration>
            </plugin>

image

About

这个是一个vue使用的spring boot demo

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages