Browse Source

login++

pull/25/head
Alexey Velikiy 3 years ago
parent
commit
dfa8a5af21
  1. 2
      client/src/router/index.ts
  2. 19
      client/src/views/Login.vue

2
client/src/router/index.ts

@ -9,7 +9,7 @@ const routes: Array<RouteRecordRaw> = [
component: Home
},
{
path: '/',
path: '/login',
name: 'Login',
component: Login
},

19
client/src/views/Login.vue

@ -1,24 +1,31 @@
<template>
<div class="hello">
<div>
Login: <input type="text" />
Password: <input type="password" />
<input type="submit" />
Login: <input type="text" v-model="this.username" /> <br/> <br/>
Password: <input type="password" v-model="this.password" /> <br/> <br/>
<input type="submit" @click="this.submit" value="login" />
</div>
</div>
</template>
<script lang="ts">
import AuthService from '@/services/auth.service';
import { Options, Vue } from 'vue-class-component';
@Options({
props: {
msg: String
}
})
export default class Login extends Vue {
msg!: string
username: string;
password: string;
submit() {
AuthService.login({ username: this.username, password: this.password })
}
}
</script>

Loading…
Cancel
Save