瀏覽代碼

Login Errors

master
LeneS 5 年之前
父節點
當前提交
dd3240fe4b
共有 2 個文件被更改,包括 3 次插入12 次删除
  1. 0
    1
      src/components/home/homePage.vue
  2. 3
    11
      src/components/user/loginPage.vue

+ 0
- 1
src/components/home/homePage.vue 查看文件

@@ -3,7 +3,6 @@
3 3
     <CarouselSection />
4 4
     <ServiceSection />
5 5
     <PropertySection />
6
-    <AgentSection />
7 6
     <NewsSection />
8 7
     <TestimonialSection />
9 8
     <a href="#" class="back-to-top">

+ 3
- 11
src/components/user/loginPage.vue 查看文件

@@ -91,13 +91,13 @@ export default {
91 91
   },
92 92
   methods: {
93 93
     Login() {
94
-      console.log(this.username + this.password);
95 94
       axios
96
-        .post('http://localhost:57260/api/register/authenticate', {
95
+        .post('/api/register/authenticate', {
97 96
           username: this.username,
98 97
           password: this.password,
99 98
         })
100
-        .then(response => console.log(response.data));
99
+        .then(response => console.log(response.data))
100
+        .catch(error => console.log(error.push));
101 101
       this.$router.push('/');
102 102
     },
103 103
     togglePassword() {
@@ -108,14 +108,6 @@ export default {
108 108
       this.showPassword = false;
109 109
       this.isPasswordShown = 'password';
110 110
     },
111
-    authHeader() {
112
-      const user = JSON.parse(localStorage.getItem('user'));
113
-
114
-      if (user && user.token) {
115
-        return { Authoriztion: `Bearer ${user.token}` };
116
-      }
117
-      return {};
118
-    },
119 111
     SendMail() {},
120 112
   },
121 113
 };

Loading…
取消
儲存