Skip to content

Commit

Permalink
🎨 https url 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
InJun2 committed Dec 11, 2023
1 parent b8ad701 commit 5b8b560
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 63 deletions.
10 changes: 5 additions & 5 deletions src/main/resources/static/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ function handleCommonError(response) {
if (response.status === 401) {
alert("[ " + response.status + " ] " + JSON.parse(response.responseText).message);
window.localStorage.clear();
location.href = "http://www.se-community.net/login";
location.href = "https://www.se-community.net/login";
} else {
alert("[ " + response.status + " ] " + JSON.parse(response.responseText).message);
location.href = "http://www.se-community.net/boards";
location.href = "https://www.se-community.net/boards";
}
}

Expand Down Expand Up @@ -134,7 +134,7 @@ $(document).ready(function() {
}

$.ajax({
url: 'http://www.se-community.net/api/v1/boards/category',
url: 'https://www.se-community.net/api/v1/boards/category',
method: 'GET',
contentType: 'application/json',
success: function (result) {
Expand All @@ -144,14 +144,14 @@ $(document).ready(function() {
result.data.forEach(function (item) {
const li = document.createElement('li');
const a = document.createElement('a');
a.setAttribute('href', 'http://www.se-community.net/boards/' + item.id);
a.setAttribute('href', 'https://www.se-community.net/boards/' + item.id);
a.textContent = item.name;
li.append(a);
ul.append(li);

const li2 = document.createElement('li');
const a2 = document.createElement('a');
a2.setAttribute('href', 'http://www.se-community.net/boards/' + item.id);
a2.setAttribute('href', 'https://www.se-community.net/boards/' + item.id);
const h3 = document.createElement('h3');
h3.textContent = item.name;
const p = document.createElement('p');
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/static/js/member/ajax-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ function handleCommonError(response) {
if (response.status === 401) {
alert("[ " + response.status + " ] " + JSON.parse(response.responseText).message);
window.localStorage.clear();
location.href = "http://www.se-community.net/login";
location.href = "https://www.se-community.net/login";
} else {
alert("[ " + response.status + " ] " + JSON.parse(response.responseText).message);
location.href = "http://www.se-community.net/boards";
location.href = "https://www.se-community.net/boards";
}
}
6 changes: 3 additions & 3 deletions src/main/resources/static/js/member/login.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
document.addEventListener("DOMContentLoaded", function() {
if (window.localStorage.getItem('X-SELAB-AUTH-TOKEN') != null) {
alert('유저 정보가 이미 존재합니다.');
location.href = "http://www.se-community.net/home";
location.href = "https://www.se-community.net/home";
}
});

Expand All @@ -12,14 +12,14 @@ function login_submit() {
});

$.ajax({
url: "http://www.se-community.net/api/v1/auth/login",
url: "https://www.se-community.net/api/v1/auth/login",
data: data,
contentType: 'application/json',
type: "POST",
success: function(result) {
alert("로그인 성공!");
window.localStorage.setItem("X-SELAB-AUTH-TOKEN", result.data);
location.href = "http://www.se-community.net/boards";
location.href = "https://www.se-community.net/boards";
},
error: function(response){
if(response.status === 400) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/static/js/member/member-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ function edit_submit() {
});

$.ajax({
url: "http://www.se-community.net/api/v1/members/edit",
url: "https://www.se-community.net/api/v1/members/edit",
data: data,
headers : requestHeaders,
type: "PATCH",
success: function() {
alert("회원 정보 변경 성공 ! 다시 로그인을 진행해주세요");
window.localStorage.clear();
location.href = "http://www.se-community.net/login";
location.href = "https://www.se-community.net/login";
},
error: function(response){
alert("code = "+ request.status + "\nmessage = " + request.responseText);
Expand All @@ -106,12 +106,12 @@ function edit_submit() {
document.addEventListener("DOMContentLoaded", function() {
if(window.localStorage.getItem('X-SELAB-AUTH-TOKEN') == null) {
alert('유저 토큰이 존재하지 않습니다');
location.href = "http://www.se-community.net/login";
location.href = "https://www.se-community.net/login";
return;
}

$.ajax({
url: 'http://www.se-community.net/api/v1/auth/info',
url: 'https://www.se-community.net/api/v1/auth/info',
method: 'GET',
headers : requestHeaders,
success: function(result) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/static/js/member/sign-up.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function email_duplication_check() {
}

$.ajax({
url: "http://www.se-community.net/api/v1/members/email-check?email=" + email.val(),
url: "https://www.se-community.net/api/v1/members/email-check?email=" + email.val(),
type: "GET",
success: function() {
alert("중복되지 않은 이메일입니다.");
Expand Down Expand Up @@ -116,7 +116,7 @@ const maxLength = (e) =>{
document.addEventListener("DOMContentLoaded", function() {
if (window.localStorage.getItem('X-SELAB-AUTH-TOKEN') != null) {
alert('유저 정보가 이미 존재합니다.');
location.href = "http://www.se-community.net/home";
location.href = "https://www.se-community.net/home";
return;
}

Expand Down Expand Up @@ -153,13 +153,13 @@ function sign_up_submit() {
});

$.ajax({
url: "http://www.se-community.net/api/v1/members/signup",
url: "https://www.se-community.net/api/v1/members/signup",
data: data,
contentType: 'application/json',
type: "POST",
success: function() {
alert("회원 가입 성공 !");
location.href = "http://www.se-community.net/login";
location.href = "https://www.se-community.net/login";
},
error: function(response){
alert("[ " + response.status + " ] " + JSON.parse(response.responseText).message);
Expand Down
16 changes: 8 additions & 8 deletions src/main/resources/static/js/post/create-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ document.addEventListener('DOMContentLoaded', function () {
if (authToken === null) {
alert('유저 토큰이 존재하지 않습니다');
// 여기에 로컬 스토리지 토큰 삭제 추가
location.href = "http://www.se-community.net/login";
location.href = "https://www.se-community.net/login";
} else {
// 요청 헤더에 토큰 추가
var requestHeaders = {
Expand All @@ -16,7 +16,7 @@ document.addEventListener('DOMContentLoaded', function () {
console.log(contestPath)

$.ajax({
url: 'http://www.se-community.net/api/v1/posts/' + contestPath,
url: 'https://www.se-community.net/api/v1/posts/' + contestPath,
type: 'GET',
headers: {
'X-SELAB-AUTH-TOKEN': authToken
Expand All @@ -35,7 +35,7 @@ document.addEventListener('DOMContentLoaded', function () {
});

$.ajax({
url: 'http://www.se-community.net/api/v1/auth/info',
url: 'https://www.se-community.net/api/v1/auth/info',
method: 'GET',
headers : {
'X-SELAB-AUTH-TOKEN': authToken
Expand All @@ -47,11 +47,11 @@ document.addEventListener('DOMContentLoaded', function () {
if (response.status === 401) {
alert('유저 토큰이 만료되었거나 잘못되었습니다. 다시 로그인을 진행해주세요');
window.localStorage.clear();
location.href = "http://www.se-community.net/login";
location.href = "https://www.se-community.net/login";
} else {
alert('유저 토큰 정보를 불러오는데 실패하였습니다. 다시 로그인을 진행해주세요.');
window.localStorage.clear();
location.href = "http://www.se-community.net/login";
location.href = "https://www.se-community.net/login";
}
}
});
Expand All @@ -64,7 +64,7 @@ function create_post_submit() {
if (authToken === null) {
alert('유저 토큰이 존재하지 않습니다');
// 여기에 로컬 스토리지 토큰 삭제 추가
location.href = "http://www.se-community.net/login";
location.href = "https://www.se-community.net/login";
} else {
oEditors.getById["editorTxt"].exec("UPDATE_CONTENTS_FIELD", [])
let content = document.getElementById("editorTxt").value
Expand All @@ -88,15 +88,15 @@ function create_post_submit() {
const urlParams = new URLSearchParams("?boardId=" + postType.options[postType.selectedIndex].value)
console.log(postType.options[postType.selectedIndex].value);
$.ajax({
url: "http://www.se-community.net/api/v1/posts?"+urlParams,
url: "https://www.se-community.net/api/v1/posts?"+urlParams,
data: data,
headers: {
'Content-Type': 'application/json',
'X-SELAB-AUTH-TOKEN': authToken
},
type: "POST",
success: function () {
location.href = "http://www.se-community.net/boards";
location.href = "https://www.se-community.net/boards";

},
error: function(response) {
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/static/js/post/update-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ document.addEventListener("DOMContentLoaded", function() {
if(window.localStorage.getItem('X-SELAB-AUTH-TOKEN') == null) {
alert('유저 토큰이 존재하지 않습니다');
// 여기에 로컬 스토리지 토큰 삭제 추가
location.href = "http://www.se-community.net/login";
location.href = "https://www.se-community.net/login";
}

const pathArray = window.location.pathname.split("/");
const contestPath = pathArray[2];
console.log(contestPath)

$.ajax({
url: 'http://www.se-community.net/api/v1/posts/'+ contestPath,
url: 'https://www.se-community.net/api/v1/posts/'+ contestPath,
method: 'GET',
headers :{
'X-SELAB-AUTH-TOKEN': authToken
Expand All @@ -33,7 +33,7 @@ function update_post_submit() {
if (authToken === null) {
alert('유저 토큰이 존재하지 않습니다');
// 여기에 로컬 스토리지 토큰 삭제 추가
location.href = "http://www.se-community.net/login";
location.href = "https://www.se-community.net/login";
} else {
oEditors.getById["editorTxt"].exec("UPDATE_CONTENTS_FIELD", [])
let content = document.getElementById("editorTxt").value
Expand All @@ -54,15 +54,15 @@ function update_post_submit() {
const pathArray = window.location.pathname.split("/");
const contestPath = pathArray[2];
$.ajax({
url: "http://www.se-community.net/api/v1/posts/"+contestPath,
url: "https://www.se-community.net/api/v1/posts/"+contestPath,
data: data,
headers: {
'Content-Type': 'application/json',
'X-SELAB-AUTH-TOKEN': authToken
},
type: "PATCH",
success: function () {
location.href = "http://www.se-community.net/viewPost/"+contestPath;
location.href = "https://www.se-community.net/viewPost/"+contestPath;

},
error: function(response) {
Expand Down
30 changes: 15 additions & 15 deletions src/main/resources/static/js/post/view-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ document.addEventListener('DOMContentLoaded', function () {
if (authToken === null) {
alert('유저 토큰이 존재하지 않습니다');
// 여기에 로컬 스토리지 토큰 삭제 추가
location.href = "http://www.se-community.net/login";
location.href = "https://www.se-community.net/login";
} else {
// 요청 헤더에 토큰 추가
var requestHeaders = {
Expand All @@ -16,7 +16,7 @@ document.addEventListener('DOMContentLoaded', function () {
console.log(contestPath)

$.ajax({
url: 'http://www.se-community.net/api/v1/posts/' + contestPath,
url: 'https://www.se-community.net/api/v1/posts/' + contestPath,
type: 'GET',
headers: {
'X-SELAB-AUTH-TOKEN': authToken
Expand All @@ -35,7 +35,7 @@ document.addEventListener('DOMContentLoaded', function () {
});

$.ajax({
url: 'http://www.se-community.net/api/v1/auth/info',
url: 'https://www.se-community.net/api/v1/auth/info',
method: 'GET',
headers : {
'X-SELAB-AUTH-TOKEN': authToken
Expand All @@ -47,18 +47,18 @@ document.addEventListener('DOMContentLoaded', function () {
if (response.status === 401) {
alert('유저 토큰이 만료되었거나 잘못되었습니다. 다시 로그인을 진행해주세요');
window.localStorage.clear();
location.href = "http://www.se-community.net/login";
location.href = "https://www.se-community.net/login";
} else {
alert('유저 토큰 정보를 불러오는데 실패하였습니다. 다시 로그인을 진행해주세요.');
window.localStorage.clear();
location.href = "http://www.se-community.net/login";
location.href = "https://www.se-community.net/login";
}
}
});

const urlParams = new URLSearchParams("?postId=" + contestPath)
$.ajax({
url: 'http://www.se-community.net/api/v1/comments?' + urlParams,
url: 'https://www.se-community.net/api/v1/comments?' + urlParams,
type: 'GET',
headers: {
'X-SELAB-AUTH-TOKEN': authToken
Expand Down Expand Up @@ -110,15 +110,15 @@ function create_comment_submit() {
})

$.ajax({
url: "http://www.se-community.net/api/v1/comments",
url: "https://www.se-community.net/api/v1/comments",
data: data,
headers: {
'Content-Type': 'application/json',
'X-SELAB-AUTH-TOKEN': authToken
},
type: "POST",
success: function () {
location.href = "http://www.se-community.net/viewPost/" + contestPath;
location.href = "https://www.se-community.net/viewPost/" + contestPath;
},
error: function(response) {
handleCommonError(response);
Expand All @@ -132,7 +132,7 @@ function create_post_submit() {
if (authToken === null) {
alert('유저 토큰이 존재하지 않습니다');
// 여기에 로컬 스토리지 토큰 삭제 추가
location.href = "http://www.se-community.net/login";
location.href = "https://www.se-community.net/login";
} else {
oEditors.getById["editorTxt"].exec("UPDATE_CONTENTS_FIELD", [])
let content = document.getElementById("editorTxt").value
Expand All @@ -156,15 +156,15 @@ function create_post_submit() {
const urlParams = new URLSearchParams("?boardId=" + postType.options[postType.selectedIndex].value)
console.log(postType.options[postType.selectedIndex].value);
$.ajax({
url: "http://www.se-community.net/api/v1/posts?"+urlParams,
url: "https://www.se-community.net/api/v1/posts?"+urlParams,
data: data,
headers: {
'Content-Type': 'application/json',
'X-SELAB-AUTH-TOKEN': authToken
},
type: "POST",
success: function () {
location.href = "http://www.se-community.net/boards";
location.href = "https://www.se-community.net/boards";

},
error: function(response) {
Expand All @@ -178,7 +178,7 @@ function updateButton() {
const pathArray = window.location.pathname.split("/");
const contestPath = pathArray[2];
console.log(contestPath)
location.href = "http://www.se-community.net/updatePost/" + contestPath;
location.href = "https://www.se-community.net/updatePost/" + contestPath;
}


Expand All @@ -189,7 +189,7 @@ function deleteButton() {
if (authToken === null) {
alert('유저 토큰이 존재하지 않습니다');
// 여기에 로컬 스토리지 토큰 삭제 추가
location.href = "http://www.se-community.net/login";
location.href = "https://www.se-community.net/login";
} else {
// 요청 헤더에 토큰 추가
var requestHeaders = {
Expand All @@ -201,13 +201,13 @@ function deleteButton() {
console.log(contestPath)

$.ajax({
url: 'http://www.se-community.net/api/v1/posts/' + contestPath,
url: 'https://www.se-community.net/api/v1/posts/' + contestPath,
type: 'DELETE',
headers: {
'X-SELAB-AUTH-TOKEN': authToken
},
success: function () {
location.href = "http://www.se-community.net/boards";
location.href = "https://www.se-community.net/boards";
},
error: function(response) {
handleCommonError(response);
Expand Down
Loading

0 comments on commit 5b8b560

Please sign in to comment.