Merge branch 'master' of http://192.168.11.205:9000/r/se-cloud
| | |
| | | # 页面标题 |
| | | VUE_APP_TITLE = 管理系统 |
| | | VUE_APP_TITLE = 综合管理分系统 |
| | | |
| | | # 开发环境配置 |
| | | ENV = 'development' |
| | | |
| | | # 管理系统/开发环境 |
| | | VUE_APP_BASE_API = '/dev-api' |
| | | VUE_APP_BASE_API = '/prod-api' |
| | | |
| | | # 路由懒加载 |
| | | VUE_CLI_BABEL_TRANSPILE_MODULES = true |
| | | |
| | | #项目子路径 |
| | | VUE_APP_ITEM_PATH = '/sys' |
| | |
| | | # 页面标题 |
| | | VUE_APP_TITLE = 管理系统 |
| | | VUE_APP_TITLE = 综合管理分系统 |
| | | |
| | | # 生产环境配置 |
| | | ENV = 'production' |
| | | |
| | | # 管理系统/生产环境 |
| | | VUE_APP_BASE_API = '/prod-api' |
| | | |
| | | #项目子路径 |
| | | VUE_APP_ITEM_PATH = '/sys' |
| | |
| | | # 页面标题 |
| | | VUE_APP_TITLE = 管理系统 |
| | | VUE_APP_TITLE = 综合管理分系统 |
| | | |
| | | NODE_ENV = production |
| | | |
| | |
| | | const first = matched[0] |
| | | |
| | | if (!this.isDashboard(first)) { |
| | | matched = [{ path: '/index', meta: { title: '首页' }}].concat(matched) |
| | | // matched = [{ path: '/index', meta: { title: '首页' }}].concat(matched) |
| | | } |
| | | |
| | | this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) |
| | | |
| | | |
| | | }, |
| | | isDashboard(route) { |
| | | const name = route && route.name |
| | |
| | | <template> |
| | | <div class="navbar"> |
| | | <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> |
| | | <hamburger |
| | | id="hamburger-container" |
| | | :is-active="sidebar.opened" |
| | | class="hamburger-container" |
| | | @toggleClick="toggleSideBar" |
| | | /> |
| | | |
| | | <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/> |
| | | <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/> |
| | | <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav" /> |
| | | <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" /> |
| | | |
| | | <div class="right-menu"> |
| | | <template v-if="device!=='mobile'"> |
| | | <search id="header-search" class="right-menu-item" /> |
| | | <!-- <search id="header-search" class="right-menu-item" /> --> |
| | | |
| | | <!-- <el-tooltip content="源码地址" effect="dark" placement="bottom"> |
| | | <se-git id="se-git" class="right-menu-item hover-effect" /> |
| | |
| | | |
| | | <el-tooltip content="文档地址" effect="dark" placement="bottom"> |
| | | <se-doc id="se-doc" class="right-menu-item hover-effect" /> |
| | | </el-tooltip> --> |
| | | </el-tooltip>--> |
| | | |
| | | <screenfull id="screenfull" class="right-menu-item hover-effect" /> |
| | | |
| | | <el-tooltip content="布局大小" effect="dark" placement="bottom"> |
| | | <!-- <el-tooltip content="布局大小" effect="dark" placement="bottom"> |
| | | <size-select id="size-select" class="right-menu-item hover-effect" /> |
| | | </el-tooltip> |
| | | |
| | | </el-tooltip>--> |
| | | </template> |
| | | |
| | | <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click"> |
| | | <div class="avatar-wrapper"> |
| | | <img :src="avatar" class="user-avatar"> |
| | | <img :src="avatar" class="user-avatar" /> |
| | | <i class="el-icon-caret-bottom" /> |
| | | </div> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <router-link to="/user/profile"> |
| | | <el-dropdown-item>个人中心</el-dropdown-item> |
| | | </router-link> |
| | | <el-dropdown-item @click.native="setting = true"> |
| | | <!-- <el-dropdown-item @click.native="setting = true"> |
| | | <span>布局设置</span> |
| | | </el-dropdown-item> |
| | | </el-dropdown-item>--> |
| | | <el-dropdown-item divided @click.native="logout"> |
| | | <span>退出登录</span> |
| | | </el-dropdown-item> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapGetters } from 'vuex' |
| | | import Breadcrumb from '@/components/Breadcrumb' |
| | | import TopNav from '@/components/TopNav' |
| | | import Hamburger from '@/components/Hamburger' |
| | | import Screenfull from '@/components/Screenfull' |
| | | import SizeSelect from '@/components/SizeSelect' |
| | | import Search from '@/components/HeaderSearch' |
| | | import SEGit from '@/components/se/Git' |
| | | import SEDoc from '@/components/se/Doc' |
| | | import { mapGetters } from "vuex"; |
| | | import Breadcrumb from "@/components/Breadcrumb"; |
| | | import TopNav from "@/components/TopNav"; |
| | | import Hamburger from "@/components/Hamburger"; |
| | | import Screenfull from "@/components/Screenfull"; |
| | | import SizeSelect from "@/components/SizeSelect"; |
| | | import Search from "@/components/HeaderSearch"; |
| | | import SEGit from "@/components/se/Git"; |
| | | import SEDoc from "@/components/se/Doc"; |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | SEDoc |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'sidebar', |
| | | 'avatar', |
| | | 'device' |
| | | ]), |
| | | ...mapGetters(["sidebar", "avatar", "device"]), |
| | | setting: { |
| | | get() { |
| | | return this.$store.state.settings.showSettings |
| | | return this.$store.state.settings.showSettings; |
| | | }, |
| | | set(val) { |
| | | this.$store.dispatch('settings/changeSetting', { |
| | | key: 'showSettings', |
| | | this.$store.dispatch("settings/changeSetting", { |
| | | key: "showSettings", |
| | | value: val |
| | | }) |
| | | }); |
| | | } |
| | | }, |
| | | topNav: { |
| | | get() { |
| | | return this.$store.state.settings.topNav |
| | | return this.$store.state.settings.topNav; |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | toggleSideBar() { |
| | | this.$store.dispatch('app/toggleSideBar') |
| | | this.$store.dispatch("app/toggleSideBar"); |
| | | }, |
| | | async logout() { |
| | | this.$confirm('确定注销并退出系统吗?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.$store.dispatch('LogOut').then(() => { |
| | | location.href = '/index'; |
| | | this.$confirm("确定注销并退出系统吗?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | this.$store.dispatch("LogOut").then(() => { |
| | | if ((process.env.ENV = "development")) { |
| | | window.location.href = "http://localhost:8080/login"; |
| | | } else if ((process.env.ENV = "production")) { |
| | | window.location.href = window.location.origin + "/sso/login"; |
| | | } |
| | | }); |
| | | }) |
| | | }).catch(() => {}); |
| | | .catch(() => {}); |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | overflow: hidden; |
| | | position: relative; |
| | | background: #fff; |
| | | box-shadow: 0 1px 4px rgba(0,21,41,.08); |
| | | box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08); |
| | | |
| | | .hamburger-container { |
| | | line-height: 46px; |
| | | height: 100%; |
| | | float: left; |
| | | cursor: pointer; |
| | | transition: background .3s; |
| | | -webkit-tap-highlight-color:transparent; |
| | | transition: background 0.3s; |
| | | -webkit-tap-highlight-color: transparent; |
| | | |
| | | &:hover { |
| | | background: rgba(0, 0, 0, .025) |
| | | background: rgba(0, 0, 0, 0.025); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | &.hover-effect { |
| | | cursor: pointer; |
| | | transition: background .3s; |
| | | transition: background 0.3s; |
| | | |
| | | &:hover { |
| | | background: rgba(0, 0, 0, .025) |
| | | background: rgba(0, 0, 0, 0.025); |
| | | } |
| | | } |
| | | } |
| | |
| | | to.meta.title && store.dispatch('settings/setTitle', to.meta.title) |
| | | /* has token*/ |
| | | if (to.path === '/login') { |
| | | next({ path: '/' }) |
| | | if (process.env.ENV = 'development') { |
| | | window.location.href = 'http://localhost:8080/login' |
| | | } else if (process.env.ENV = 'production') { |
| | | window.location.href = window.location.origin + '/sso/login' |
| | | } |
| | | // next({ path: '/' }) |
| | | NProgress.done() |
| | | } else if (whiteList.indexOf(to.path) !== -1) { |
| | | next() |
| | |
| | | next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 |
| | | }) |
| | | }).catch(err => { |
| | | store.dispatch('LogOut').then(() => { |
| | | Message.error(err) |
| | | next({ path: '/' }) |
| | | }) |
| | | store.dispatch('LogOut').then(() => { |
| | | Message.error(err) |
| | | if (process.env.ENV = 'development') { |
| | | window.location.href = 'http://localhost:8080/login' |
| | | } else if (process.env.ENV = 'production') { |
| | | window.location.href = window.location.origin + '/sso/login' |
| | | } |
| | | // next({ path: '/' }) |
| | | }) |
| | | }) |
| | | } else { |
| | | next() |
| | | } |
| | |
| | | // 在免登录白名单,直接进入 |
| | | next() |
| | | } else { |
| | | next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 否则全部重定向到登录页 |
| | | if (process.env.ENV = 'development') { |
| | | window.location.href = 'http://localhost:8080/login' |
| | | } else if (process.env.ENV = 'production') { |
| | | window.location.href = window.location.origin + '/sso/login' |
| | | } |
| | | NProgress.done() |
| | | } |
| | | } |
| | |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | path: '/login', |
| | | component: () => import('@/views/login'), |
| | | hidden: true |
| | | }, |
| | | // { |
| | | // path: '/login', |
| | | // component: () => import('@/views/login'), |
| | | // hidden: true |
| | | // }, |
| | | { |
| | | path: '/register', |
| | | component: () => import('@/views/register'), |
| | |
| | | { |
| | | path: '', |
| | | component: Layout, |
| | | redirect: 'index', |
| | | children: [ |
| | | { |
| | | path: 'index', |
| | | component: () => import('@/views/index'), |
| | | name: 'Index', |
| | | meta: { title: '首页', icon: 'dashboard', affix: true } |
| | | } |
| | | ] |
| | | redirect: 'system/user', |
| | | // children: [ |
| | | // { |
| | | // path: 'index', |
| | | // component: () => import('@/views/index'), |
| | | // name: 'Index', |
| | | // meta: { title: '首页', icon: 'dashboard', affix: true } |
| | | // } |
| | | // ] |
| | | }, |
| | | { |
| | | path: '/user', |
| | |
| | | |
| | | export default new Router({ |
| | | mode: 'history', // 去掉url中的# |
| | | base: process.env.VUE_APP_ITEM_PATH, |
| | | scrollBehavior: () => ({ y: 0 }), |
| | | routes: constantRoutes |
| | | }) |
| | |
| | | const service = axios.create({ |
| | | // axios中请求配置有baseURL选项,表示请求URL公共部分 |
| | | baseURL: process.env.VUE_APP_BASE_API, |
| | | //baseURL: 'http://192.168.11.203:8090/prod-api', |
| | | // baseURL: 'http://192.168.11.203:8090/prod-api', |
| | | // 超时 |
| | | timeout: 10000 |
| | | }) |
| | |
| | | } |
| | | return config |
| | | }, error => { |
| | | console.log(error) |
| | | Promise.reject(error) |
| | | console.log(error) |
| | | Promise.reject(error) |
| | | }) |
| | | |
| | | // 响应拦截器 |
| | | service.interceptors.response.use(res => { |
| | | // 未设置状态码则默认成功状态 |
| | | const code = res.data.code || 200; |
| | | // 获取错误信息 |
| | | const msg = errorCode[code] || res.data.msg || errorCode['default'] |
| | | // 二进制数据则直接返回 |
| | | if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { |
| | | return res.data |
| | | } |
| | | if (code === 401) { |
| | | if (!isRelogin.show) { |
| | | isRelogin.show = true; |
| | | MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { |
| | | isRelogin.show = false; |
| | | store.dispatch('LogOut').then(() => { |
| | | location.href = '/index'; |
| | | }) |
| | | // 未设置状态码则默认成功状态 |
| | | const code = res.data.code || 200; |
| | | // 获取错误信息 |
| | | const msg = errorCode[code] || res.data.msg || errorCode['default'] |
| | | // 二进制数据则直接返回 |
| | | if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { |
| | | return res.data |
| | | } |
| | | if (code === 401) { |
| | | if (!isRelogin.show) { |
| | | isRelogin.show = true; |
| | | MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { |
| | | isRelogin.show = false; |
| | | store.dispatch('LogOut').then(() => { |
| | | if ((process.env.ENV = "development")) { |
| | | window.location.href = "http://localhost:8080/login"; |
| | | } else if ((process.env.ENV = "production")) { |
| | | window.location.href = window.location.origin + "/sso/login"; |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | isRelogin.show = false; |
| | | }); |
| | | } |
| | | return Promise.reject('无效的会话,或者会话已过期,请重新登录。') |
| | | } else if (code === 500) { |
| | | Message({ message: msg, type: 'error' }) |
| | | return Promise.reject(new Error(msg)) |
| | | } else if (code === 601) { |
| | | Message({ message: msg, type: 'warning' }) |
| | | return Promise.reject('error') |
| | | } else if (code !== 200) { |
| | | Notification.error({ title: msg }) |
| | | return Promise.reject('error') |
| | | } else { |
| | | return res.data |
| | | } |
| | | }, |
| | | return Promise.reject('无效的会话,或者会话已过期,请重新登录。') |
| | | } else if (code === 500) { |
| | | Message({ message: msg, type: 'error' }) |
| | | return Promise.reject(new Error(msg)) |
| | | } else if (code === 601) { |
| | | Message({ message: msg, type: 'warning' }) |
| | | return Promise.reject('error') |
| | | } else if (code !== 200) { |
| | | Notification.error({ title: msg }) |
| | | return Promise.reject('error') |
| | | } else { |
| | | return res.data |
| | | } |
| | | }, |
| | | error => { |
| | | console.log('err' + error) |
| | | let { message } = error; |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getCodeImg } from "@/api/login"; |
| | | // import { getCodeImg } from "@/api/login"; |
| | | import Cookies from "js-cookie"; |
| | | import { encrypt, decrypt } from '@/utils/jsencrypt' |
| | | |
| | |
| | | return { |
| | | codeUrl: "", |
| | | loginForm: { |
| | | username: "admin", |
| | | password: "admin123", |
| | | username: "", |
| | | password: "", |
| | | rememberMe: false, |
| | | code: "", |
| | | uuid: "" |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | // this.getCode(); |
| | | this.getCode(); |
| | | this.getCookie(); |
| | | }, |
| | | methods: { |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div :style="styleObject" class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> |
| | | <el-form-item label="角色名称" prop="roleName"> |
| | | <el-input |
| | |
| | | /> |
| | | |
| | | <!-- 添加或修改角色配置对话框 --> |
| | | <!-- :wrapperClosable="false" 点击遮罩层是否可以关闭 Drawer--> |
| | | <el-drawer |
| | | title="信息修改" |
| | | :visible.sync="open" |
| | | direction="rtl" |
| | | custom-class="demo-drawer" |
| | | size="500px" |
| | | ref="drawer" |
| | | append-to-body |
| | | :modal="false" |
| | | :before-close="cancel" |
| | | > |
| | | <div class="demo-drawer__content"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="120px"> |
| | | <el-form-item label="角色名称" prop="roleName"> |
| | | <el-input v-model="form.roleName" placeholder="请输入角色名称" /> |
| | | </el-form-item> |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <div class="demo-drawer__footer"> |
| | | <!-- <el-button >取 消</el-button> |
| | | <el-button @click="cancel">取 消</el-button> |
| | | <el-button |
| | | type="primary" |
| | | @click="$refs.drawer.closeDrawer()" |
| | | @click="submitForm" |
| | | :loading="loading" |
| | | >{{ loading ? '提交中 ...' : '确 定' }}</el-button>--> |
| | | >{{ loading ? '提交中 ...' : '确 定' }}</el-button> |
| | | </div> |
| | | </div> |
| | | </el-drawer> |
| | |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .demo-drawer__footer { |
| | | width: 100%; |
| | | position: absolute; |
| | | bottom: 0; |
| | | left: 0; |
| | | border-top: 1px solid #e8e8e8; |
| | | padding: 10px 16px; |
| | | text-align: right; |
| | | background-color: bfa; |
| | | } |
| | | </style> |
| | | <script> |
| | | import { |
| | | listRole, |
| | |
| | | roleKey: undefined, |
| | | status: undefined |
| | | }, |
| | | styleObject: {}, |
| | | // 表单参数 |
| | | form: {}, |
| | | defaultProps: { |
| | |
| | | // 取消按钮 |
| | | cancel() { |
| | | this.open = false; |
| | | this.styleObject = { width: "100%" }; |
| | | this.reset(); |
| | | }, |
| | | // 取消按钮(数据权限) |
| | |
| | | this.reset(); |
| | | this.getMenuTreeselect(); |
| | | this.open = true; |
| | | |
| | | this.title = "添加角色"; |
| | | }, |
| | | /** 修改按钮操作 */ |
| | |
| | | getRole(roleId).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.styleObject = { width: "70%" }; |
| | | this.$nextTick(() => { |
| | | roleMenu.then(res => { |
| | | let checkedKeys = res.checkedKeys; |
| | |
| | | updateRole(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.styleObject = { width: "100%" }; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | |
| | | addRole(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.styleObject = { width: "100%" }; |
| | | this.getList(); |
| | | }); |
| | | } |
| | |
| | | <div class="pull-right">{{ user.phonenumber }}</div> |
| | | </li> |
| | | <li class="list-group-item"> |
| | | <svg-icon icon-class="phone" />密级 |
| | | <div |
| | | class="pull-right" |
| | | >{{selectDictLabel(dict.type.sys_secret_level, user.secretLevel)}}</div> |
| | | </li> |
| | | <li class="list-group-item"> |
| | | <svg-icon icon-class="email" />用户邮箱 |
| | | <div class="pull-right">{{ user.email }}</div> |
| | | </li> |
| | |
| | | export default { |
| | | name: "Profile", |
| | | components: { userAvatar, userInfo, resetPwd }, |
| | | dicts: ["sys_secret_level"], |
| | | data() { |
| | | return { |
| | | user: {}, |
| | |
| | | // 部署生产环境和开发环境下的URL。 |
| | | // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 |
| | | // 例如 https://www.se.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.se.vip/admin/,则设置 baseUrl 为 /admin/。 |
| | | publicPath: process.env.NODE_ENV === "production" ? "/" : "/", |
| | | publicPath: process.env.NODE_ENV === "production" ? process.env.VUE_APP_ITEM_PATH : "/", |
| | | // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) |
| | | outputDir: 'dist', |
| | | // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) |
| | |
| | | //target: `http://192.168.11.203:8090`, |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | ['^' + process.env.VUE_APP_BASE_API]: '' |
| | | ['^' + process.env.VUE_APP_BASE_API]: process.env.VUE_APP_BASE_API |
| | | } |
| | | } |
| | | }, |