zmc
2023-09-05 c2f95b0b9090a2394b5b068582b932a5e57b86aa
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,8 +44,10 @@
      // 登录逻辑
      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('账号或密码错误');
@@ -79,7 +83,8 @@
  position: absolute;
  right: 10%;
  width: 20%;
  height: 50%;
  height: 500;
}
.el-form-item {
@@ -112,7 +117,7 @@
  letter-spacing: 0.3em;
  text-align: center;
  box-sizing: border-box;
  bottom: 80px;
  bottom: 10px;
}