libushang 6 ماه پیش
والد
کامیت
8a9b728e67
1فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 5 0
      src/views/index.vue

+ 5 - 0
src/views/index.vue

@@ -18,6 +18,7 @@ import {onMounted} from "vue";
 
 const router = useRouter();
 const useUser = useUserStore();
+const env = import.meta.env.VITE_APP_ENV;
 
 const handleJump = (path: string, role: string) => {
   useUser.setRoles(role);
@@ -25,6 +26,10 @@ const handleJump = (path: string, role: string) => {
 }
 
 onMounted(() => {
+  console.log('env:', env);
+  if(env === 'development') {
+    localStorage.setItem('Admin-Token', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIiwiZXhwIjoyMDM5Njk2ODMzfQ.Rhd38oo_S1odjg0xnT4n31cCWCAAPXGb8y_V2XcgqzQ');
+  }
   useUser.setRoles('');
   localStorage.setItem('role', '');
 })