Sfoglia il codice sorgente

修改前端基础项目相关配置

张启 4 anni fa
parent
commit
fc473635ca

+ 1 - 0
future-ui/src/layout/components/AppMain.vue

@@ -39,6 +39,7 @@ export default {
   .app-main {
     /* 84 = navbar + tags-view = 50 + 34 */
     min-height: calc(100vh - 84px);
+    background: #f5f5f5;
   }
 
   .fixed-header+.app-main {

+ 1 - 1
future-ui/src/layout/components/Sidebar/Logo.vue

@@ -35,7 +35,7 @@ export default {
   },
   data() {
     return {
-      title: '若依管理系统',
+      title: this.$store.getters.projectName,
       logo: logoImg
     }
   }

+ 2 - 2
future-ui/src/settings.js

@@ -1,5 +1,5 @@
 module.exports = {
-  title: '若依管理系统',
+  title: 'Future WEb系统',
 
   /**
    * 侧边栏主题 深色主题theme-dark,浅色主题theme-light
@@ -14,7 +14,7 @@ module.exports = {
   /**
    * 是否显示顶部导航
    */
-  topNav: true,
+  topNav: false,
 
   /**
    * 是否显示 tagsView

+ 1 - 0
future-ui/src/store/getters.js

@@ -14,5 +14,6 @@ const getters = {
   topbarRouters:state => state.permission.topbarRouters,
   defaultRoutes:state => state.permission.defaultRoutes,
   sidebarRouters:state => state.permission.sidebarRouters,
+  projectName: state => state.settings.projectName
 }
 export default getters

+ 9 - 6
future-ui/src/store/modules/app.js

@@ -1,12 +1,15 @@
 import Cookies from 'js-cookie'
 
+const sidebarStatusCookiesKey = process.env.VUE_APP_PROJECT_KEY + '-sidebarStatus'
+const sizeCookiesKey = process.env.VUE_APP_PROJECT_KEY + '-size'
+
 const state = {
   sidebar: {
-    opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
+    opened: Cookies.get(sidebarStatusCookiesKey) ? !!+Cookies.get(sidebarStatusCookiesKey) : true,
     withoutAnimation: false
   },
   device: 'desktop',
-  size: Cookies.get('size') || 'medium'
+  size: Cookies.get(sizeCookiesKey) || 'medium'
 }
 
 const mutations = {
@@ -14,13 +17,13 @@ const mutations = {
     state.sidebar.opened = !state.sidebar.opened
     state.sidebar.withoutAnimation = false
     if (state.sidebar.opened) {
-      Cookies.set('sidebarStatus', 1)
+      Cookies.set(sidebarStatusCookiesKey, 1)
     } else {
-      Cookies.set('sidebarStatus', 0)
+      Cookies.set(sidebarStatusCookiesKey, 0)
     }
   },
   CLOSE_SIDEBAR: (state, withoutAnimation) => {
-    Cookies.set('sidebarStatus', 0)
+    Cookies.set(sidebarStatusCookiesKey, 0)
     state.sidebar.opened = false
     state.sidebar.withoutAnimation = withoutAnimation
   },
@@ -29,7 +32,7 @@ const mutations = {
   },
   SET_SIZE: (state, size) => {
     state.size = size
-    Cookies.set('size', size)
+    Cookies.set(sizeCookiesKey, size)
   }
 }
 

+ 3 - 2
future-ui/src/store/modules/settings.js

@@ -1,7 +1,7 @@
 import variables from '@/assets/styles/element-variables.scss'
 import defaultSettings from '@/settings'
 
-const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo } = defaultSettings
+const { title, sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo } = defaultSettings
 
 const state = {
   theme: variables.theme,
@@ -10,7 +10,8 @@ const state = {
   topNav: topNav,
   tagsView: tagsView,
   fixedHeader: fixedHeader,
-  sidebarLogo: sidebarLogo
+  sidebarLogo: sidebarLogo,
+  projectName: title
 }
 
 const mutations = {

+ 1 - 1
future-ui/src/utils/auth.js

@@ -1,6 +1,6 @@
 import Cookies from 'js-cookie'
 
-const TokenKey = 'Admin-Token'
+const TokenKey = process.env.VUE_APP_PROJECT_KEY + '-Token'
 
 export function getToken() {
   return Cookies.get(TokenKey)

+ 5 - 6
future-ui/src/views/login.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="login">
     <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
-      <h3 class="title">若依后台管理系统</h3>
+      <h3 class="title">Future WEb系统</h3>
       <el-form-item prop="username">
         <el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
           <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
@@ -29,7 +29,7 @@
           <svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
         </el-input>
         <div class="login-code">
-          <img :src="codeUrl" @click="getCode" class="login-code-img"/>
+          <img :src="codeUrl" @click="getCode" class="login-code-img" />
         </div>
       </el-form-item>
       <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
@@ -86,7 +86,7 @@ export default {
   },
   watch: {
     $route: {
-      handler: function(route) {
+      handler: function (route) {
         this.redirect = route.query && route.query.redirect;
       },
       immediate: true
@@ -127,7 +127,7 @@ export default {
             Cookies.remove('rememberMe');
           }
           this.$store.dispatch("Login", this.loginForm).then(() => {
-            this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
+            this.$router.push({ path: this.redirect || "/" }).catch(() => { });
           }).catch(() => {
             this.loading = false;
             this.getCode();
@@ -145,8 +145,7 @@ export default {
   justify-content: center;
   align-items: center;
   height: 100%;
-  background-image: url("../assets/images/login-background.jpg");
-  background-size: cover;
+  background: linear-gradient(-38deg, #3a3e59 0%, #4f5479 100%);
 }
 .title {
   margin: 0px auto 30px auto;

+ 1 - 1
future-ui/src/views/system/menu/index.vue

@@ -49,7 +49,7 @@
       <el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column>
       <el-table-column prop="icon" label="图标" align="center" width="100">
         <template slot-scope="scope">
-          <svg-icon :icon-class="scope.row.icon" />
+            <svg-icon :icon-class="scope.row.icon || ''" />
         </template>
       </el-table-column>
       <el-table-column prop="orderNum" label="排序" width="60"></el-table-column>