保誠-保戶業務員媒合平台
劉鈞霖
2021-11-15 cd4a64b39c429f2f5b45cb042d1b66f1cd3904cd
PAMapp/pages/index.vue
@@ -1,8 +1,5 @@
<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>
@@ -92,33 +89,6 @@
            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>