| | |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { namespace } from 'nuxt-property-decorator'; |
| | | import { Vue, Component} from 'vue-property-decorator'; |
| | | import { getForgotPasswordLink , getVerificationCodeImg , login } from '~/assets/ts/api/consultant'; |
| | | import { Role } from '../../components/NavBar.vue'; |
| | | |
| | | const localStorage = namespace('localStorage'); |
| | | @Component({ |
| | | layout: 'default' |
| | | layout: 'home' |
| | | }) |
| | | export default class ConsultantLogin extends Vue { |
| | | @localStorage.Mutation storageIdToken!: (token:string) => void; |
| | | @localStorage.Mutation storageRole!: (role:string) => void; |
| | | |
| | | isRemember = false; |
| | | isShowPassword = false; |
| | | consultantDto = { |
| | |
| | | username: 'admin', |
| | | password: 'admin' |
| | | } |
| | | console.log('user',user); |
| | | login(user).then((res) => { |
| | | localStorage.setItem('id_token', res.data.id_token); |
| | | localStorage.setItem('roleOfState',Role.ADMIN) |
| | | this.storageIdToken(res.data.id_token); |
| | | this.storageRole(Role.ADMIN); |
| | | this.$router.push('/myAppointmentList/appointmentList'); |
| | | }) |
| | | } |