zhanghua
2022-09-21 41179ea06e694e19b3170c07dbafe1d26f15ff8f
src/views/login/index.vue
@@ -107,12 +107,17 @@
      const { username, password } = this.loginForm;
      const that = this;
      this.$axios
        .post("http://42.193.1.25:8082/sccg/admin/login", {
        .post("sccg/admin/login", {
          password,
          username,
        })
        .then(function (response) {
          if (response.data.code === 200) {
          if (response.code === 200) {
            // 保存token
            console.log(response);
            localStorage.setItem('token',response.data.token);
            // 保存token
            localStorage.setItem('tokenHead',response.data.tokenHead)
            // 跳转到首页
            that.$router.push("/home");
          }else{
@@ -122,7 +127,7 @@
              }
            })
          }
          console.log(response);
          // console.log(response);
        })
        .catch(function (error) {
          console.log(error);