login api 추가
This commit is contained in:
parent
a2780f1914
commit
bd22c51684
@ -8,12 +8,27 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import $api from '@/common/axios-interceptor';
|
||||||
|
import router from '@/router';
|
||||||
import LoginForm from '@c/user/LoginForm.vue';
|
import LoginForm from '@c/user/LoginForm.vue';
|
||||||
import LogoHeader from '@c/user/LogoHeader.vue';
|
import LogoHeader from '@c/user/LogoHeader.vue';
|
||||||
|
|
||||||
const handleSubmit = async ({ id, password }) => {
|
const handleSubmit = async ({ id, password }) => {
|
||||||
console.log('Login');
|
try {
|
||||||
};
|
const response = await $api.post('user/login', {
|
||||||
|
loginId: id,
|
||||||
|
password: password,
|
||||||
|
remember: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.status === 200) {
|
||||||
|
console.log('로그인 성공', response.data);
|
||||||
|
router.push('/');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('로그인 실패', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style></style>
|
<style></style>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user