ソースを参照

Login Fix

master
30117125 4年前
コミット
a279b52c6c

+ 4
- 7
package-lock.json ファイルの表示

12437
       "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.1.5.tgz",
12437
       "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.1.5.tgz",
12438
       "integrity": "sha512-BszkPvhl7I9h334GjckCh7sVFyjTPMMJFJ4Bsrem/Ik+B/9gt5tgrk8k4gGLO4ZpdvciVdg7O41gW4DisQWurg=="
12438
       "integrity": "sha512-BszkPvhl7I9h334GjckCh7sVFyjTPMMJFJ4Bsrem/Ik+B/9gt5tgrk8k4gGLO4ZpdvciVdg7O41gW4DisQWurg=="
12439
     },
12439
     },
12440
-    "vue-share-social": {
12441
-      "version": "0.3.2",
12442
-      "resolved": "https://registry.npmjs.org/vue-share-social/-/vue-share-social-0.3.2.tgz",
12443
-      "integrity": "sha512-8YEm2Kkl756bhqSfXPtQqnOOItz7/DQWU6E4L+vC4dgT4rp0+XnqsgJAr4OXVQRRUNDO7TS8W0W79+zhfvh4pQ==",
12444
-      "requires": {
12445
-        "vue": "^2.5.16"
12446
-      }
12440
+    "vue-social-sharing": {
12441
+      "version": "3.0.0-beta.11",
12442
+      "resolved": "https://registry.npmjs.org/vue-social-sharing/-/vue-social-sharing-3.0.0-beta.11.tgz",
12443
+      "integrity": "sha512-jIATgcKcBGQveAbU4sKjHcsGN7gI/bq/T9fm/5qowtBuZe0I+5CZRWcAGDd6G64HzQfFEyNBLC02GYjMtaovhA=="
12447
     },
12444
     },
