| | |
| | | placeholder="请输入密码" |
| | | type="password" |
| | | size="large" |
| | | show-password |
| | | ></el-input> |
| | | </el-form-item> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import Cookie from 'js-cookie' |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | // 登录逻辑 |
| | | if (this.username === 'admin' && this.password === 'admin123') { |
| | | ElMessage.success('登录成功'); |
| | | const token = 'abc' |
| | | Cookie.set('token',token) |
| | | // 登录成功,跳转到对应页面 |
| | | this.$router.push('/ndata') // 假设登录成功后跳转到 '/dashboard' 页面 |
| | | this.$router.push('/edata') // 假设登录成功后跳转到 '/dashboard' 页面 |
| | | } else { |
| | | // console.log('Login Failed!') |
| | | ElMessage.error('账号或密码错误'); |
| | |
| | | position: absolute; |
| | | right: 10%; |
| | | width: 20%; |
| | | height: 50%; |
| | | |
| | | height: 500; |
| | | |
| | | } |
| | | .el-form-item { |
| | |
| | | letter-spacing: 0.3em; |
| | | text-align: center; |
| | | box-sizing: border-box; |
| | | bottom: 80px; |
| | | bottom: 10px; |
| | | |
| | | } |
| | | |