暫時移除前端,維持前後端分離

This commit is contained in:
Raymond Yang
2023-07-11 11:39:18 +08:00
parent 1dca536ab0
commit 9618374942
4 changed files with 9 additions and 10 deletions
+4 -4
View File
@@ -12,7 +12,7 @@ window.onload = function () {
paramValue = getParameterByName('id');
console.log(paramValue);
axios.get("./api/member/" + paramValue)
axios.get("../api/member/" + paramValue)
.then(function (response) {
// 在這裡處理回傳的資料
var options = response.data;
@@ -69,7 +69,7 @@ function updateMember(memberId, nickName, playerName, gameUid, discordId) {
}
}
// 发送登录请求
axios.put("./api/member/" + memberId, {
axios.put("../api/member/" + memberId, {
playerName: playerName,
nickName: nickName,
discordID: discordId,
@@ -77,7 +77,7 @@ function updateMember(memberId, nickName, playerName, gameUid, discordId) {
leave: isLeave
})
.then(function (response) {
window.location.href = "./index.html";
window.location.href = "../index.html";
})
.catch(function (error) {
//const message = error.response.data.message;
@@ -87,7 +87,7 @@ function updateMember(memberId, nickName, playerName, gameUid, discordId) {
}
function deleteMember(memberId) {
axios.delete("./api/member/" + memberId)
axios.delete("../api/member/" + memberId)
.then(function (response) {
window.location.href = "./index.html";
})
+1 -1
View File
@@ -33,7 +33,7 @@ row_1.appendChild(heading_3);
row_1.appendChild(heading_5);
thead.appendChild(row_1);
// 取得刀表
axios.get("./api/member", {
axios.get("../api/member", {
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
+2 -2
View File
@@ -14,14 +14,14 @@ document
function newMember(nickName, playerName, gameUid, discordId) {
// 发送登录请求
axios.post("./api/member", {
axios.post("../api/member", {
playerName: playerName,
nickName: nickName,
discordID: discordId,
uid: gameUid
})
.then(function (response) {
window.location.href = "./index.html";
window.location.href = "../index.html";
})
.catch(function (error) {
const message = error.response.data.message;