ref(frontend): add ~/const path

This commit is contained in:
이강준
2022-11-27 16:12:25 +09:00
parent 2729b409e6
commit 66d2a2724e
59 changed files with 1077 additions and 1086 deletions
+14 -15
View File
@@ -1,20 +1,19 @@
import { PATH } from "../../../const.js";
import { PATH } from "~/const";
const token = async (req, res) => {
return fetch(PATH + "/api/v1/auth/token", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
credentials: "include"
})
.then(async res => {
if (res.status == 200) {
return (await res.json()).token;
} else {
console.log('Getting a new token failed');
}
})
return fetch(PATH + "/api/v1/auth/token", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
credentials: "include",
}).then(async (res) => {
if (res.status == 200) {
return (await res.json()).token;
} else {
console.log("Getting a new token failed");
}
});
};
export default token;