This commit is contained in:
quantulr
2022-08-30 22:39:51 +08:00
parent 9ab8c897ba
commit ee072eecff
3 changed files with 427 additions and 25 deletions

View File

@ -237,7 +237,7 @@
const handleQuery = () => {};
const resetQuery = () => {};
const handleDelete = async (id) => {
fetch(`http://localhost:8000/personnels/${id}`, {
fetch(`http://120.48.8.98:16948/personnels/${id}`, {
method: "DELETE",
}).then(() => {
console.log("删除成功");
@ -250,7 +250,7 @@
};
const handleEdit = (id) => {
reset();
fetch(`http://localhost:8000/personnels/${id}`)
fetch(`http://120.48.8.98:16948/personnels/${id}`)
.then((resp) => resp.json())
.then((data) => {
form.value = data.data;
@ -260,7 +260,7 @@
const submitForm = async () => {
await formRef.value.validate();
if (form.value.id) {
fetch(`http://localhost:8000/personnels/${form.value.id}`, {
fetch(`http://120.48.8.98:16948/personnels/${form.value.id}`, {
method: "PUT",
headers: {
"Content-Type": "application/json",
@ -273,7 +273,7 @@
getList();
});
} else {
fetch(`http://localhost:8000/personnels`, {
fetch(`http://120.48.8.98:16948/personnels`, {
method: "POST",
headers: {
"Content-Type": "application/json",
@ -291,7 +291,7 @@
};
const getList = async () => {
const resp = fetch(
`http://localhost:8000/personnels?pageNum=${queryParams.value.pageNum}&pageSize=${queryParams.value.pageSize}`
`http://120.48.8.98:16948/personnels?pageNum=${queryParams.value.pageNum}&pageSize=${queryParams.value.pageSize}`
)
.then((resp) => resp.json())
.then((data) => {