瀏覽代碼

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
     <CarouselSection />
3
     <CarouselSection />
4
     <ServiceSection />
4
     <ServiceSection />
5
     <PropertySection />
5
     <PropertySection />
6
-    <AgentSection />
7
     <NewsSection />
6
     <NewsSection />
8
     <TestimonialSection />
7
     <TestimonialSection />
9
     <a href="#" class="back-to-top">
8
     <a href="#" class="back-to-top">

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

91
   },
91
   },
92
   methods: {
92
   methods: {
93
     Login() {
93
     Login() {
94
-      console.log(this.username + this.password);
95
       axios
94
       axios
96
-        .post('http://localhost:57260/api/register/authenticate', {
95
+        .post('/api/register/authenticate', {
97
           username: this.username,
96
           username: this.username,
98
           password: this.password,
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
       this.$router.push('/');
101
       this.$router.push('/');
102
     },
102
     },
103
     togglePassword() {
103
     togglePassword() {
108
       this.showPassword = false;
108
       this.showPassword = false;
109
       this.isPasswordShown = 'password';
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
     SendMail() {},
111
     SendMail() {},
120
   },
112
   },
121
 };
113
 };

Loading…
取消
儲存