2024年12月4日22:04:49

main
LeJingS 5 months ago
parent 873c643877
commit 573c44a239

@ -54,11 +54,7 @@
<script setup>
import { ref,reactive,onMounted} from 'vue'
import axios from 'axios'
let people = reactive([
{ id: 'ahsgdyfa01', name: '英雄联盟' ,password:'23456',email:'123456@qq.com'},
{ id: 'ahsgdyfa02', name: '王者荣耀' ,password:'3456',email:'123456@qq.com'},
{ id: 'ahsgdyfa03', name: '原神',password:'456',email:'123456@qq.com' }
])
let people = reactive([])
// api
@ -66,6 +62,7 @@
axios.get('http://localhost:8080/selectAll')
.then(res => {
// 使
people.splice(0, people.length);
people.push(...res.data)
})
.catch(error => console.error('There was an error fetching the data!', error))
@ -95,7 +92,13 @@ function addList() {
console.log(games);
}
// deleteItem(g.id)
function deleteItem(id) {
console.log(id);
axios.delete(`http://localhost:8080/delete?id=${id}`)
getAll();
}
onMounted(() => {
getAll();
@ -103,9 +106,11 @@ onMounted(() => {
</script>
</script>
<style>
.person .list {
display: flex;

@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />

@ -8,7 +8,7 @@
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="openjdk-23" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="23" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

@ -2,11 +2,13 @@ package top.lejings.db.http;
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.RestController;
import top.lejings.db.mapper.delete;
@RestController
@CrossOrigin(origins = "http://localhost:5173")
public class httpDelete {
@Autowired
private delete delete;

@ -2,11 +2,13 @@ package top.lejings.db.http;
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.RestController;
import top.lejings.db.mapper.insert;
@RestController
@CrossOrigin(origins = "http://localhost:5173")
public class httpInsert {
@Autowired

@ -1,6 +1,7 @@
package top.lejings.db.http;
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.RestController;
import top.lejings.db.mapper.selectById;
@ -10,6 +11,7 @@ import top.lejings.db.people;
import java.util.List;
@RestController
@CrossOrigin(origins = "http://localhost:5173")
public class httpSelect {
@Autowired
private selectById selectById;

@ -1,11 +1,13 @@
package top.lejings.db.http;
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.RestController;
import top.lejings.db.mapper.update;
@RestController
@CrossOrigin(origins = "http://localhost:5173")
public class httpUpdate {
@Autowired
private update update;

Loading…
Cancel
Save