frontend/src/view/Home.vue

34 lines
1.2 KiB
Vue

<template>
<div>
<el-text class="mx-1" type="primary" style="margin-left: 30px; margin-top: -90px;">名称</el-text>
<el-input v-model="account" style="width: 240px; margin-left: 50px; margin-top: -20px;" placeholder="请输入账号" />
<el-text class="mx-1" type="primary" style="margin-left: 30px; margin-top: 20px;">密码</el-text>
<el-input v-model="password" style="width: 240px; margin-left: 50px; margin-top: 20px;" placeholder="请输入密码" />
<el-button type="primary" style="padding: 20px; width: 90px; margin-top: 20px;" @click="handleLogin" >登录</el-button>
<el-button type="primary" style="padding: 20px; width: 90px; margin-left: 20px; margin-top: 20px" @click="handleRegister">注册</el-button>
</div>
</template>
<script setup>
import authenticationService from "../services/authenticationService.js";
import {useRouter} from "vue-router";
import {ref} from "vue";
const account=ref('');
const password=ref('');
const router=useRouter();
const handleLogin = ()=>{
authenticationService.login(account.value,password.value).then(res=>{});
}
const handleRegister = () => {
router.push('/register');
};
</script>
<style scoped>
</style>