Browse Source

修改bug

修改bug
dangyunlong 2 months ago
parent
commit
05ff6eea56
2 changed files with 21 additions and 3 deletions
  1. 18 2
      src/layout/components/Sidebar/Logo.vue
  2. 3 1
      src/store/modules/user.js

+ 18 - 2
src/layout/components/Sidebar/Logo.vue

@@ -1,20 +1,36 @@
 <template>
   <div class="sidebar-logo-container" :class="{'collapse':collapse}">
     <transition name="sidebarLogoFade">
+      <!--pre环境-->
+      <a href="/" class="sidebar-logo-link" v-if="this.$store.state.user.userurl=='adminpre.bjzxtw.org.cn'||this.$store.state.user.userurl=='localhost:9527'">
+        <h1 class="sidebar-title">返回首页</h1>
+      </a>
+      <a :href="'http://' + this.$store.state.user.userurl" class="sidebar-logo-link" target="_blank" v-else>
+        <h1 class="sidebar-title">返回首页</h1>
+      </a>
+      <!--dev环境-->
+      <!-- <a href="/" class="sidebar-logo-link" v-if="this.$store.state.user.userurl=='admindev.bjzxtw.org.cn'||this.$store.state.user.userurl=='localhost:9527'">
+        <h1 class="sidebar-title">返回首页</h1>
+      </a>
+      <a :href="'http://' + this.$store.state.user.userurl" class="sidebar-logo-link" target="_blank" v-else>
+        <h1 class="sidebar-title">返回首页</h1>
+      </a> -->
+
+
       <!-- <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
         <h1 class="sidebar-title">{{ title }} </h1>
       </router-link>
       <router-link v-else key="expand" class="sidebar-logo-link" to="/">
         <h1 class="sidebar-title">{{ title }} </h1>
       </router-link> -->
-      <a :href="'http://' + this.$store.state.user.userurl" v-if="collapse" key="collapse" class="sidebar-logo-link">
+      <!-- <a :href="'http://' + this.$store.state.user.userurl" v-if="collapse" key="collapse" class="sidebar-logo-link">
         <h1 class="sidebar-title" v-if="this.$store.state.user.usertype==10000">返回首页</h1>
         <h1 class="sidebar-title" v-else>返回首页</h1>
       </a>
       <a :href="'http://' + this.$store.state.user.userurl" v-else key="expand" class="sidebar-logo-link">
         <h1 class="sidebar-title" v-if="this.$store.state.user.usertype==10000">返回首页</h1>
         <h1 class="sidebar-title" v-else>返回首页</h1>
-      </a>
+      </a> -->
     </transition>
   </div>
 </template>

+ 3 - 1
src/store/modules/user.js

@@ -89,9 +89,10 @@ const actions = {
     return new Promise((resolve, reject) => {
       login({ username: username.trim(), password: password, type: type, captcha: captcha.trim(), code: code}).then(response => {
         const { data } = response;
-
+        console.log(889900)
         //会员登录跳转 但不储存
         if(userInfo.backurl){
+          console.log("不储存用户的userurl!")
           //设置用户url
           setUserUrl(userInfo.backurl,data.exp)
           commit('SET_URL',userInfo.backurl)
@@ -105,6 +106,7 @@ const actions = {
 
         //会员登录进入系统,储存所属url
         if(userInfo.userurl){
+          console.log("储存用户的userurl!")
           setUserUrl(userInfo.userurl,data.exp)
           commit('SET_URL',userInfo.userurl)
           //设置token