张恒

更新依赖,修正easymock失效导致登录失败,添加当使用自定义头部时,布局也随着发生变化

1 module.exports = { 1 module.exports = {
2 NODE_ENV: '"development"', 2 NODE_ENV: '"development"',
3 - BASE_API: '"https://easy-mock.com/mock/5950a2419adc231f356a6636/vue-admin"' 3 + BASE_API: '""'
4 } 4 }
......
此文件的差异太大,无法显示。
...@@ -70,10 +70,10 @@ ...@@ -70,10 +70,10 @@
70 "vuex-electron": "^1.0.3" 70 "vuex-electron": "^1.0.3"
71 }, 71 },
72 "devDependencies": { 72 "devDependencies": {
73 - "@babel/core": "^7.5.5", 73 + "@babel/core": "^7.6.0",
74 "@babel/plugin-proposal-class-properties": "^7.0.0", 74 "@babel/plugin-proposal-class-properties": "^7.0.0",
75 - "@babel/plugin-proposal-decorators": "^7.0.0", 75 + "@babel/plugin-proposal-decorators": "^7.6.0",
76 - "@babel/plugin-proposal-do-expressions": "^7.0.0", 76 + "@babel/plugin-proposal-do-expressions": "^7.6.0",
77 "@babel/plugin-proposal-export-default-from": "^7.0.0", 77 "@babel/plugin-proposal-export-default-from": "^7.0.0",
78 "@babel/plugin-proposal-export-namespace-from": "^7.0.0", 78 "@babel/plugin-proposal-export-namespace-from": "^7.0.0",
79 "@babel/plugin-proposal-function-bind": "^7.0.0", 79 "@babel/plugin-proposal-function-bind": "^7.0.0",
...@@ -82,16 +82,16 @@ ...@@ -82,16 +82,16 @@
82 "@babel/plugin-proposal-logical-assignment-operators": "^7.0.0", 82 "@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
83 "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", 83 "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
84 "@babel/plugin-proposal-numeric-separator": "^7.0.0", 84 "@babel/plugin-proposal-numeric-separator": "^7.0.0",
85 - "@babel/plugin-proposal-optional-chaining": "^7.0.0", 85 + "@babel/plugin-proposal-optional-chaining": "^7.6.0",
86 "@babel/plugin-proposal-pipeline-operator": "^7.0.0", 86 "@babel/plugin-proposal-pipeline-operator": "^7.0.0",
87 "@babel/plugin-proposal-throw-expressions": "^7.0.0", 87 "@babel/plugin-proposal-throw-expressions": "^7.0.0",
88 "@babel/plugin-syntax-dynamic-import": "^7.0.0", 88 "@babel/plugin-syntax-dynamic-import": "^7.0.0",
89 "@babel/plugin-syntax-import-meta": "^7.0.0", 89 "@babel/plugin-syntax-import-meta": "^7.0.0",
90 - "@babel/plugin-transform-runtime": "^7.5.5", 90 + "@babel/plugin-transform-runtime": "^7.6.0",
91 - "@babel/polyfill": "^7.4.4", 91 + "@babel/polyfill": "^7.6.0",
92 - "@babel/preset-env": "^7.5.5", 92 + "@babel/preset-env": "^7.6.0",
93 - "@babel/register": "^7.5.5", 93 + "@babel/register": "^7.6.0",
94 - "@babel/runtime": "^7.5.5", 94 + "@babel/runtime": "^7.6.0",
95 "ajv": "^6.10.2", 95 "ajv": "^6.10.2",
96 "babel-eslint": "^9.0.0", 96 "babel-eslint": "^9.0.0",
97 "babel-loader": "^8.0.6", 97 "babel-loader": "^8.0.6",
...@@ -102,10 +102,10 @@ ...@@ -102,10 +102,10 @@
102 "cross-env": "^5.2.1", 102 "cross-env": "^5.2.1",
103 "css-loader": "^3.1.0", 103 "css-loader": "^3.1.0",
104 "del": "^5.0.0", 104 "del": "^5.0.0",
105 - "electron": "^6.0.7", 105 + "electron": "^6.0.9",
106 "electron-builder": "^21.2.0", 106 "electron-builder": "^21.2.0",
107 "electron-devtools-installer": "^2.2.4", 107 "electron-devtools-installer": "^2.2.4",
108 - "eslint": "^6.3.0", 108 + "eslint": "^6.4.0",
109 "eslint-config-standard": "^13.0.1", 109 "eslint-config-standard": "^13.0.1",
110 "eslint-friendly-formatter": "^4.0.1", 110 "eslint-friendly-formatter": "^4.0.1",
111 "eslint-loader": "^2.2.1", 111 "eslint-loader": "^2.2.1",
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
120 "multispinner": "^0.2.1", 120 "multispinner": "^0.2.1",
121 "node-loader": "^0.6.0", 121 "node-loader": "^0.6.0",
122 "node-sass": "^4.12.0", 122 "node-sass": "^4.12.0",
123 - "sass-loader": "^7.0.3", 123 + "sass-loader": "^8.0.0",
124 "split2": "^3.1.1", 124 "split2": "^3.1.1",
125 "style-loader": "^1.0.0", 125 "style-loader": "^1.0.0",
126 "svg-sprite-loader": "^4.1.6", 126 "svg-sprite-loader": "^4.1.6",
...@@ -130,8 +130,8 @@ ...@@ -130,8 +130,8 @@
130 "vue-loader": "^15.7.1", 130 "vue-loader": "^15.7.1",
131 "vue-style-loader": "^4.1.2", 131 "vue-style-loader": "^4.1.2",
132 "vue-template-compiler": "^2.6.10", 132 "vue-template-compiler": "^2.6.10",
133 - "webpack": "^4.39.3", 133 + "webpack": "^4.40.2",
134 - "webpack-cli": "^3.3.7", 134 + "webpack-cli": "^3.3.8",
135 "webpack-dev-server": "^3.7.2", 135 "webpack-dev-server": "^3.7.2",
136 "webpack-hot-middleware": "^2.25.0", 136 "webpack-hot-middleware": "^2.25.0",
137 "webpack-merge": "^4.2.2" 137 "webpack-merge": "^4.2.2"
......
1 <template> 1 <template>
2 - <div class="app-wrapper" :class="classObj"> 2 + <div class="app-wrapper" :class="IsUseSysTitle?'UseSysTitle':'NoUseSysTitle'">
3 - <navbar></navbar> 3 + <div :class="classObj">
4 - <div class="container-set"> 4 + <navbar></navbar>
5 - <sidebar class="sidebar-container"></sidebar> 5 + <div class="container-set">
6 - <div class="main-container"> 6 + <sidebar class="sidebar-container" :class="IsUseSysTitle?'UseSysTitle':'NoUseSysTitle'"></sidebar>
7 - <app-main></app-main> 7 + <div class="main-container">
8 + <app-main></app-main>
9 + </div>
8 </div> 10 </div>
9 </div> 11 </div>
10 </div> 12 </div>
...@@ -22,6 +24,9 @@ export default { ...@@ -22,6 +24,9 @@ export default {
22 Navbar 24 Navbar
23 }, 25 },
24 mixins: [ResizeMixin], 26 mixins: [ResizeMixin],
27 + data: () => ({
28 + IsUseSysTitle: require("./../../../config").IsUseSysTitle
29 + }),
25 computed: { 30 computed: {
26 sidebar() { 31 sidebar() {
27 return this.$store.state.app.sidebar; 32 return this.$store.state.app.sidebar;
...@@ -46,10 +51,15 @@ export default { ...@@ -46,10 +51,15 @@ export default {
46 position: relative; 51 position: relative;
47 height: 100%; 52 height: 100%;
48 width: 100%; 53 width: 100%;
49 - top: 38px;
50 .container-set { 54 .container-set {
51 position: relative; 55 position: relative;
52 padding-top: 62px; 56 padding-top: 62px;
53 } 57 }
54 } 58 }
59 +.UseSysTitle{
60 + top:0px;
61 +}
62 +.NoUseSysTitle{
63 + top:38px
64 +}
55 </style> 65 </style>
......
...@@ -28,54 +28,54 @@ const user = { ...@@ -28,54 +28,54 @@ const user = {
28 actions: { 28 actions: {
29 // 登录 29 // 登录
30 Login ({ commit }, userInfo) { 30 Login ({ commit }, userInfo) {
31 - console.log(userInfo)
32 - const username = userInfo.username.trim()
33 return new Promise((resolve, reject) => { 31 return new Promise((resolve, reject) => {
34 - const data = { 32 + // login(data).then(response => {
35 - username: username, 33 + // const data = response.data
36 - password: userInfo.password 34 + // setToken(data.token)
37 - } 35 + // commit('SET_TOKEN', data.token)
38 - login(data).then(response => { 36 + // resolve()
39 - const data = response.data.data 37 + // }).catch(error => {
40 - setToken(data.token) 38 + // reject(error)
41 - commit('SET_TOKEN', data.token) 39 + // })
42 - resolve() 40 + commit('SET_TOKEN', 'admin')
43 - }).catch(error => { 41 + resolve()
44 - reject(error)
45 - })
46 }) 42 })
47 }, 43 },
48 44
49 // 获取用户信息 45 // 获取用户信息
50 GetInfo ({ commit, state }) { 46 GetInfo ({ commit, state }) {
51 return new Promise((resolve, reject) => { 47 return new Promise((resolve, reject) => {
52 - getInfo(state.token).then(response => { 48 + // getInfo(state.token).then(response => {
53 - const data = response.data.data 49 + // const data = response.data
54 - if (data.roles && data.roles.length > 0) { // 验证返回的roles是否是一个非空数组 50 + // if (data.roles && data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
55 - commit('SET_ROLES', data.roles) 51 + // commit('SET_ROLES', data.roles)
56 - } else { 52 + // } else {
57 - reject('getInfo: roles must be a non-null array !') 53 + // reject('getInfo: roles must be a non-null array !')
58 - } 54 + // }
59 - commit('SET_NAME', data.name) 55 + // commit('SET_NAME', data.name)
60 - commit('SET_AVATAR', data.avatar) 56 + // commit('SET_AVATAR', data.avatar)
61 - resolve(response) 57 + // resolve(response)
62 - }).catch(error => { 58 + // }).catch(error => {
63 - reject(error) 59 + // reject(error)
64 - }) 60 + // })
61 + commit('SET_ROLES', ['admin'])
62 + commit('SET_NAME', 'Super Admin')
63 + commit('SET_AVATAR', 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif')
64 + resolve()
65 }) 65 })
66 }, 66 },
67 67
68 // 登出 68 // 登出
69 LogOut ({ commit, state }) { 69 LogOut ({ commit, state }) {
70 return new Promise((resolve, reject) => { 70 return new Promise((resolve, reject) => {
71 - logout(state.token).then(() => { 71 + // logout(state.token).then(() => {
72 - commit('SET_TOKEN', '') 72 + commit('SET_TOKEN', '')
73 - commit('SET_ROLES', []) 73 + commit('SET_ROLES', [])
74 - removeToken() 74 + removeToken()
75 - resolve() 75 + resolve()
76 - }).catch(error => { 76 + // }).catch(error => {
77 - reject(error) 77 + // reject(error)
78 - }) 78 + // })
79 }) 79 })
80 }, 80 },
81 81
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
18 height: 100%; 18 height: 100%;
19 position: fixed; 19 position: fixed;
20 font-size: 0px; 20 font-size: 0px;
21 - top: 38px;
22 bottom: 0; 21 bottom: 0;
23 left: 0; 22 left: 0;
24 z-index: 1001; 23 z-index: 1001;
......
...@@ -71,7 +71,6 @@ export default { ...@@ -71,7 +71,6 @@ export default {
71 } 71 }
72 }, 72 },
73 handleLogin() { 73 handleLogin() {
74 - console.log(11111)
75 this.$refs.loginForm.validate(valid => { 74 this.$refs.loginForm.validate(valid => {
76 console.log(valid) 75 console.log(valid)
77 if (valid) { 76 if (valid) {
...@@ -112,7 +111,7 @@ $light_gray:#eee; ...@@ -112,7 +111,7 @@ $light_gray:#eee;
112 color: $light_gray; 111 color: $light_gray;
113 height: 47px; 112 height: 47px;
114 &:-webkit-autofill { 113 &:-webkit-autofill {
115 - -webkit-box-shadow: 0 0 0px 1000px $bg inset !important; 114 + box-shadow: 0 0 0px 1000px $bg inset !important;
116 -webkit-text-fill-color: #fff !important; 115 -webkit-text-fill-color: #fff !important;
117 } 116 }
118 } 117 }
......