Compare commits

..

2 Commits

Author SHA1 Message Date
Raymond Yang 42356d0f88 更改DB域名 2023-08-10 12:23:26 +08:00
Raymond Yang 9618374942 暫時移除前端,維持前後端分離 2023-07-11 11:39:18 +08:00
6 changed files with 11 additions and 12 deletions
@@ -7,7 +7,7 @@ import org.litote.kmongo.*
import org.litote.kmongo.id.toId import org.litote.kmongo.id.toId
object MemberRecordService { object MemberRecordService {
private val client = KMongo.createClient("mongodb://ray650128:Zx650128!@www.ray650128.com:27017") private val client = KMongo.createClient("mongodb://ray650128:Zx650128!@ray650128.com:27017")
private val database = client.getDatabase("pc_re_dive_clan_battle") private val database = client.getDatabase("pc_re_dive_clan_battle")
private val recordCollection = database.getCollection<MemberRecord>() private val recordCollection = database.getCollection<MemberRecord>()
@@ -6,7 +6,7 @@ import org.litote.kmongo.*
import org.litote.kmongo.id.toId import org.litote.kmongo.id.toId
object MemberService { object MemberService {
private val client = KMongo.createClient("mongodb://ray650128:Zx650128!@www.ray650128.com:27017") private val client = KMongo.createClient("mongodb://ray650128:Zx650128!@ray650128.com:27017")
private val database = client.getDatabase("pc_re_dive_clan_battle") private val database = client.getDatabase("pc_re_dive_clan_battle")
private val memberCollection = database.getCollection<Member>() private val memberCollection = database.getCollection<Member>()
@@ -4,7 +4,9 @@ import io.ktor.http.*
import io.ktor.server.plugins.cors.routing.* import io.ktor.server.plugins.cors.routing.*
import io.ktor.server.application.* import io.ktor.server.application.*
import io.ktor.server.http.content.* import io.ktor.server.http.content.*
import io.ktor.server.response.*
import io.ktor.server.routing.* import io.ktor.server.routing.*
import io.ktor.util.*
import java.io.File import java.io.File
fun Application.configureHTTP() { fun Application.configureHTTP() {
@@ -21,7 +23,4 @@ fun Application.configureHTTP() {
allowCredentials = true allowCredentials = true
allowNonSimpleContentTypes = true allowNonSimpleContentTypes = true
} }
routing {
staticFiles("/", File("web"))
}
} }
+4 -4
View File
@@ -12,7 +12,7 @@ window.onload = function () {
paramValue = getParameterByName('id'); paramValue = getParameterByName('id');
console.log(paramValue); console.log(paramValue);
axios.get("./api/member/" + paramValue) axios.get("../api/member/" + paramValue)
.then(function (response) { .then(function (response) {
// 在這裡處理回傳的資料 // 在這裡處理回傳的資料
var options = response.data; 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, playerName: playerName,
nickName: nickName, nickName: nickName,
discordID: discordId, discordID: discordId,
@@ -77,7 +77,7 @@ function updateMember(memberId, nickName, playerName, gameUid, discordId) {
leave: isLeave leave: isLeave
}) })
.then(function (response) { .then(function (response) {
window.location.href = "./index.html"; window.location.href = "../index.html";
}) })
.catch(function (error) { .catch(function (error) {
//const message = error.response.data.message; //const message = error.response.data.message;
@@ -87,7 +87,7 @@ function updateMember(memberId, nickName, playerName, gameUid, discordId) {
} }
function deleteMember(memberId) { function deleteMember(memberId) {
axios.delete("./api/member/" + memberId) axios.delete("../api/member/" + memberId)
.then(function (response) { .then(function (response) {
window.location.href = "./index.html"; window.location.href = "./index.html";
}) })
+1 -1
View File
@@ -33,7 +33,7 @@ row_1.appendChild(heading_3);
row_1.appendChild(heading_5); row_1.appendChild(heading_5);
thead.appendChild(row_1); thead.appendChild(row_1);
// 取得刀表 // 取得刀表
axios.get("./api/member", { axios.get("../api/member", {
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json' 'Accept': 'application/json'
+2 -2
View File
@@ -14,14 +14,14 @@ document
function newMember(nickName, playerName, gameUid, discordId) { function newMember(nickName, playerName, gameUid, discordId) {
// 发送登录请求 // 发送登录请求
axios.post("./api/member", { axios.post("../api/member", {
playerName: playerName, playerName: playerName,
nickName: nickName, nickName: nickName,
discordID: discordId, discordID: discordId,
uid: gameUid uid: gameUid
}) })
.then(function (response) { .then(function (response) {
window.location.href = "./index.html"; window.location.href = "../index.html";
}) })
.catch(function (error) { .catch(function (error) {
const message = error.response.data.message; const message = error.response.data.message;