对tenant的请求地址进行修改

This commit is contained in:
高子兴 2024-07-05 23:21:45 +08:00
parent a5ee34e6fb
commit 5a52a58c0c

View File

@ -1,12 +1,9 @@
import axios from "axios"; import axios from "axios";
export default { export default {
addTenant(tenant){ addTenant(tenant) {
const url='http://localhost:8080/addTenant' const url = '/api/tenant/addTenant'
console.log("hahahhaahhha"+tenant.phone); const data = {
const data={
symbol: tenant.symbol, symbol: tenant.symbol,
contact: tenant.contact, contact: tenant.contact,
phone: tenant.phone, phone: tenant.phone,
@ -15,35 +12,32 @@ export default {
} }
return axios.post(url, data) return axios.post(url, data)
.then(response => { .then(response => {
if(response.data!=null){ if (response.data != null) {
alert("新增成功"); alert("新增成功");
}else } else
alert("新增失败"); alert("新增失败");
location.href="/tenantManagement"; location.href = "/tenantManagement";
}); });
}, },
getAll(){ async getAll() {
const url='http://localhost:8080/getAllTenant' const url = '/api/tenant/getAllTenant'
return axios.get(url) const response = await axios.get(url)
.then(response => {
return response.data; return response.data;
});
}, },
update(tenant){ update(tenant) {
const url='http://localhost:8080/updateTenant'; const url = '/api/tenant/updateTenant';
console.log("哈哈哈哈哈哈哈啊哈哈哈哈哈"+tenant); return axios.post(url, tenant)
return axios.post(url,tenant)
.then(response => { .then(response => {
}); });
}, },
delete(tenant){ delete(tenant) {
const url='http://localhost:8080/deleteTenant'; const url = '/api/tenant/deleteTenant';
return axios.post(url,tenant) return axios.post(url, tenant)
.then(response => { .then(response => {
}); });
} }