yujialong 4 years ago
parent 4e0d06ed0c
commit 806dbbec53
  1. 7
      src/layouts/header/index.vue
  2. 4
      src/libs/auth/generateBtnPermission.js
  3. 6
      src/libs/bus.js
  4. 8
      src/libs/route/addRoutes.js
  5. 7
      src/libs/route/generateRoutes.js
  6. 2
      src/libs/route/resetRouter.js
  7. 6
      src/libs/util.cookies.js
  8. 23
      src/libs/util.js
  9. 6
      src/pages/account/login/index.vue
  10. 2
      src/plugins/auth/index.js
  11. 26
      src/store/modules/auth.js
  12. 0
      src/styles/lib/_background.scss
  13. 0
      src/styles/lib/_border.scss
  14. 0
      src/styles/lib/_box.scss
  15. 0
      src/styles/lib/_cursor.scss
  16. 0
      src/styles/lib/_display.scss
  17. 0
      src/styles/lib/_flex.scss
  18. 0
      src/styles/lib/_float.scss
  19. 0
      src/styles/lib/_font-size.scss
  20. 0
      src/styles/lib/_font-weight.scss
  21. 0
      src/styles/lib/_line-height.scss
  22. 0
      src/styles/lib/_link.scss
  23. 0
      src/styles/lib/_overflow.scss
  24. 0
      src/styles/lib/_position.scss
  25. 0
      src/styles/lib/_size.scss
  26. 0
      src/styles/lib/_text-align.scss
  27. 0
      src/styles/lib/_text-color.scss
  28. 0
      src/styles/lib/_vertical-align.scss
  29. 0
      src/styles/lib/_visibility.scss
  30. 0
      src/styles/lib/_white-space.scss
  31. 1
      src/styles/lib/index.scss
  32. 9
      src/styles/lib/mixin.scss
  33. 104
      src/styles/pages/tree.scss
  34. 24
      src/styles/var.scss
  35. 3
      vue.config.js

@ -39,13 +39,14 @@ export default {
},
methods: {
...mapActions('user', [
'logout'
]),
toPerson(){
this.$router.push('/setting/person')
},
loginout() {
sessionStorage.removeItem(Setting.usernameKey);
sessionStorage.removeItem(Setting.storeKey);
location.reload()
this.logout()
},
back(){
this.$router.back()

@ -2,7 +2,7 @@
* @description 生成按钮级别权限组
* */
import store from '@/store';
import store from '@/store'
export default function(data){
let result = []
data.map(e => {
@ -21,6 +21,6 @@ export default function(data){
})
}
})
store.commit('addBtnPerData',{btnPermissions: result})
store.auth.commit('addBtnAuth',{btns: result})
// console.log('geneBtn:',result)
}

@ -1,6 +1,6 @@
import Vue from 'vue';
import Vue from 'vue'
// 使用 Event Bus
const bus = new Vue();
const bus = new Vue()
export default bus;
export default bus

