This commit is contained in:
2024-12-02 18:32:14 +09:00
parent a02349f7a1
commit 576932da3d
16 changed files with 287 additions and 112 deletions
@@ -61,4 +61,6 @@ spring.data.mongodb.option.heartbeat-connect-timeout=20000
spring.data.mongodb.option.min-heartbeat-frequency=500
spring.data.mongodb.option.heartbeat-frequency=10000
spring.data.mongodb.option.local-threshold=15
#>>>>>>> ab915d0a416c69708f1df1ad76d7a14c779c1f59
+68 -2
View File
@@ -1,3 +1,8 @@
onload = function() {
history.replaceState({}, null, location.pathname);
}
function divider(key) {
return merge(padding(),key,padding())
}
@@ -36,7 +41,7 @@ function checkDebug(){
}
}
var acpt_key = ""
function post(target,type, data, key,callBackResult) {
var httpRequest;
/* 통신에 사용 될 XMLHttpRequest 객체 정의 */
@@ -52,6 +57,47 @@ function post(target,type, data, key,callBackResult) {
}
}
}
httpRequest.open('POST', target, true);
httpRequest.setRequestHeader("Content-Type", "text/plain");
var odd = []
var even = []
var dataStr = JSON.stringify(data)
var src = dataStr.split("")
src.forEach(function (s,i,a) {if (i % 2 === 0) {even.push(s)} else {odd.push(s)}})
httpRequest.send(btoa(JSON.stringify({
'data': unformat(type,data,key),
'key':key,
'type':type,
})));
}
function postLogin(target,type, data, key,callBackResult) {
var httpRequest;
/* 통신에 사용 될 XMLHttpRequest 객체 정의 */
httpRequest = new XMLHttpRequest();
/* httpRequest의 readyState가 변화했을때 함수 실행 */
httpRequest.onreadystatechange = () => {
/* readyState가 Done이고 응답 값이 200일 때, 받아온 response로 name과 age를 그려줌 */
if (httpRequest.readyState === XMLHttpRequest.DONE) {
if (httpRequest.status === 200) {
try {
var uuid= httpRequest.getResponseHeader("S33-DATA")
console.log("LOG __ 0" + document.cookie)
console.log("LOG __ 1" + uuid)
document.cookie = "S33-DATA="+uuid
console.log("LOG __ 2" + document.cookie)
console.log("LOG __ 3" + uuid)
callBackResult(httpRequest.response)
document.location.href = document.location
} catch (e) {
}
} else {
alert('Request Error!');
}
}
}
httpRequest.open('POST', target, true);
httpRequest.setRequestHeader("Content-Type", "text/plain");
var odd = []
@@ -76,6 +122,26 @@ function mainPath() {
}
function logout() {
if(document.cookie.split(";").length > 1) {
document.cookie.split(";").forEach(function (v,i,a){
if(v.search("S33-DATA") > 0) {
document.cookie.replace(v,"S33-DATA=")
} else {
}
})
} else {
document.cookie = "S33-DATA="
}
let logOutUrl = getMainPath() + "/user/logout.ajax";
post(logOutUrl,"","","", function (resultData) {
alert(resultData)
document.location.href = document.location
})
}
function gotoLogin() {
console.log(`location.port >> ${location.port}`)
location.href = getMainPath()+"/login"
@@ -92,7 +158,7 @@ function onclickLogin(type, keyword) {
'user_id': user_id.value,
'user_pw': user_pw.value,
}
post(getMainPath()+"/user/login.ajax",type,JSON.stringify(data),keyword, function (resultData) {
postLogin(getMainPath()+"/user/login.ajax",type,JSON.stringify(data),keyword, function (resultData) {
alert(resultData)
})
}
@@ -11,11 +11,11 @@
<div class="layer">
<th:block id="where" th:each="location : ${locations}">
<div class="where_item">
<span th:text="${location.timeString}"> </span>
<span th:text="${location.mAddressLines}"> </span>
<span th:text="${location.mCountryName}"> </span>
<span th:text="${location.mLatitude}"> </span>
<span th:text="${location.mLongitude}"> </span>
<label th:text="${location.timeString}"/><br/>
<label th:text="${location.mAddressLines}"/><br/>
<label th:text="${location.mCountryName}"/><br/>
<label th:text="${#numbers.formatDecimal(location.mLatitude, 1, 3)}"/><br/>
<label th:text="${#numbers.formatDecimal(location.mLongitude, 1, 3)}"/><br/>
</div>
</th:block>
</div>
@@ -3,7 +3,7 @@
<th:block th:fragment="header">
<header>
<div id="top">
<td><h3><a aria-label="licenses" style="color: white" href="javascript:mainPath()" title="Gmail">HOME</a></h3></td>
<td><h3><a aria-label="goToMain" style="color: white" href="javascript:mainPath()" title="goToMain">HOME</a></h3></td>
</div>
<th:block th:if="${PERMISSION != 'OK'}">
@@ -18,7 +18,9 @@
</div>
</th:block>
<th:block th:if="${PERMISSION == 'OK'}">
<!-- <div><h2><a aria-label="licenses" style="color: white" href="javascript:gotoLogin()" title="Gmail">HOME</a></h2></div>-->
<div class="user_info" >
<td><h3><a aria-label="logout" style="color: white" href="javascript:logout()" title="logout">logout</a></h3></td>
</div>
</th:block>
</header>
</th:block>