src/views/login/LoginSystem.vue
@@ -20,6 +20,7 @@ placeholder="请输入密码" type="password" size="large" show-password ></el-input> </el-form-item> @@ -30,6 +31,7 @@ </template> <script lang="ts"> import Cookie from 'js-cookie' export default { data() { return { @@ -42,6 +44,8 @@ // 登录逻辑 if (this.username === 'admin' && this.password === 'admin123') { ElMessage.success('登录成功'); const token = 'abc' Cookie.set('token',token) // 登录成功,跳转到对应页面 this.$router.push('/edata') // 假设登录成功后跳转到 '/dashboard' 页面 } else {