1.添加mode提示、2.mock模式侧边栏不限制权限全显示
| | |
| | | var baseUrl = '//线上请求路径/' // 基础路径 |
| | | var testBaseUrl = 'http://192.168.31.22:8080/' // 开发测试路径 |
| | | // var testBaseUrl = 'http://192.168.1.163:8080/'; // 开发测试路径 |
| | | // var testBaseUrl = 'http://192.168.31.143:8080/' // 开发测试路径 - 和 |
| | | // var testBaseUrl = 'http://192.168.31.143:8888/'; // 开发测试路径 - 和 |
| | | var baseUrl = '//线上请求路径/' // 基础路径(本地非跨域路径) |
| | | var testBaseUrl = 'http://192.168.31.22:8080/' // 开发测试路径(本地非跨域路径) |
| | | var isCrossDomain = 1 // 是否跨域 |
| | | var isTest = 0 // 是否测试 |
| | | var isMock = 1 // 是否使用mock |
| | |
| | | console.log('本次运行的服务器域名: ', baseUrl) |
| | | } |
| | | |
| | | var style_tx = 'font-weight:bold;font-size: 40px' |
| | | if (isMock) { |
| | | console.log('%cNow is in mock mode', style_tx) |
| | | } else if (isTest) { |
| | | console.log('%cNow is in test mode', style_tx) |
| | | } |
| | | |
| | | export { baseUrl, isCrossDomain, isMock } |
| | | // modules.export={ |
| | | // baseUrl |
| | |
| | | <div class="sidebar-logo-container" :class="{'collapse':collapse}"> |
| | | <transition name="sidebarLogoFade"> |
| | | <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/"> |
| | | <img v-if="logo" :src="logo" class="sidebar-logo"> |
| | | <img v-if="logo" :src="logo" class="sidebar-logo logo-center"> |
| | | <h1 v-else class="sidebar-title">{{ title }} </h1> |
| | | </router-link> |
| | | <router-link v-else key="expand" class="sidebar-logo-link" to="/"> |
| | |
| | | margin-right: 12px; |
| | | } |
| | | |
| | | & .logo-center { |
| | | margin-top: 50%; |
| | | transform: translateY(-50%); |
| | | } |
| | | |
| | | & .sidebar-title { |
| | | display: inline-block; |
| | | margin: 0; |
| | |
| | | import Logo from './Logo' |
| | | import SidebarItem from './SidebarItem' |
| | | import variables from '@/styles/variables.scss' |
| | | var isMock = require('@/config/baseConfig').isMock // 全局配置文件 |
| | | |
| | | export default { |
| | | components: { SidebarItem, Logo }, |
| | |
| | | return menuData.filter((menu) => { |
| | | // 仅有一级菜单 |
| | | if (!menu.children) { |
| | | // isMock=1 全显示 |
| | | if (isMock) return true |
| | | // 不存在权限的话,默认显示 |
| | | // console.log(menu.auth, menu.auth ? !!authData[menu.auth] : true) |
| | | // 忽视hidden=true |
| | |
| | | if (menu.children.length) { |
| | | // 递归 |
| | | menu.children = this.jun_filterAuth(menu.children, authData) |
| | | // isMock=1 全显示 |
| | | if (isMock) return true |
| | | return menu.children.length |
| | | } |
| | | }) |
| | |
| | | <img style="max-width:100%" :src="uploadPreviewUrl" alt=""> |
| | | </el-dialog> |
| | | |
| | | <back-to-top :custom-style="myBackToTopStyle" :visibility-height="300" :back-position="50" transition-name="fade" /> |
| | | <back-to-top :visibility-height="300" :back-position="50" transition-name="fade" /> |
| | | |
| | | </div> |
| | | </template> |
| | |
| | | }, |
| | | |
| | | // 初始化地区 |
| | | areaOpts: Area.getAreaOpts(Area.data), // 省市区数据 |
| | | |
| | | // 回到顶部 |
| | | myBackToTopStyle: { |
| | | right: '50px', |
| | | bottom: '50px', |
| | | width: '40px', |
| | | height: '40px', |
| | | 'border-radius': '4px', |
| | | 'line-height': '45px', // 请保持与高度一致以垂直居中 |
| | | background: '#e7eaf1'// 按钮的背景颜色 |
| | | }, |
| | | areaOpts: Area.getAreaOpts(Area.data), // 省市区数据s |
| | | |
| | | // 表单校验 |
| | | rules: { |
| | |
| | | :limit.sync="pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <back-to-top :visibility-height="300" :back-position="50" transition-name="fade" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import BackToTop from '@/components/BackToTop' |
| | | export default { |
| | | name: 'Demo', |
| | | components: { BackToTop }, |
| | | data() { |
| | | return { |
| | | showSearch: true, // 是否显示搜索区 |