Bläddra i källkod

fix local txt error

huaisianhuang 3 år sedan
förälder
incheckning
076f9383d7
2 ändrade filer med 4 tillägg och 3 borttagningar
  1. 2 1
      html/script_profiles.js
  2. 2 2
      html/static/script_util.js

+ 2 - 1
html/script_profiles.js

@@ -14,6 +14,7 @@ let userBasics = JSON.parse(localStorage.getItem('user_profile')) || [];
 
 function checkLocal() {
   if(userBasics.length == 0){ return };
+  //userBasics = JSON.parse(userBasics);
   console.log(userBasics);
   $('.userName').html(`<h2 class="user-name text-white mt-4 fw-bold">Hi ${userBasics.user_info.userName}</h2>`);
 }
@@ -23,7 +24,7 @@ $('.dropdown-toggle').click(() => {
   checkLan();
 });
 
-checkLocal();
+//checkLocal();
 
 function checkLan() {
   if(lan == 'en') {

+ 2 - 2
html/static/script_util.js

@@ -3,9 +3,9 @@ checkRoute();
 let userBasics = JSON.parse(localStorage.getItem('user_profile')) || [];
 
 
-if(userBasics !== []){
+/* if(userBasics !== []){
   $('.userName').html(`<h2 class="user-name text-white mt-lg-3 mt-xl-1 fw-bold">Hi ${userBasics.user_info.userName}</h2>`);
-}
+} */
 
 
 function checkRoute() {