Skip to content

Commit

Permalink
修改请求的URL
Browse files Browse the repository at this point in the history
  • Loading branch information
luanwenfei-venus committed Mar 22, 2023
1 parent 30ddb20 commit f3beeec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<el-table-column prop="address" label="操作">
<template #default="scope">
<el-button size="large" @click="editWebHook(scope.row)">编辑</el-button>
<el-button size="large">测试连接</el-button>
<el-button size="large" @click="testWebHook(scope.row)">测试连接</el-button>
</template>
</el-table-column>
</el-table>
Expand Down Expand Up @@ -78,23 +78,14 @@ onBeforeMount(() => {
const getWebHooks = () => {
axios
.get(`http://192.168.95.193:8900/sermant/event/webhooks`)
.get(`${window.location.origin}/sermant/event/webhooks`)
.then(function (response) {
const data = response.data;
for (let index = 0; index < data.webhooks.length; index++) {
webhooks[data.webhooks[index].id].url = data.webhooks[index].url;
webhooks[data.webhooks[index].id].enable = data.webhooks[index].enable;
}
});
// axios
// .get(`http://${window.location.origin}/sermant/event/webhooks`)
// .then(function (response) {
// const data = response.data;
// for (let index = 0; index < data.webhooks.length; index++) {
// webhooks[data.webhooks[index].id].url = data.webhooks[index].url;
// webhooks[data.webhooks[index].id].enable = data.webhooks[index].enable;
// }
// });
};
const editWebHook = (webhook) => {
Expand All @@ -109,7 +100,7 @@ const setWebHook = (webhook) => {
console.log(webhook);
webhook.canEdit = false;
axios
.put(`http://${window.location.origin}/sermant/event/webhooks/` + webhook.id, {
.put(`${window.location.origin}/sermant/event/webhooks/` + webhook.id, {
url: webhook.url,
enable: webhook.enable,
})
Expand All @@ -120,7 +111,7 @@ const setWebHook = (webhook) => {
const testWebHook = (webhook) => {
axios
.post(`http://${window.location.origin}/sermant/event/webhooks/test`, {
.post(`${window.location.origin}/sermant/event/webhooks/test`, {
id: webhook.id,
})
.catch(function (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ const requestParam = reactive({
const pageChange = (pageNubmber: number) => {
axios
.get(`http://${window.location.origin}/sermant/event/events/page`, {
.get(`${window.location.origin}/sermant/event/events/page`, {
params: { page: pageNubmber },
})
.then(function (response) {
Expand Down

0 comments on commit f3beeec

Please sign in to comment.