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) { function tokenRegeneration(userid, token) {
localAxios.defaults.headers['refreshToken'] = token; localAxios.defaults.headers['refreshToken'] = token;
console.log(userid);
console.log(token);
return localAxios.post(`/member/refresh/${userid}`); return localAxios.post(`/member/refresh/${userid}`);
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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