Refactor: Remove unnecessary console.log

This commit is contained in:
jhynsoo 2024-05-23 10:23:57 +09:00
parent 74c3c5d7ba
commit 9b0c02f35f
7 changed files with 19 additions and 47 deletions

View File

@ -11,8 +11,6 @@ function findByToken(userid, token) {
function tokenRegeneration(userid, token) {
localAxios.defaults.headers['refreshToken'] = token;
console.log(userid);
console.log(token);
return localAxios.post(`/member/refresh/${userid}`);
}

View File

@ -7,11 +7,10 @@ const memberStore = useMemberStore();
const { userLogout } = memberStore;
const { isLogin } = storeToRefs(memberStore);
console.log('AppHeader.isLogin', isLogin.value);
const logout = () => {
function logout() {
userLogout();
};
}
</script>
<template>

View File

@ -32,16 +32,12 @@ watch(lastElement, (el) => {
});
function searchList() {
getArticles(params)
.then(({ data }) => {
getArticles(params).then(({ data }) => {
if ((data?.articles?.length ?? 0) === 0) {
hasNextPage.value = false;
return;
}
articles.value = [...articles.value, ...(data?.articles ?? [])];
})
.catch((error) => {
console.log(error);
});
}
searchList();

View File

@ -19,7 +19,6 @@ function handleCancel() {
}
function handleSubmit() {
console.log(id, text.value);
addComment({ id, text: text.value }).then(({ data }) => {
console.log(data);
// TODO:

View File

@ -32,7 +32,6 @@ watch(sido, ({ sidoCode }) => {
getGugun(sidoCode).then(({ data }) => {
gugunList.value = [{ gugunCode: 0, gugunName: '전체' }, ...data];
});
console.log(keyword.value);
});
if (sidoList.value.length === 0) {
@ -47,14 +46,9 @@ function handleSubmit() {
const contentTypeQuery = `contentTypeId=${contentType.value?.value ?? 0}`;
const queryString = [areaQuery, keywordQuery, contentTypeQuery].join('&');
console.log(queryString);
setQueryString(queryString);
search();
}
watch(keyword, () => {
console.log('change');
});
</script>
<template>

View File

@ -28,13 +28,11 @@ function handleSubmit() {
if (password.value !== passwordConfirm.value) {
return;
}
registMember(member.value)
.then((response) => {
registMember(member.value).then((response) => {
if (response.status == 200) {
router.push({ name: 'user-login' });
}
})
.catch((error) => console.error(error));
});
}
</script>

View File

@ -5,29 +5,17 @@ import { storeToRefs } from 'pinia';
import { useMemberStore } from '@/stores/memberStore';
const onlyAuthUser = async (to, from, next) => {
async function onlyAuthUser(to, from, next) {
const memberStore = useMemberStore();
const { userInfo, isLogin } = storeToRefs(memberStore);
const { isLogin } = storeToRefs(memberStore);
const { isValidToken } = memberStore;
let token = localStorage.getItem('accessToken');
console.log(userInfo);
console.log(isLogin);
// if (userInfo.value != null && token) {
console.log(isLogin.value);
console.log(token);
const token = localStorage.getItem('accessToken');
if (isLogin.value != null && token) {
console.log('이프문들어옴');
await isValidToken(token);
}
if (isLogin.value === null) {
console.log('이프문2들어옴');
next({ name: 'user-login' });
} else {
console.log('else문 들어옴');
next();
isLogin.value === null ? next({ name: 'user-login' }) : next();
}
};
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),