Skip to content

Commit

Permalink
加入文件注释
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed Jan 20, 2019
1 parent 617fcf5 commit 132cdf3
Show file tree
Hide file tree
Showing 20 changed files with 120 additions and 8 deletions.
5 changes: 5 additions & 0 deletions src/icons/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* @Author: BoBo
* @Date: 2018-12-25 18:33:50
* @Description: 全局注册svg-icon组件
*/
import Vue from 'vue'
import SvgIcon from '@/components/SvgIcon/index.vue';

Expand Down
3 changes: 3 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
* @Date: 2018-12-22 16:25:54
* @Last Modified by: BoBo
* @Last Modified time: 2018-12-22 16:25:54
* @Description
* 入口文件,初始化了全局Vue实例
* 全局插件以及组件的注册需写在main.js中
*/

/* eslint-disable no-new */
Expand Down
2 changes: 2 additions & 0 deletions src/permission.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* @Date: 2018-12-23 10:58:07
* @Last Modified by: BoBo
* @Last Modified time: 2018-12-23 10:58:07
* @Description
* 登录鉴权js,获取当前用户token身份信息以及所拥有的路由权限
*/
import router from './router';
import store from './store';
Expand Down
12 changes: 12 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/*
* @Author: BoBo
* @Date: 2018-12-21 14:35:39
* @Description:
* 前端路由,均为路由懒加载
*
* noDropDown 表示只渲染一级菜单,无下拉效果
* hidden 隐藏指定路由,不渲染在菜单列表中
* icon 配置父级菜单图标
* noCache 不开启页面缓存
*
*/
import Vue from 'vue'
import Router from 'vue-router'
import Layout from '../views/layout/Layout'
Expand Down
12 changes: 10 additions & 2 deletions src/store/getters.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
/*
* @Author: BoBo
* @Date: 2018-12-21 14:34:50
* @Description: 全局vuex getter
*
* 调用时,在相应的vue中,imoprt该js
* this.getters.token 即可获取
*/
const getters = {
sidebar: state => state.app.sidebar,
token: state => state.user.token,
// avatar: state => state.user.avatar,
visitedViews: state => state.tagsView.visitedViews,
cachedViews: state => state.tagsView.cachedViews,
realname:state=>state.user.realname,
realname: state => state.user.realname,
name: state => state.user.name,
addRouters: state => state.permission.addRouters,
routers:state=>state.permission.routers
routers: state => state.permission.routers,

}
export default getters
13 changes: 9 additions & 4 deletions src/store/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* @Author: BoBo
* @Date: 2018-12-21 14:34:50
* @Description: 全局vuex
*/
import Vue from 'vue'
import Vuex from 'vuex'
import app from './modules/app'
Expand All @@ -10,13 +15,13 @@ import getters from './getters'
Vue.use(Vuex)

const store = new Vuex.Store({
modules: {
app,
modules: {
app,
user,
permission,
tagsView
tagsView,
},
getters
getters,
})

export default store
5 changes: 5 additions & 0 deletions src/store/modules/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* @Author: BoBo
* @Date: 2018-12-21 14:34:50
* @Description: 侧边栏收缩状态存储
*/
import Cookies from 'js-cookie'

const app = {
Expand Down
5 changes: 5 additions & 0 deletions src/store/modules/permission.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* @Author: BoBo
* @Date: 2018-12-21 14:34:50
* @Description: 鉴权路由处理以及存储
*/
import {
asyncRouterMap,
constantRouterMap,
Expand Down
5 changes: 5 additions & 0 deletions src/store/modules/tagsView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* @Author: BoBo
* @Date: 2018-12-21 14:34:50
* @Description: tab数组存储
*/
const tagsView = {
state: {
visitedViews: [],
Expand Down
6 changes: 6 additions & 0 deletions src/store/modules/user.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* @Author: BoBo
* @Date: 2018-12-21 14:34:50
* @Description: 登录,登出,修改密码,获取用户信息
* 存储的变量有当前用户token,用户名以及昵称
*/
import {
login,
logout,
Expand Down
7 changes: 6 additions & 1 deletion src/styles/element-ui.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
//覆盖一些element-ui样式
/*
* @Author: BoBo
* @Date: 2018-12-21 14:34:50
* @Description: 覆盖一些element-ui样式
*/


.login-container{
.el-input__inner{
Expand Down
5 changes: 5 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* @Author: BoBo
* @Date: 2018-12-21 14:34:50
* @Description: 全局样式
*/
@import './variables.scss';
@import './mixin.scss';
@import './transition.scss';
Expand Down
5 changes: 5 additions & 0 deletions src/styles/layout.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* @Author: BoBo
* @Date: 2018-12-21 14:34:50
* @Description: web整体布局样式
*/
#app {
@import "src/styles/mixin.scss";
.app-wrapper {
Expand Down
7 changes: 6 additions & 1 deletion src/styles/transition.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
//globl transition css
/*
* @Author: BoBo
* @Date: 2018-12-21 14:34:50
* @Description: globl transition css
*/


/*fade*/
.fade-enter-active,
Expand Down
6 changes: 6 additions & 0 deletions src/styles/variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* @Author: BoBo
* @Date: 2018-12-21 14:34:50
* @Description: 预设的全局color
* 使用时@import该css即可
*/
$blue:#324157;
$light-blue:#3A71A8;
$red:#C03639;
Expand Down
5 changes: 5 additions & 0 deletions src/utils/auth.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* @Author: BoBo
* @Date: 2018-12-21 14:33:55
* @Description:全局token
*/
import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'
Expand Down
5 changes: 5 additions & 0 deletions src/utils/download.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* @Author: BoBo
* @Date: 2018-12-21 14:33:55
* @Description: 文件下载函数
*/
import axios from 'axios'
import {
getToken,
Expand Down
7 changes: 7 additions & 0 deletions src/utils/fetch.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
* @Author: BoBo
* @Date: 2018-12-25 18:33:50
* @Description:
* 全局axios配置
* 配有req以及res两个拦截器
*/
import axios from 'axios'
import {
Message,
Expand Down
6 changes: 6 additions & 0 deletions src/utils/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* @Author: BoBo
* @Date: 2018-12-21 14:33:55
* @Description: 工具函数
*/


export function parseTime(time, cFormat) {
if (arguments.length === 0) {
Expand Down
7 changes: 7 additions & 0 deletions src/utils/validate.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
* @Author: BoBo
* @Date: 2018-12-21 14:33:55
* @Description: 正则校验以及大小写转换函数
*/


/* 合法uri */
export function validateURL(textval) {
const urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
Expand Down

0 comments on commit 132cdf3

Please sign in to comment.