13693261870
2024-09-02 2671888e8977e3e84d29130f32f113bb8154d8e5
Merge branch 'master' of http://192.168.11.205:9000/r/se-cloud
已修改12个文件
293 ■■■■■ 文件已修改
se-ui/.env.development 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
se-ui/.env.production 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
se-ui/.env.staging 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
se-ui/src/components/Breadcrumb/index.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
se-ui/src/layout/components/Navbar.vue 98 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
se-ui/src/permission.js 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
se-ui/src/router/index.js 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
se-ui/src/utils/request.js 70 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
se-ui/src/views/login.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
se-ui/src/views/system/role/index.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
se-ui/src/views/system/user/profile/index.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
se-ui/vue.config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
se-ui/.env.development
@@ -1,11 +1,14 @@
# 页面标题
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'
se-ui/.env.production
@@ -1,8 +1,11 @@
# 页面标题
VUE_APP_TITLE = 管理系统
VUE_APP_TITLE = 综合管理分系统
# 生产环境配置
ENV = 'production'
# 管理系统/生产环境
VUE_APP_BASE_API = '/prod-api'
#项目子路径
VUE_APP_ITEM_PATH = '/sys'
se-ui/.env.staging
@@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = 管理系统
VUE_APP_TITLE = 综合管理分系统
NODE_ENV = production
se-ui/src/components/Breadcrumb/index.vue
@@ -35,10 +35,12 @@
      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
se-ui/src/layout/components/Navbar.vue
@@ -1,13 +1,18 @@
<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" />
@@ -15,28 +20,27 @@
        <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>
@@ -47,15 +51,15 @@
</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: {
@@ -69,45 +73,47 @@
    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>
@@ -116,18 +122,18 @@
  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);
    }
  }
@@ -164,10 +170,10 @@
      &.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);
        }
      }
    }
se-ui/src/permission.js
@@ -16,7 +16,12 @@
    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()
@@ -32,11 +37,16 @@
            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()
      }
@@ -47,7 +57,11 @@
      // 在免登录白名单,直接进入
      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()
    }
  }
se-ui/src/router/index.js
@@ -41,11 +41,11 @@
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/login'),
    hidden: true
  },
  // {
  //   path: '/login',
  //   component: () => import('@/views/login'),
  //   hidden: true
  // },
  {
    path: '/register',
    component: () => import('@/views/register'),
@@ -64,15 +64,15 @@
  {
    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',
@@ -178,6 +178,7 @@
export default new Router({
  mode: 'history', // 去掉url中的#
  base: process.env.VUE_APP_ITEM_PATH,
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})
se-ui/src/utils/request.js
@@ -16,7 +16,7 @@
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
})
@@ -68,46 +68,50 @@
  }
  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;
se-ui/src/views/login.vue
@@ -47,7 +47,7 @@
</template>
<script>
import { getCodeImg } from "@/api/login";
// import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt'
@@ -57,8 +57,8 @@
    return {
      codeUrl: "",
      loginForm: {
        username: "admin",
        password: "admin123",
        username: "",
        password: "",
        rememberMe: false,
        code: "",
        uuid: ""
@@ -89,7 +89,7 @@
    }
  },
  created() {
    // this.getCode();
    this.getCode();
    this.getCookie();
  },
  methods: {
se-ui/src/views/system/role/index.vue
@@ -1,5 +1,5 @@
<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
@@ -166,16 +166,20 @@
    />
    <!-- 添加或修改角色配置对话框 -->
    <!--     :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>
@@ -231,12 +235,12 @@
          </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>
@@ -341,7 +345,18 @@
    </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,
@@ -424,6 +439,7 @@
        roleKey: undefined,
        status: undefined
      },
      styleObject: {},
      // 表单参数
      form: {},
      defaultProps: {
@@ -517,6 +533,7 @@
    // 取消按钮
    cancel() {
      this.open = false;
      this.styleObject = { width: "100%" };
      this.reset();
    },
    // 取消按钮(数据权限)
@@ -619,6 +636,7 @@
      this.reset();
      this.getMenuTreeselect();
      this.open = true;
      this.title = "添加角色";
    },
    /** 修改按钮操作 */
@@ -629,6 +647,7 @@
      getRole(roleId).then(response => {
        this.form = response.data;
        this.open = true;
        this.styleObject = { width: "70%" };
        this.$nextTick(() => {
          roleMenu.then(res => {
            let checkedKeys = res.checkedKeys;
@@ -677,6 +696,7 @@
            updateRole(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.styleObject = { width: "100%" };
              this.getList();
            });
          } else {
@@ -684,6 +704,7 @@
            addRole(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.styleObject = { width: "100%" };
              this.getList();
            });
          }
se-ui/src/views/system/user/profile/index.vue
@@ -20,6 +20,12 @@
                <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>
@@ -67,6 +73,7 @@
export default {
  name: "Profile",
  components: { userAvatar, userInfo, resetPwd },
  dicts: ["sys_secret_level"],
  data() {
    return {
      user: {},
se-ui/vue.config.js
@@ -17,7 +17,7 @@
  // 部署生产环境和开发环境下的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) 的;(项目打包之后,静态资源会放在这个文件夹下)
@@ -38,7 +38,7 @@
        //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
        }
      }
    },