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