Skip to content

Commit 3c05519

Browse files
committed
refine
1 parent 385ec5a commit 3c05519

File tree

17 files changed

+54
-61
lines changed

17 files changed

+54
-61
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"vue-count-to": "1.0.5",
3333
"vue-multiselect": "2.0.2",
3434
"vue-router": "2.7.0",
35+
"vue-splitpane": "^1.0.0",
3536
"vuedraggable": "2.14.1",
3637
"vuex": "2.3.1",
3738
"xlsx": "^0.10.8"

src/api/login.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function logout() {
1919
})
2020
}
2121

22-
export function getInfo(token) {
22+
export function getUserInfo(token) {
2323
return fetch({
2424
url: '/user/info',
2525
method: 'get',

src/mock/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Mock.setup({
1111
// 登录相关
1212
Mock.mock(/\/login\/login/, 'post', loginAPI.loginByUsername)
1313
Mock.mock(/\/login\/logout/, 'post', loginAPI.logout)
14-
Mock.mock(/\/user\/info\.*/, 'get', loginAPI.getInfo)
14+
Mock.mock(/\/user\/info\.*/, 'get', loginAPI.getUserInfo)
1515

1616
// 文章相关
1717
Mock.mock(/\/article\/list/, 'get', articleAPI.getList)

src/mock/login.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default {
2929
const { username } = JSON.parse(config.body)
3030
return userMap[username]
3131
},
32-
getInfo: config => {
32+
getUserInfo: config => {
3333
const { token } = param2Obj(config.url)
3434
if (userMap[token]) {
3535
return userMap[token]

src/permission.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ router.beforeEach((to, from, next) => {
2020
next({ path: '/' })
2121
} else {
2222
if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息
23-
store.dispatch('GetInfo').then(res => { // 拉取user_info
23+
store.dispatch('GetUserInfo').then(res => { // 拉取user_info
2424
const roles = res.data.role
2525
store.dispatch('GenerateRoutes', { roles }).then(() => { // 生成可访问的路由表
2626
router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表

src/store/modules/app.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ const app = {
55
sidebar: {
66
opened: !+Cookies.get('sidebarStatus')
77
},
8-
theme: 'default',
9-
livenewsChannels: Cookies.get('livenewsChannels') || '[]',
108
visitedViews: []
119
},
1210
mutations: {

src/store/modules/user.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { loginByUsername, logout, getInfo } from 'api/login'
1+
import { loginByUsername, logout, getUserInfo } from 'api/login'
22
import { getToken, setToken, removeToken } from 'utils/auth'
33

44
const user = {
@@ -60,9 +60,9 @@ const user = {
6060
},
6161

6262
// 获取用户信息
63-
GetInfo({ commit, state }) {
63+
GetUserInfo({ commit, state }) {
6464
return new Promise((resolve, reject) => {
65-
getInfo(state.token).then(response => {
65+
getUserInfo(state.token).then(response => {
6666
const data = response.data
6767
commit('SET_ROLES', data.role)
6868
commit('SET_NAME', data.name)
@@ -117,7 +117,7 @@ const user = {
117117
return new Promise(resolve => {
118118
commit('SET_TOKEN', role)
119119
setToken(role)
120-
getInfo(role).then(response => {
120+
getUserInfo(role).then(response => {
121121
const data = response.data
122122
commit('SET_ROLES', data.role)
123123
commit('SET_NAME', data.name)

src/styles/btn.scss

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,27 @@ $pink: #E65D6E;
55
$green: #30B08F;
66
$tiffany: #4AB7BD;
77
$yellow:#FEC171;
8-
98
$panGreen: #30B08F;
109

1110
@mixin colorBtn($color) {
1211
background: $color;
1312
&:hover {
1413
color: $color;
15-
&:before, &:after {
14+
&:before,
15+
&:after {
1616
background: $color;
1717
}
1818
}
1919
}
2020

21-
2221
.blue-btn {
2322
@include colorBtn($blue)
2423
}
2524

26-
.light-blue-btn{
25+
.light-blue-btn {
2726
@include colorBtn($light-blue)
2827
}
2928

30-
3129
.red-btn {
3230
@include colorBtn($red)
3331
}
@@ -40,12 +38,10 @@ $panGreen: #30B08F;
4038
@include colorBtn($green)
4139
}
4240

43-
4441
.tiffany-btn {
4542
@include colorBtn($tiffany)
4643
}
4744

48-
4945
.yellow-btn {
5046
@include colorBtn($yellow)
5147
}
@@ -63,12 +59,14 @@ $panGreen: #30B08F;
6359
display: inline-block;
6460
&:hover {
6561
background: #fff;
66-
&:before, &:after {
62+
&:before,
63+
&:after {
6764
width: 100%;
6865
transition: 600ms ease all;
6966
}
7067
}
71-
&:before, &:after {
68+
&:before,
69+
&:after {
7270
content: '';
7371
position: absolute;
7472
top: 0;
@@ -85,19 +83,20 @@ $panGreen: #30B08F;
8583
}
8684
}
8785

88-
.custom-button{
89-
display: inline-block;
90-
line-height: 1;
91-
white-space: nowrap;
92-
cursor: pointer;
93-
background: #fff;
94-
color: #fff;
95-
-webkit-appearance: none;
96-
text-align: center;
97-
box-sizing: border-box;
98-
outline: 0;
99-
margin: 0;
100-
padding: 10px 15px;
101-
font-size: 14px;
102-
border-radius: 4px;
86+
.custom-button {
87+
display: inline-block;
88+
line-height: 1;
89+
white-space: nowrap;
90+
cursor: pointer;
91+
background: #fff;
92+
color: #fff;
93+
-webkit-appearance: none;
94+
text-align: center;
95+
box-sizing: border-box;
96+
outline: 0;
97+
margin: 0;
98+
padding: 10px 15px;
99+
font-size: 14px;
100+
border-radius: 4px;
103101
}
102+

src/styles/index.scss

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
@import './btn.scss';
33
@import './element-ui.scss';
44
@import './sidebar.scss';
5-
65
body {
76
-moz-osx-font-smoothing: grayscale;
87
-webkit-font-smoothing: antialiased;
@@ -98,15 +97,16 @@ code {
9897
opacity: 0;
9998
}
10099

101-
102100
//main-container全局样式
103101
.app-container {
104102
padding: 20px;
105103
}
104+
106105
.components-container {
107106
margin: 30px 50px;
108107
position: relative;
109108
}
109+
110110
.pagination-container {
111111
margin-top: 30px;
112112
}
@@ -115,9 +115,10 @@ code {
115115
height: 100%!important;
116116
}
117117

118-
.text-center{
118+
.text-center {
119119
text-align: center
120120
}
121+
121122
.svg-icon {
122123
width: 1em;
123124
height: 1em;
@@ -216,7 +217,6 @@ code {
216217
}
217218
}
218219

219-
220220
//refine vue-multiselect plugin
221221
.multiselect {
222222
line-height: 16px;
@@ -227,8 +227,9 @@ code {
227227
}
228228

229229
//refine simplemde
230-
.simplemde-container{
231-
.editor-toolbar.fullscreen,.CodeMirror-fullscreen{
230+
.simplemde-container {
231+
.editor-toolbar.fullscreen,
232+
.CodeMirror-fullscreen {
232233
z-index: 1003;
233234
}
234235
}

src/utils/fetch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import axios from 'axios'
22
import { Message } from 'element-ui'
3-
import store from '../store'
4-
import { getToken } from 'utils/auth'
3+
import store from '@/store'
4+
import { getToken } from '@/utils/auth'
55

66
// 创建axios实例
77
const service = axios.create({

0 commit comments

Comments
 (0)