| | |
| | | if (this.username === 'admin' && this.password === 'admin123') { |
| | | ElMessage.success('登录成功'); |
| | | // 登录成功,跳转到对应页面 |
| | | this.$router.push('/hdata') // 假设登录成功后跳转到 '/dashboard' 页面 |
| | | this.$router.push('/ndata') // 假设登录成功后跳转到 '/dashboard' 页面 |
| | | } else { |
| | | // console.log('Login Failed!') |
| | | ElMessage.error('账号或密码错误'); |
| | |
| | | |
| | | <style scoped> |
| | | .login-container { |
| | | background-image: url('../assets/login.jpg'); |
| | | background-image: url('../assets/login.png'); |
| | | /*用于为一个元素设置一个或者多个背景图像。 */ |
| | | background-size: cover; /* 将背景图像等比缩放到完全覆盖容器,背景图像有可能超出容器。*/ |
| | | background-position: center; /* 为每一个背景图片设置初始位置。这个位置是相对于由 background-origin 定义的位置图层的 键字 center,用来居中背景图片。*/ |