|
@@ -1,3 +1,24 @@
|
|
|
+function checkRoute() {
|
|
|
+ jwt_token = get_jwt_token();
|
|
|
+ axios({
|
|
|
+ method: 'post',
|
|
|
+ url: 'http://www.choozmo.com:8887/user_profile',
|
|
|
+ headers: {
|
|
|
+ 'accept': 'text/html',
|
|
|
+ 'Authorization': `Bearer ${jwt_token}`
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res.status);
|
|
|
+ if(res.status !== 200) {
|
|
|
+ window.location.href = 'login.html';
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+checkRoute();
|
|
|
+
|
|
|
const btnLoginPage = document.querySelector('.btn-login');
|
|
|
const btnUserProfile = document.querySelector('.btn-userProfile');
|
|
|
const btnLogout = document.querySelector('.btn-logout');
|
|
@@ -39,7 +60,6 @@ addCardListener();
|
|
|
function avatarChange() {
|
|
|
var value = avatarSelector.options[avatarSelector.selectedIndex].text;
|
|
|
$('.owl-carousel').trigger('to.owl.carousel', avatarSelector.selectedIndex);
|
|
|
- console.log(value);
|
|
|
for (let i = 0; i < card.length; i++) {
|
|
|
card[i].classList.remove('active');
|
|
|
if (card[i].dataset.avatar == value) {
|
|
@@ -118,7 +138,7 @@ $(".next").click(function () {
|
|
|
console.log(dataOBJ)
|
|
|
jwt_token = get_jwt_token()
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
- xhr.open("POST", "/make_anchor_video");
|
|
|
+ xhr.open("POST", "http://www.choozmo.com:8887/make_anchor_video");
|
|
|
xhr.setRequestHeader("accept", "application/json");
|
|
|
xhr.setRequestHeader("Authorization","Bearer "+jwt_token)
|
|
|
xhr.setRequestHeader("Content-Type", "application/json");
|
|
@@ -225,9 +245,9 @@ $("#send_slide").click(function () {
|
|
|
objstr = JSON.stringify(dataOBJ);
|
|
|
jwt_token = get_jwt_token()
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
- xhr.open("POST", "/make_anchor_video_gSlide");
|
|
|
+ xhr.open("POST", "http://www.choozmo.com:8887/make_anchor_video_gSlide");
|
|
|
xhr.setRequestHeader("accept", "application/json");
|
|
|
- xhr.setRequestHeader("Authorization","Bearer "+jwt_token)
|
|
|
+ xhr.setRequestHeader("Authorization","Bearer "+jwt_token);
|
|
|
xhr.setRequestHeader("Content-Type", "application/json");
|
|
|
xhr.onreadystatechange = function () {
|
|
|
if (xhr.readyState === 4) {
|
|
@@ -395,7 +415,6 @@ function load_data() {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
var subtitleInputs = document.querySelector(".subtitle-inputs");
|
|
|
var imgInputs = document.querySelector(".img-inputs");
|
|
|
let length = 5;
|
|
@@ -479,4 +498,5 @@ $('.owl-carousel').owlCarousel({
|
|
|
items: 4
|
|
|
}
|
|
|
}
|
|
|
-})
|
|
|
+});
|
|
|
+
|