1
0
mirror of https://github.com/PanJiaChen/electron-vue-admin.git synced 2025-04-06 03:57:57 +08:00

Compare commits

..

No commits in common. "master" and "v3.0.0" have entirely different histories.

7 changed files with 13391 additions and 35 deletions

View File

@ -121,7 +121,7 @@ let rendererConfig = {
plugins: [
new ExtractTextPlugin('styles.css'),
new webpack.DefinePlugin({
'process.env': process.env.NODE_ENV === 'production' ? config.build.env : config.dev.env
'process.env': config.dev.env
}),
new HtmlWebpackPlugin({
filename: 'index.html',

View File

@ -30,7 +30,3 @@ npm run pack
![](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/electron-login.png)
![](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/electron-admin.gif)
## Download
Mac: [app release](https://github.com/PanJiaChen/electron-vue-admin/releases/tag/v3.0.0)

13388
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -55,7 +55,6 @@
"dependencies": {
"axios": "0.17.1",
"element-ui": "2.3.4",
"js-cookie": "^2.2.0",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"vue": "2.5.10",

View File

@ -1,24 +1,16 @@
import Cookies from 'js-cookie'
const app = {
state: {
sidebar: {
opened: !+Cookies.get('sidebarStatus'),
opened: true,
withoutAnimation: false
},
device: 'desktop'
},
mutations: {
TOGGLE_SIDEBAR: state => {
if (state.sidebar.opened) {
Cookies.set('sidebarStatus', 1)
} else {
Cookies.set('sidebarStatus', 0)
}
state.sidebar.opened = !state.sidebar.opened
},
CLOSE_SIDEBAR: (state, withoutAnimation) => {
Cookies.set('sidebarStatus', 1)
state.sidebar.opened = false
state.sidebar.withoutAnimation = withoutAnimation
},

View File

@ -1,9 +1,8 @@
import { login, logout, getInfo } from '@/api/login'
import { getToken, setToken, removeToken } from '@/utils/auth'
const user = {
state: {
token: getToken(),
token: '',
name: '',
avatar: '',
roles: []
@ -31,7 +30,6 @@ const user = {
return new Promise((resolve, reject) => {
login(username, userInfo.password).then(response => {
const data = response.data
setToken(data.token)
commit('SET_TOKEN', data.token)
resolve()
}).catch(error => {
@ -65,7 +63,6 @@ const user = {
logout(state.token).then(() => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
removeToken()
resolve()
}).catch(error => {
reject(error)
@ -76,7 +73,6 @@ const user = {
// 前端 登出
FedLogOut({ commit }) {
return new Promise(resolve => {
removeToken()
commit('SET_TOKEN', '')
resolve()
})

View File

@ -1,15 +0,0 @@
import Cookies from 'js-cookie'
const TokenKey = 'Admin-Token'
export function getToken() {
return Cookies.get(TokenKey)
}
export function setToken(token) {
return Cookies.set(TokenKey, token)
}
export function removeToken() {
return Cookies.remove(TokenKey)
}