| | |
| | | <template> |
| | | <div> |
| | | <el-button @click="login('user')">客戶登入</el-button> |
| | | <el-button @click="login('admin')">顧問登入</el-button> |
| | | <el-button @click="remove">登出</el-button> |
| | | <Ui-Carousel></Ui-Carousel> |
| | | <div class="page-container"> |
| | | <h5 class="mdTxt mb-30">預約保險顧問</h5> |
| | |
| | | setFavoriteToStorage(this.consultantList) |
| | | } |
| | | } |
| | | |
| | | // TODO: 僅OTP認證開發前 暫時使用 |
| | | login(account: string) { |
| | | const user = { |
| | | username: account, |
| | | password: account |
| | | } |
| | | login(user).then((res) => { |
| | | localStorage.setItem('id_token', res.data.id_token); |
| | | |
| | | if (account === 'admin') { |
| | | this.$router.push('/myAppointmentList/appointmentList'); |
| | | } else { |
| | | this.$router.go(0); |
| | | } |
| | | |
| | | }) |
| | | |
| | | |
| | | } |
| | | |
| | | // TODO: 僅OTP認證開發前 暫時使用 |
| | | remove() { |
| | | localStorage.removeItem('id_token'); |
| | | this.$router.go(0) |
| | | } |
| | | |
| | | } |
| | | |
| | | </script> |