12448
     "vue-style-loader": {
12445
     "vue-style-loader": {
12449
       "version": "4.1.2",
12446
       "version": "4.1.2",

+ 1
- 1
package.json ファイルの表示

36
     "vue-json-excel": "^0.2.98",
36
     "vue-json-excel": "^0.2.98",
37
     "vue-owl-carousel": "^2.0.3",
37
     "vue-owl-carousel": "^2.0.3",
38
     "vue-router": "^3.1.5",
38
     "vue-router": "^3.1.5",
39
-    "vue-share-social": "^0.3.2",
39
+    "vue-social-sharing": "^3.0.0-beta.11",
40
     "vue-trix": "^1.1.7",
40
     "vue-trix": "^1.1.7",
41
     "vue2-editor": "^2.10.2",
41
     "vue2-editor": "^2.10.2",
42
     "vue2-google-maps": "^0.10.7",
42
     "vue2-google-maps": "^0.10.7",

+ 18
- 9
src/components/property/residential/singleView/contentSection.vue ファイルの表示

49
           </div>
49
           </div>
50
           <div class="panel-left px-5 pb-5 text-center">
50
           <div class="panel-left px-5 pb-5 text-center">
51
             <h4 class="text-white">Share this Property</h4>
51
             <h4 class="text-white">Share this Property</h4>
52
-            <a id="fb_share" href="#" target="_blank"
53
-              ><img src="img/icon-facebook.svg" alt="Share on Facebook" class="col-3 p-1 mx-1"
54
-            /></a>
52
+            <ShareNetwork
53
+              v-if="currentUrl !== ''"
54
+              network="facebook"
55
+              :url="currentUrl"
56
+              title="Uni-Vate Property Listing"
57
+              description="Check out this property on Uni-Vate Properties!"
58
+              quote="The hot reload is so fast it\'s near instant. - Evan You"
59
+              hashtags="vuejs,vite"
60
+            >
61
+              <img src="img/icon-facebook.svg" alt="Share on Facebook" class="col-3 p-1 mx-1" />
62
+            </ShareNetwork>
63
+
55
             <a
64
             <a
56
               href="mailto:?Subject=Simple Share Buttons&amp;Body=I%20saw%20this%20and%20thought%20of%20you!%20 https://www.univateproperties.co.za/"
65
               href="mailto:?Subject=Simple Share Buttons&amp;Body=I%20saw%20this%20and%20thought%20of%20you!%20 https://www.univateproperties.co.za/"
57
               ><img src="/img/icon-email.svg" alt="Share on email" class="col-3 p-1 mx-1"
66
               ><img src="/img/icon-email.svg" alt="Share on email" class="col-3 p-1 mx-1"
65
             /></a>
74
             /></a>
66
           </div>
75
           </div>
67
         </div>
76
         </div>
77
+        <div></div>
68
         <div class="col-md-8 p-5 resort-profile">
78
         <div class="col-md-8 p-5 resort-profile">
69
           <h2 v-if="property.showAddress">
79
           <h2 v-if="property.showAddress">
70
             <div style="display:inline" v-if="property.propertyName !== null">
80
             <div style="display:inline" v-if="property.propertyName !== null">
127
 /* eslint-disable */
137
 /* eslint-disable */
128
 import { mapState, mapActions } from "vuex";
138
 import { mapState, mapActions } from "vuex";
129
 import gallery from "../../../shared/gallerySlideShow";
139
 import gallery from "../../../shared/gallerySlideShow";
130
-import { ShareFacebook } from "vue-share-social";
140
+import { ShareFacebook } from "vue-social-sharing";
131
 export default {
141
 export default {
132
   components: {
142
   components: {
133
     gallery,
143
     gallery,
139
   },
149
   },
140
   created() {
150
   created() {
141
     //this.getListsForPropertyEdit(this.property.id);
151
     //this.getListsForPropertyEdit(this.property.id);
142
-    console.log(this.property.displayData);
143
   },
152
   },
144
-  mounted() {
145
-    // var facebookShare = document.getElementById("fb_share");
146
-    // facebookShare.href = "http://www.facebook.com/share.php?u=" + encodeURIComponent(location.href);
153
+  async mounted() {
154
+    this.currentUrl = window.location.origin + this.$route.fullPath;
147
   },
155
   },
148
   data() {
156
   data() {
149
     return {
157
     return {
150
       index: null,
158
       index: null,
151
-      date: new Date()
159
+      date: new Date(),
160
+      currentUrl: ""
152
     };
161
     };
153
   },
162
   },
154
   methods: {
163
   methods: {

+ 14
- 3
src/components/shared/navBar.vue ファイルの表示

179
                   <li class="mx-1">
179
                   <li class="mx-1">
180
                     <router-link to="/share/contact">Contact Us</router-link>
180
                     <router-link to="/share/contact">Contact Us</router-link>
181
                   </li>
181
                   </li>
182
-                  <li v-if="isLoggedIn" class="menu-has-children mx-1">
182
+                  <li v-if="USER" class="menu-has-children mx-1">
183
                     <div
183
                     <div
184
                       @mouseover="userClass = 'ts-display'"
184
                       @mouseover="userClass = 'ts-display'"
185
                       @mouseleave="userClass = 'no-display'"
185
                       @mouseleave="userClass = 'no-display'"
186
                     ></div>
186
                     ></div>
187
+
187
                     <a href="#" class="sf-with-ul">
188
                     <a href="#" class="sf-with-ul">
188
                       {{ NAME }}
189
                       {{ NAME }}
189
                     </a>
190
                     </a>
331
                     </ul>
332
                     </ul>
332
                   </li>
333
                   </li>
333
 
334
 
334
-                  <li v-if="!isLoggedIn">
335
+                  <li v-if="!USER">
335
                     <router-link class="btn-white-border p-2 ml-1 mr-1" to="/user/login"
336
                     <router-link class="btn-white-border p-2 ml-1 mr-1" to="/user/login"
336
                       >Login</router-link
337
                       >Login</router-link
337
                     >
338
                     >
338
                   </li>
339
                   </li>
339
 
340
 
340
-                  <li v-if="!isLoggedIn">
341
+                  <li v-if="!USER">
341
                     <router-link class=" btn-solid-blue pt-2 pb-2" to="/user/register"
342
                     <router-link class=" btn-solid-blue pt-2 pb-2" to="/user/register"
342
                       >Register</router-link
343
                       >Register</router-link
343
                     >
344
                     >
440
     NAME() {
441
     NAME() {
441
       return Log.getPerson().name;
442
       return Log.getPerson().name;
442
     },
443
     },
444
+    USER() {
445
+      var userObj = {};
446
+      if (!this.user) {
447
+        userObj = JSON.parse(localStorage.getItem("user"));
448
+      } else {
449
+        userObj = this.user;
450
+      }
451
+
452
+      return userObj;
453
+    },
443
     ROLE() {
454
     ROLE() {
444
       var userObj = JSON.parse(localStorage.getItem("user"));
455
       var userObj = JSON.parse(localStorage.getItem("user"));
445
       return userObj.role;
456
       return userObj.role;

+ 1
- 1
src/components/user/loginPage.vue ファイルの表示

118
     },
118
     },
119
     Login() {
119
     Login() {
120
       this.login({ username: this.username, password: this.password })
120
       this.login({ username: this.username, password: this.password })
121
-        .then(fufilled => {
121
+        .then(() => {
122
           this.$router.push("/");
122
           this.$router.push("/");
123
         })
123
         })
124
         .catch(err => {
124
         .catch(err => {

+ 2
- 2
src/main.js ファイルの表示

8
 import store from "./store";
8
 import store from "./store";
9
 import * as VueGoogleMaps from "vue2-google-maps";
9
 import * as VueGoogleMaps from "vue2-google-maps";
10
 import Vuetify from "vuetify";
10
 import Vuetify from "vuetify";
11
-import VueShareSocial from "vue-share-social";
11
+import VueSocialSharing from "vue-social-sharing";
12
 import VueCurrencyInput from "vue-currency-input";
12
 import VueCurrencyInput from "vue-currency-input";
13
 import VueFloatLabel from "vue-float-label";
13
 import VueFloatLabel from "vue-float-label";
14
 
14
 
15
-Vue.use(VueShareSocial);
15
+Vue.use(VueSocialSharing);
16
 Vue.use(EvaIcons);
16
 Vue.use(EvaIcons);
17
 Vue.use(Vuetify);
17
 Vue.use(Vuetify);
18
 Vue.use(VueFloatLabel);
18
 Vue.use(VueFloatLabel);

+ 2
- 0
src/store/modules/user/authentication.js ファイルの表示

76
         method: "POST"
76
         method: "POST"
77
       });
77
       });
78
       if (response.status === 200) {
78
       if (response.status === 200) {
79
+        console.log(response);
80
+
79
         log.clearValues();
81
         log.clearValues();
80
         log.setValues(response.data);
82
         log.setValues(response.data);
81
         commit("auth_success", response.data);
83
         commit("auth_success", response.data);

読み込み中…
キャンセル
保存