coding
This commit is contained in:
parent
9fbfd5fa74
commit
33faa4621b
2
public/index.html
vendored
2
public/index.html
vendored
|
|
@ -5,7 +5,7 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>App.ico">
|
||||
<title>某仿真分析方法工具</title>
|
||||
<title>基于大数据的智能化后装保障链仿真分析方法工具</title>
|
||||
<style>.first-loading-wrp{display:flex;justify-content:center;align-items:center;flex-direction:column;min-height:420px;height:100%}.first-loading-wrp>h1{font-size:128px}.first-loading-wrp .loading-wrp{padding:98px;display:flex;justify-content:center;align-items:center}.dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:32px;width:32px;height:32px;box-sizing:border-box}.dot i{width:14px;height:14px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.dot i:nth-child(1){top:0;left:0}.dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style>
|
||||
<script src="/jquery.min.js"></script>
|
||||
<!-- <script src="https://files.worldwind.arc.nasa.gov/artifactory/web/0.9.0/worldwind.min.js"></script> -->
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ export default {
|
|||
menu: {
|
||||
locale: true
|
||||
},
|
||||
title: '某仿真分析方法工具',
|
||||
title: '基于大数据的智能化后装保障链仿真分析方法工具',
|
||||
pwa: false,
|
||||
iconfontUrl: '',
|
||||
production: process.env.NODE_ENV === 'production' && process.env.VUE_APP_PREVIEW !== 'true'
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export const constantRouterMap = [
|
|||
path: '/',
|
||||
name: 'index',
|
||||
component: RouteView,
|
||||
meta: { title: '某仿真分析方法工具' },
|
||||
meta: { title: '基于大数据的智能化后装保障链仿真分析方法工具' },
|
||||
redirect: '/user/welcome',
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ const user = {
|
|||
welcome: '',
|
||||
avatar: '',
|
||||
roles: [],
|
||||
info: {}
|
||||
info: {},
|
||||
},
|
||||
|
||||
mutations: {
|
||||
|
|
@ -29,75 +29,82 @@ const user = {
|
|||
},
|
||||
SET_INFO: (state, info) => {
|
||||
state.info = info
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
actions: {
|
||||
// 登录
|
||||
Login ({ commit }, userInfo) {
|
||||
Login({ commit }, userInfo) {
|
||||
return new Promise((resolve, reject) => {
|
||||
login(userInfo).then(response => {
|
||||
console.log(response)
|
||||
const result = response.data
|
||||
storage.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000)
|
||||
commit('SET_TOKEN', result.token)
|
||||
resolve()
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
login(userInfo)
|
||||
.then((response) => {
|
||||
console.log(response)
|
||||
const result = response.data
|
||||
storage.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000)
|
||||
commit('SET_TOKEN', result.token)
|
||||
resolve()
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 获取用户信息
|
||||
GetInfo ({ commit }) {
|
||||
GetInfo({ commit }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
getInfo().then(response => {
|
||||
const result = response.data
|
||||
if (result && result.id) {
|
||||
localStorage.setItem('userId',result.id)
|
||||
localStorage.setItem('uRealName', result.nickName)
|
||||
}
|
||||
if (result.roles && result.permissions.length > 0) {
|
||||
const role = result.roles
|
||||
role.permissions = result.permissions.filter(item => item)
|
||||
role.permissions.map(per => {
|
||||
if (per.actionEntitySet != null && per.actionEntitySet.length > 0) {
|
||||
const action = per.actionEntitySet.map(action => { return action.action })
|
||||
per.actionList = action
|
||||
}
|
||||
})
|
||||
// role.permissionList = role.permissions.map(permission => { return permission })
|
||||
commit('SET_ROLES', result.roles)
|
||||
commit('SET_INFO', result)
|
||||
} else {
|
||||
reject(new Error('getInfo: roles must be a non-null array !'))
|
||||
}
|
||||
commit('SET_NAME', { name: result.name, welcome: welcome() })
|
||||
commit('SET_AVATAR', result.avatar)
|
||||
resolve(response)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
getInfo()
|
||||
.then((response) => {
|
||||
const result = response.data
|
||||
if (result && result.id) {
|
||||
localStorage.setItem('userId', result.id)
|
||||
localStorage.setItem('uRealName', result.nickName)
|
||||
}
|
||||
if (result.roles && result.permissions.length > 0) {
|
||||
const role = result.roles
|
||||
role.permissions = result.permissions.filter((item) => item)
|
||||
role.permissions.map((per) => {
|
||||
if (per.actionEntitySet != null && per.actionEntitySet.length > 0) {
|
||||
const action = per.actionEntitySet.map((action) => {
|
||||
return action.action
|
||||
})
|
||||
per.actionList = action
|
||||
}
|
||||
})
|
||||
// role.permissionList = role.permissions.map(permission => { return permission })
|
||||
commit('SET_ROLES', result.roles.length === 0 ? ['bfa9086508284827b6a967d126dabeb'] : result.roles)
|
||||
commit('SET_INFO', result)
|
||||
} else {
|
||||
reject(new Error('getInfo: roles must be a non-null array !'))
|
||||
}
|
||||
commit('SET_NAME', { name: result.name, welcome: welcome() })
|
||||
commit('SET_AVATAR', result.avatar)
|
||||
resolve(response)
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 登出
|
||||
Logout ({ commit, state }) {
|
||||
Logout({ commit, state }) {
|
||||
return new Promise((resolve) => {
|
||||
logout(state.token).then(() => {
|
||||
commit('SET_TOKEN', '')
|
||||
commit('SET_ROLES', [])
|
||||
storage.remove(ACCESS_TOKEN)
|
||||
resolve()
|
||||
}).catch((err) => {
|
||||
console.log('logout fail:', err)
|
||||
// resolve()
|
||||
}).finally(() => {
|
||||
})
|
||||
logout(state.token)
|
||||
.then(() => {
|
||||
commit('SET_TOKEN', '')
|
||||
commit('SET_ROLES', [])
|
||||
storage.remove(ACCESS_TOKEN)
|
||||
resolve()
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('logout fail:', err)
|
||||
// resolve()
|
||||
})
|
||||
.finally(() => {})
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default user
|
||||
export default user
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ export default {
|
|||
if (item.children && item.children.length > 0) {
|
||||
this.getTree(newChildren, item.children, showKeys)
|
||||
}
|
||||
if (newChildren.length > 0 || showKeys.includes(item.key)) {
|
||||
if (newChildren.length > 0 || showKeys.includes(+item.key)) {
|
||||
target.push({ ...item, children: newChildren })
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<Flex class="user-login-page" fd="co" ai="c" jc="c" style="height: 100%">
|
||||
<div class="user-login-title">某仿真分析方法工具</div>
|
||||
<div class="user-login-title">基于大数据的智能化后装保障链仿真分析方法工具</div>
|
||||
<Grid style="width: 917px; height: 445px" :columns="['524px', '329px', '0px']" gap="32px">
|
||||
<div class="oh" style="grid-area: 1 / 1 / 2 / 4">
|
||||
<img class="user-login-bg" :src="bgLogin" alt="" />
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@
|
|||
<script>
|
||||
import { getAction } from '@/api/manage'
|
||||
import { mapState } from 'vuex'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import storage from 'store'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user