fix : header update and Login Password Wrong Logic add
This commit is contained in:
@@ -55,7 +55,12 @@ public class UserServiceImpl implements UserService {
|
||||
User findUser = userRepository.findByEmail(userSigninRequest.getEmail());
|
||||
if (findUser == null) {
|
||||
throw new CustomException(Error.EMAIL_NULL_OR_INVALID);
|
||||
}else{
|
||||
if(!passwordEncoder.matches(userSigninRequest.getPassword(), findUser.getPassword())){
|
||||
throw new CustomException(Error.PASSWORD_WRONG);
|
||||
}
|
||||
}
|
||||
|
||||
return convertUser(findUser);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ public enum Error {
|
||||
DUPLICATE_USERNAME("duplicate user username", HttpStatus.CONFLICT),
|
||||
SIGNUP_NULL_DATA("request body include null",HttpStatus.BAD_REQUEST),
|
||||
EMAIL_NULL_OR_INVALID("email is blank or invalid check plz",HttpStatus.BAD_REQUEST),
|
||||
PASSWORD_WRONG("password is wrong.", HttpStatus.BAD_REQUEST),
|
||||
USER_NOT_FOUND("user not found check your info",HttpStatus.NOT_FOUND),
|
||||
ALREADY_FOLLOW("already follow",HttpStatus.UNPROCESSABLE_ENTITY),
|
||||
ALREADY_UNFOLLOW("already unfollow",HttpStatus.UNPROCESSABLE_ENTITY),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<TheHeader></TheHeader>
|
||||
<TheHeader :key="$route.fullPath"></TheHeader>
|
||||
<router-view></router-view>
|
||||
<TheFooter></TheFooter>
|
||||
</template>
|
||||
@@ -7,9 +7,14 @@
|
||||
<script lang="ts">
|
||||
import TheHeader from '@/components/TheHeader.vue'
|
||||
import TheFooter from "@/components/TheFooter.vue";
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
setup(){
|
||||
const route = useRoute();
|
||||
return route
|
||||
},
|
||||
components: {
|
||||
TheHeader,
|
||||
TheFooter
|
||||
|
||||
@@ -64,6 +64,8 @@ export default {
|
||||
const code = error.response.data.errors.code;
|
||||
if(code == "EMAIL_NULL_OR_INVALID"){
|
||||
loginValidation.value = true;
|
||||
}else if(code == "PASSWORD_WORNG"){
|
||||
loginValidation.value = true;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user