张恒

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

module.exports = {
NODE_ENV: '"development"',
BASE_API: '"https://easy-mock.com/mock/5950a2419adc231f356a6636/vue-admin"'
BASE_API: '""'
}
......
此文件的差异太大,无法显示。
......@@ -70,10 +70,10 @@
"vuex-electron": "^1.0.3"
},
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/core": "^7.6.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.0.0",
"@babel/plugin-proposal-do-expressions": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.6.0",
"@babel/plugin-proposal-do-expressions": "^7.6.0",
"@babel/plugin-proposal-export-default-from": "^7.0.0",
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
"@babel/plugin-proposal-function-bind": "^7.0.0",
......@@ -82,16 +82,16 @@
"@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
"@babel/plugin-proposal-optional-chaining": "^7.0.0",
"@babel/plugin-proposal-optional-chaining": "^7.6.0",
"@babel/plugin-proposal-pipeline-operator": "^7.0.0",
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-syntax-import-meta": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.5.5",
"@babel/polyfill": "^7.4.4",
"@babel/preset-env": "^7.5.5",
"@babel/register": "^7.5.5",
"@babel/runtime": "^7.5.5",
"@babel/plugin-transform-runtime": "^7.6.0",
"@babel/polyfill": "^7.6.0",
"@babel/preset-env": "^7.6.0",
"@babel/register": "^7.6.0",
"@babel/runtime": "^7.6.0",
"ajv": "^6.10.2",
"babel-eslint": "^9.0.0",
"babel-loader": "^8.0.6",
......@@ -102,10 +102,10 @@
"cross-env": "^5.2.1",
"css-loader": "^3.1.0",
"del": "^5.0.0",
"electron": "^6.0.7",
"electron": "^6.0.9",
"electron-builder": "^21.2.0",
"electron-devtools-installer": "^2.2.4",
"eslint": "^6.3.0",
"eslint": "^6.4.0",
"eslint-config-standard": "^13.0.1",
"eslint-friendly-formatter": "^4.0.1",
"eslint-loader": "^2.2.1",
......@@ -120,7 +120,7 @@
"multispinner": "^0.2.1",
"node-loader": "^0.6.0",
"node-sass": "^4.12.0",
"sass-loader": "^7.0.3",
"sass-loader": "^8.0.0",
"split2": "^3.1.1",
"style-loader": "^1.0.0",
"svg-sprite-loader": "^4.1.6",
......@@ -130,8 +130,8 @@
"vue-loader": "^15.7.1",
"vue-style-loader": "^4.1.2",
"vue-template-compiler": "^2.6.10",
"webpack": "^4.39.3",
"webpack-cli": "^3.3.7",
"webpack": "^4.40.2",
"webpack-cli": "^3.3.8",
"webpack-dev-server": "^3.7.2",
"webpack-hot-middleware": "^2.25.0",
"webpack-merge": "^4.2.2"
......
<template>
<div class="app-wrapper" :class="classObj">
<navbar></navbar>
<div class="container-set">
<sidebar class="sidebar-container"></sidebar>
<div class="main-container">
<app-main></app-main>
<div class="app-wrapper" :class="IsUseSysTitle?'UseSysTitle':'NoUseSysTitle'">
<div :class="classObj">
<navbar></navbar>
<div class="container-set">
<sidebar class="sidebar-container" :class="IsUseSysTitle?'UseSysTitle':'NoUseSysTitle'"></sidebar>
<div class="main-container">
<app-main></app-main>
</div>
</div>
</div>
</div>
......@@ -22,6 +24,9 @@ export default {
Navbar
},
mixins: [ResizeMixin],
data: () => ({
IsUseSysTitle: require("./../../../config").IsUseSysTitle
}),
computed: {
sidebar() {
return this.$store.state.app.sidebar;
......@@ -46,10 +51,15 @@ export default {
position: relative;
height: 100%;
width: 100%;
top: 38px;
.container-set {
position: relative;
padding-top: 62px;
}
}
.UseSysTitle{
top:0px;
}
.NoUseSysTitle{
top:38px
}
</style>
......
......@@ -28,54 +28,54 @@ const user = {
actions: {
// 登录
Login ({ commit }, userInfo) {
console.log(userInfo)
const username = userInfo.username.trim()
return new Promise((resolve, reject) => {
const data = {
username: username,
password: userInfo.password
}
login(data).then(response => {
const data = response.data.data
setToken(data.token)
commit('SET_TOKEN', data.token)
resolve()
}).catch(error => {
reject(error)
})
// login(data).then(response => {
// const data = response.data
// setToken(data.token)
// commit('SET_TOKEN', data.token)
// resolve()
// }).catch(error => {
// reject(error)
// })
commit('SET_TOKEN', 'admin')
resolve()
})
},
// 获取用户信息
GetInfo ({ commit, state }) {
return new Promise((resolve, reject) => {
getInfo(state.token).then(response => {
const data = response.data.data
if (data.roles && data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', data.roles)
} else {
reject('getInfo: roles must be a non-null array !')
}
commit('SET_NAME', data.name)
commit('SET_AVATAR', data.avatar)
resolve(response)
}).catch(error => {
reject(error)
})
// getInfo(state.token).then(response => {
// const data = response.data
// if (data.roles && data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
// commit('SET_ROLES', data.roles)
// } else {
// reject('getInfo: roles must be a non-null array !')
// }
// commit('SET_NAME', data.name)
// commit('SET_AVATAR', data.avatar)
// resolve(response)
// }).catch(error => {
// reject(error)
// })
commit('SET_ROLES', ['admin'])
commit('SET_NAME', 'Super Admin')
commit('SET_AVATAR', 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif')
resolve()
})
},
// 登出
LogOut ({ commit, state }) {
return new Promise((resolve, reject) => {
logout(state.token).then(() => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
removeToken()
resolve()
}).catch(error => {
reject(error)
})
// logout(state.token).then(() => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
removeToken()
resolve()
// }).catch(error => {
// reject(error)
// })
})
},
......
......@@ -18,7 +18,6 @@
height: 100%;
position: fixed;
font-size: 0px;
top: 38px;
bottom: 0;
left: 0;
z-index: 1001;
......
......@@ -71,7 +71,6 @@ export default {
}
},
handleLogin() {
console.log(11111)
this.$refs.loginForm.validate(valid => {
console.log(valid)
if (valid) {
......@@ -112,7 +111,7 @@ $light_gray:#eee;
color: $light_gray;
height: 47px;
&:-webkit-autofill {
-webkit-box-shadow: 0 0 0px 1000px $bg inset !important;
box-shadow: 0 0 0px 1000px $bg inset !important;
-webkit-text-fill-color: #fff !important;
}
}
......