@ -1,6 +1,6 @@
import store from '@/store';
import router from '@/router';
import generateBtnPermission from '../auth/generateBtnPermission';
import store from '@/store'
import router from '@/router'
import generateBtnPermission from '../auth/generateBtnPermission'
const infoSidebar = ['information','content']
const matchSidebar = ['matchintro','matchprogress','matchsignup']
@ -33,7 +33,7 @@ export default function(data,path){
createRoute(data)
let routes = router.options.routes
routes[1].children = [...routes[1].children,...newRoutes]
store.commit("addRoutesData", { routes })
store.auth.commit("addRoutes", { routes })
router.addRoutes(routes)
setTimeout(() => {
!newRoutes.find(n => n.name == 'dashboard') && router.push(newRoutes[0].path)

@ -1,10 +1,9 @@
import store from '@/store';
import router from '@/router';
import store from '@/store'
import router from '@/router'
export default function(){
setTimeout(() => {
let routes = store.state.routes
console.log(333,routes)
let routes = store.state.auth.routes
routes.forEach(e => {
if(e.path == '/'){
e.component = () => import('@/layouts/home/index.vue')

@ -1,4 +1,4 @@
import router from '@/router';
import router from '@/router'
export default function(){
const newRouter = createRouter()

@ -1,7 +1,7 @@
import Cookies from 'js-cookie';
import Setting from '@/setting';
import Cookies from 'js-cookie'
import Setting from '@/setting'
const cookies = {};
const cookies = {}
/**
* @description 存储 cookie

@ -1,5 +1,5 @@
import cookies from './util.cookies';
import {_local,_session} from './util.db';
import cookies from './util.cookies'
import {_local,_session} from './util.db'
const util = {
cookies,
@ -57,7 +57,22 @@ const util = {
break;
}
}
},
// 传入文件后缀判断是否是视频
isVideo(ext) {
if('mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv'.includes(ext)) return true
return false
},
// 传入文件后缀判断是否是音频
isAudio(ext) {
if('mp3,aac,ape,flac,wav,wma,amr,mid'.includes(ext)) return true
return false
},
// 传入文件后缀判断是否是图片
isImg(ext) {
if('jpg,jpeg,png,gif,svg,psd'.includes(ext)) return true
return false
}
}
};
export default util;
export default util

@ -94,11 +94,9 @@ export default {
this.login(data).then(() => {
this.$router.replace('/index')
})
.catch(() => {
})
.catch(() => {})
}
});
})
}
},
};

@ -13,7 +13,7 @@ export default {
}else{
btnText = `${vnode.context.$route.name}:${el.innerText}`
}
const btnPermissions = store.state.btnPermissions;
const btnPermissions = store.state.auth.btns;
// console.log(22,btnText,btnPermissions)
if (btnText && btnPermissions && btnPermissions.length) {

@ -0,0 +1,26 @@
/**
* 权限管理
* */
export default {
namespaced: true,
state: {
btns: [],
routes: []
},
mutations: {
SET_BTN_AUTH: (state, btns) => {
state.btns = btns
},
SET_ROUTE: (state, routes) => {
state.routes = routes
},
},
actions: {
addBtnAuth({ state,commit },btns) {
commit('SET_BTN_AUTH',btns)
},
addRoutes({ state,commit },routes) {
commit('SET_ROUTE',routes)
}
}
}

@ -26,4 +26,3 @@
@import "white-space";
@import "style";
@import "mixin";

@ -1,9 +0,0 @@
@mixin ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ellipsis{
@include ellipsis();
}

@ -0,0 +1,104 @@
$insideColor: rgba(245, 242, 255, 0.8); //内部节点的边框颜色
$outColor: rgba(255, 255, 255, 0.8); //外部节点的边框颜色
//混合代码,提取item共同样式
@mixin public {
cursor: pointer;
font-size: 14px;
color: #333333;
display: flex;
align-items: center;
img {
height: 20px;
width: 20px;
margin-left: 10px;
}
}
.side_tree{
width: 100%;
font-size: 14px;
color: #333;
i{
margin-left: 5px;
font-size: 17px;
}
span{
margin-left: 5px;
font-size: 14px;
}
}
.item {
@include public;
width: 100%;
padding: 15px 0;
background:rgba(255,255,255,1);
box-shadow:1px 14px 29px 0px rgba(255,69,69,0.19);
border-radius:10px;
text-align: left;
margin-top: 20px;
}
.empty{
width: 25px;
}
.item:first{
margin-top: 0;
}
.item1 {
@include public;
margin-top: 20px;
margin-left: 23px;
}
.item2 {
@include public;
margin-top: 20px;
margin-left:80px
}
.item3 {
@include public;
margin-top: 20px;
margin-left:95px
}
.item2:hover{
color: #cb221c;
}
.edit{
display: inline-block;
width: 17px;
height: 17px;
background: url(../../../assets/svg/edit.svg) 0 0/cover no-repeat;
}
// 使三角形旋转动画
.arrowTransform {
transition: 0.4s;
transform-origin: center;
transform: rotateZ(0deg);
}
.arrowTransformReturn {
transition: 0.4s;
transform-origin: center;
transform: rotateZ(90deg);
}
//复选框样式
.checkBox {
width: 14px;
height: 14px;
border-radius: 7px;
margin-left: 10px;
margin-right: 10px;
border: 2px solid rgba(146, 120, 255, 1);
}
//当点击复选框时候切换背景图片
.isActive {
background: url('../../../assets/img/icon-yigouxuan.png');
background-size: 14px 14px; /*按比例缩放*/
}
.side_icon{
text-align: right;
}
.side_icon i{
cursor:pointer;
font-size: 20px;
}

@ -0,0 +1,24 @@
$main-color: #e80909;
@mixin ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
@mixin mul-ellipsis($num) {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: $num;
text-overflow: ellipsis;
overflow: hidden;
}
.ellipsis{
@include ellipsis();
}
.mul-ellipsis2{
@include mul-ellipsis(2);
}
.mul-ellipsis3{
@include mul-ellipsis(3);
}

@ -14,6 +14,9 @@ module.exports = {
lintOnSave: Setting.lintOnSave,
css: {
loaderOptions: {
sass: {
prependData: `@import "@/styles/var.scss";`
},
postcss: {
plugins: [
postcss

Loading…
Cancel
Save