vue2-client 1.2.36 → 1.2.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +82 -82
- package/CHANGELOG.md +1 -1
- package/package.json +1 -1
- package/src/base-client/all.js +59 -59
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +1342 -1342
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +752 -752
- package/src/base-client/components/common/Upload/Upload.vue +124 -124
- package/src/base-client/components/common/Upload/index.js +3 -3
- package/src/base-client/components/common/XAddForm/XAddForm.vue +338 -338
- package/src/base-client/components/common/XForm/XFormItem.vue +280 -280
- package/src/base-client/components/common/XFormTable/XFormTable.vue +484 -484
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +131 -131
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
- package/src/config/default/setting.config.js +34 -34
- package/src/pages/login/Login.vue +198 -198
- package/src/pages/system/ticket/index.vue +440 -440
- package/src/router/async/config.async.js +26 -26
- package/src/router/async/router.map.js +59 -59
- package/src/router/index.js +27 -27
- package/src/services/api/restTools.js +24 -24
- package/src/utils/request.js +198 -198
- package/vue.config.js +2 -2
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
// 此配置为系统默认设置,需修改的设置项,在src/config/config.js中添加修改项即可。也可直接在此文件中修改。
|
|
2
|
-
module.exports = {
|
|
3
|
-
lang: 'CN', // 语言,可选 CN(简体)、HK(繁体)、US(英语),也可扩展其它语言
|
|
4
|
-
theme: { // 主题
|
|
5
|
-
color: '#1890ff', // 主题色
|
|
6
|
-
mode: 'dark', // 主题模式 可选 dark、 light 和 night
|
|
7
|
-
success: '#52c41a', // 成功色
|
|
8
|
-
warning: '#faad14', // 警告色
|
|
9
|
-
error: '#f5222f' // 错误色
|
|
10
|
-
},
|
|
11
|
-
layout: 'side', // 导航布局,可选 side 和 head,分别为侧边导航和顶部导航
|
|
12
|
-
fixedHeader: false, // 固定头部状态栏,true:固定,false:不固定
|
|
13
|
-
fixedSideBar: true, // 固定侧边栏,true:固定,false:不固定
|
|
14
|
-
fixedTabs: false, // 固定页签头,true:固定,false:不固定
|
|
15
|
-
pageWidth: 'fixed', // 内容区域宽度,fixed:固定宽度,fluid:流式宽度
|
|
16
|
-
weekMode: false, // 色弱模式,true:开启,false:不开启
|
|
17
|
-
multiPage: true, // 多页签模式,true:开启,false:不开启
|
|
18
|
-
cachePage: true, // 是否缓存页面数据,仅多页签模式下生效,true 缓存, false 不缓存
|
|
19
|
-
hideSetting: false, // 隐藏设置抽屉,true:隐藏,false:不隐藏
|
|
20
|
-
homePage: '/system/dictionaryManage', // 首页路由, 登陆后默认打开
|
|
21
|
-
ticketPage: '/submitTicket', // 提交工单路由
|
|
22
|
-
systemName: '物联网监控平台', // 系统名称
|
|
23
|
-
copyright: '2021 Mr.Jiang', // copyright
|
|
24
|
-
asyncRoutes: true, // 异步加载路由,true:开启,false:不开启
|
|
25
|
-
showPageTitle: true, // 是否显示页面标题(PageLayout 布局中的页面标题),true:显示,false:不显示
|
|
26
|
-
filterMenu: true, // 根据权限过滤菜单,true:过滤,false:不过滤
|
|
27
|
-
animate: { // 动画设置
|
|
28
|
-
disabled: true, // 禁用动画,true:禁用,false:启用
|
|
29
|
-
name: 'lightSpeed', // 动画效果,支持的动画效果可参考 ./animate.config.js
|
|
30
|
-
direction: 'left' // 动画方向,切换页面时动画的方向,参考 ./animate.config.js
|
|
31
|
-
},
|
|
32
|
-
footerLinks: [ // 页面底部链接,{link: '链接地址', name: '名称/显示文字', icon: '图标,支持 ant design vue 图标库'}
|
|
33
|
-
]
|
|
34
|
-
}
|
|
1
|
+
// 此配置为系统默认设置,需修改的设置项,在src/config/config.js中添加修改项即可。也可直接在此文件中修改。
|
|
2
|
+
module.exports = {
|
|
3
|
+
lang: 'CN', // 语言,可选 CN(简体)、HK(繁体)、US(英语),也可扩展其它语言
|
|
4
|
+
theme: { // 主题
|
|
5
|
+
color: '#1890ff', // 主题色
|
|
6
|
+
mode: 'dark', // 主题模式 可选 dark、 light 和 night
|
|
7
|
+
success: '#52c41a', // 成功色
|
|
8
|
+
warning: '#faad14', // 警告色
|
|
9
|
+
error: '#f5222f' // 错误色
|
|
10
|
+
},
|
|
11
|
+
layout: 'side', // 导航布局,可选 side 和 head,分别为侧边导航和顶部导航
|
|
12
|
+
fixedHeader: false, // 固定头部状态栏,true:固定,false:不固定
|
|
13
|
+
fixedSideBar: true, // 固定侧边栏,true:固定,false:不固定
|
|
14
|
+
fixedTabs: false, // 固定页签头,true:固定,false:不固定
|
|
15
|
+
pageWidth: 'fixed', // 内容区域宽度,fixed:固定宽度,fluid:流式宽度
|
|
16
|
+
weekMode: false, // 色弱模式,true:开启,false:不开启
|
|
17
|
+
multiPage: true, // 多页签模式,true:开启,false:不开启
|
|
18
|
+
cachePage: true, // 是否缓存页面数据,仅多页签模式下生效,true 缓存, false 不缓存
|
|
19
|
+
hideSetting: false, // 隐藏设置抽屉,true:隐藏,false:不隐藏
|
|
20
|
+
homePage: '/system/dictionaryManage', // 首页路由, 登陆后默认打开
|
|
21
|
+
ticketPage: '/submitTicket', // 提交工单路由
|
|
22
|
+
systemName: '物联网监控平台', // 系统名称
|
|
23
|
+
copyright: '2021 Mr.Jiang', // copyright
|
|
24
|
+
asyncRoutes: true, // 异步加载路由,true:开启,false:不开启
|
|
25
|
+
showPageTitle: true, // 是否显示页面标题(PageLayout 布局中的页面标题),true:显示,false:不显示
|
|
26
|
+
filterMenu: true, // 根据权限过滤菜单,true:过滤,false:不过滤
|
|
27
|
+
animate: { // 动画设置
|
|
28
|
+
disabled: true, // 禁用动画,true:禁用,false:启用
|
|
29
|
+
name: 'lightSpeed', // 动画效果,支持的动画效果可参考 ./animate.config.js
|
|
30
|
+
direction: 'left' // 动画方向,切换页面时动画的方向,参考 ./animate.config.js
|
|
31
|
+
},
|
|
32
|
+
footerLinks: [ // 页面底部链接,{link: '链接地址', name: '名称/显示文字', icon: '图标,支持 ant design vue 图标库'}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
@@ -1,198 +1,198 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<common-layout>
|
|
3
|
-
<div class="top">
|
|
4
|
-
<div class="header">
|
|
5
|
-
<img alt="logo" class="logo" src="@/assets/img/logo.png" />
|
|
6
|
-
<span class="title">{{ systemName }}</span>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="desc">为物联网设备的兼容、监控和统计提供支持</div>
|
|
9
|
-
</div>
|
|
10
|
-
<div class="login">
|
|
11
|
-
<a-form @submit="onSubmit" :form="form">
|
|
12
|
-
<a-tabs size="large" :tabBarStyle="{textAlign: 'center'}" style="padding: 0 2px;">
|
|
13
|
-
<a-tab-pane tab="账户密码登录" key="1">
|
|
14
|
-
<a-alert
|
|
15
|
-
type="error"
|
|
16
|
-
:closable="true"
|
|
17
|
-
v-show="error"
|
|
18
|
-
:message="error"
|
|
19
|
-
showIcon
|
|
20
|
-
style="margin-bottom: 24px;" />
|
|
21
|
-
<a-form-item>
|
|
22
|
-
<a-input
|
|
23
|
-
autocomplete="autocomplete"
|
|
24
|
-
size="large"
|
|
25
|
-
placeholder="admin"
|
|
26
|
-
v-decorator="['name', {rules: [{ required: true, message: '请输入账户名', whitespace: true}]}]"
|
|
27
|
-
>
|
|
28
|
-
<a-icon slot="prefix" type="user" />
|
|
29
|
-
</a-input>
|
|
30
|
-
</a-form-item>
|
|
31
|
-
<a-form-item>
|
|
32
|
-
<a-input
|
|
33
|
-
size="large"
|
|
34
|
-
placeholder="888888"
|
|
35
|
-
autocomplete="autocomplete"
|
|
36
|
-
type="password"
|
|
37
|
-
v-decorator="['password', {rules: [{ required: true, message: '请输入密码', whitespace: true}]}]"
|
|
38
|
-
>
|
|
39
|
-
<a-icon slot="prefix" type="lock" />
|
|
40
|
-
</a-input>
|
|
41
|
-
</a-form-item>
|
|
42
|
-
</a-tab-pane>
|
|
43
|
-
</a-tabs>
|
|
44
|
-
<div>
|
|
45
|
-
<a-checkbox :checked="true" >自动登录</a-checkbox>
|
|
46
|
-
</div>
|
|
47
|
-
<a-form-item>
|
|
48
|
-
<a-button :loading="logging" style="width: 100%;margin-top: 24px" size="large" htmlType="submit" type="primary">登录</a-button>
|
|
49
|
-
</a-form-item>
|
|
50
|
-
</a-form>
|
|
51
|
-
</div>
|
|
52
|
-
</common-layout>
|
|
53
|
-
</template>
|
|
54
|
-
|
|
55
|
-
<script>
|
|
56
|
-
import CommonLayout from '@vue2-client/layouts/CommonLayout'
|
|
57
|
-
import { getRoutesConfig, login } from '@vue2-client/services/user'
|
|
58
|
-
import { setAuthorization } from '@vue2-client/utils/request'
|
|
59
|
-
import { loadRoutes, funcToRouter } from '@vue2-client/utils/routerUtil'
|
|
60
|
-
import { mapMutations } from 'vuex'
|
|
61
|
-
import JSEncrypt from 'jsencrypt'
|
|
62
|
-
import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
|
|
63
|
-
import Vue from 'vue'
|
|
64
|
-
import { positions } from '@vue2-client/mock/common'
|
|
65
|
-
import { timeFix } from '@vue2-client/utils/util'
|
|
66
|
-
const { homePage, ticketPage } = require('@vue2-client/config')
|
|
67
|
-
// import { router } from '@vue2-client/mock/user/routes'
|
|
68
|
-
|
|
69
|
-
export default {
|
|
70
|
-
name: 'Login',
|
|
71
|
-
components: { CommonLayout },
|
|
72
|
-
data () {
|
|
73
|
-
return {
|
|
74
|
-
logging: false,
|
|
75
|
-
error: '',
|
|
76
|
-
form: this.$form.createForm(this)
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
computed: {
|
|
80
|
-
systemName () {
|
|
81
|
-
return this.$store.state.setting.systemName
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
methods: {
|
|
85
|
-
...mapMutations('account', ['setUser', 'setPermissions', 'setRoles']),
|
|
86
|
-
onSubmit (e) {
|
|
87
|
-
e.preventDefault()
|
|
88
|
-
this.form.validateFields((err) => {
|
|
89
|
-
if (!err) {
|
|
90
|
-
this.logging = true
|
|
91
|
-
const name = this.form.getFieldValue('name')
|
|
92
|
-
const password = this.form.getFieldValue('password')
|
|
93
|
-
login(name, password).then(this.afterLogin)
|
|
94
|
-
}
|
|
95
|
-
})
|
|
96
|
-
},
|
|
97
|
-
afterLogin (res) {
|
|
98
|
-
const name = this.form.getFieldValue('name')
|
|
99
|
-
const password = this.form.getFieldValue('password')
|
|
100
|
-
this.logging = false
|
|
101
|
-
const loginRes = res.states
|
|
102
|
-
if (loginRes === '登录成功') {
|
|
103
|
-
const encrypt = new JSEncrypt()
|
|
104
|
-
encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB')
|
|
105
|
-
const data = encrypt.encrypt(JSON.stringify({ username: name, password: password }))
|
|
106
|
-
localStorage.setItem(ACCESS_TOKEN, data)
|
|
107
|
-
// 获取路由配置
|
|
108
|
-
getRoutesConfig(data).then(result => {
|
|
109
|
-
Vue.$login.login(result).then(() => {
|
|
110
|
-
const user = Object.assign({
|
|
111
|
-
username: result.ename,
|
|
112
|
-
name: result.name,
|
|
113
|
-
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png',
|
|
114
|
-
address: '西安市',
|
|
115
|
-
position: positions[0]
|
|
116
|
-
}, result)
|
|
117
|
-
this.setUser(user)
|
|
118
|
-
this.setPermissions([{ id: 'queryForm', operation: ['add', 'edit'] }])
|
|
119
|
-
this.setRoles([{ id: 'admin', operation: ['add', 'edit', 'delete'] }])
|
|
120
|
-
let timestamp = new Date().getTime()// 当前的时间戳
|
|
121
|
-
timestamp = timestamp + 60 * 60 * 1000
|
|
122
|
-
// 格式化时间获取年月日, 登陆过期时间
|
|
123
|
-
const dateAfter = new Date(timestamp)
|
|
124
|
-
setAuthorization({ token: data, expireAt: dateAfter })
|
|
125
|
-
loadRoutes(funcToRouter(user.functions))
|
|
126
|
-
if (result.deps === '用户工单登记') {
|
|
127
|
-
this.$router.push(ticketPage).catch(() => {})
|
|
128
|
-
} else {
|
|
129
|
-
this.$router.push(homePage).catch(() => {})
|
|
130
|
-
}
|
|
131
|
-
this.$message.success(timeFix().CN + ',欢迎回来', 3)
|
|
132
|
-
})
|
|
133
|
-
})
|
|
134
|
-
} else {
|
|
135
|
-
this.error = loginRes
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
</script>
|
|
141
|
-
|
|
142
|
-
<style lang="less" scoped>
|
|
143
|
-
.common-layout{
|
|
144
|
-
.top {
|
|
145
|
-
text-align: center;
|
|
146
|
-
.header {
|
|
147
|
-
height: 44px;
|
|
148
|
-
line-height: 44px;
|
|
149
|
-
a {
|
|
150
|
-
text-decoration: none;
|
|
151
|
-
}
|
|
152
|
-
.logo {
|
|
153
|
-
height: 44px;
|
|
154
|
-
vertical-align: top;
|
|
155
|
-
margin-right: 16px;
|
|
156
|
-
}
|
|
157
|
-
.title {
|
|
158
|
-
font-size: 33px;
|
|
159
|
-
color: @title-color;
|
|
160
|
-
font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
161
|
-
font-weight: 600;
|
|
162
|
-
position: relative;
|
|
163
|
-
top: 2px;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
.desc {
|
|
167
|
-
font-size: 14px;
|
|
168
|
-
color: @text-color-second;
|
|
169
|
-
margin-top: 12px;
|
|
170
|
-
margin-bottom: 40px;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
.login{
|
|
174
|
-
width: 368px;
|
|
175
|
-
margin: 0 auto;
|
|
176
|
-
@media screen and (max-width: 576px) {
|
|
177
|
-
width: 95%;
|
|
178
|
-
}
|
|
179
|
-
@media screen and (max-width: 320px) {
|
|
180
|
-
.captcha-button{
|
|
181
|
-
font-size: 14px;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
.icon {
|
|
185
|
-
font-size: 24px;
|
|
186
|
-
color: @text-color-second;
|
|
187
|
-
margin-left: 16px;
|
|
188
|
-
vertical-align: middle;
|
|
189
|
-
cursor: pointer;
|
|
190
|
-
transition: color 0.3s;
|
|
191
|
-
|
|
192
|
-
&:hover {
|
|
193
|
-
color: @primary-color;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<common-layout>
|
|
3
|
+
<div class="top">
|
|
4
|
+
<div class="header">
|
|
5
|
+
<img alt="logo" class="logo" src="@/assets/img/logo.png" />
|
|
6
|
+
<span class="title">{{ systemName }}</span>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="desc">为物联网设备的兼容、监控和统计提供支持</div>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="login">
|
|
11
|
+
<a-form @submit="onSubmit" :form="form">
|
|
12
|
+
<a-tabs size="large" :tabBarStyle="{textAlign: 'center'}" style="padding: 0 2px;">
|
|
13
|
+
<a-tab-pane tab="账户密码登录" key="1">
|
|
14
|
+
<a-alert
|
|
15
|
+
type="error"
|
|
16
|
+
:closable="true"
|
|
17
|
+
v-show="error"
|
|
18
|
+
:message="error"
|
|
19
|
+
showIcon
|
|
20
|
+
style="margin-bottom: 24px;" />
|
|
21
|
+
<a-form-item>
|
|
22
|
+
<a-input
|
|
23
|
+
autocomplete="autocomplete"
|
|
24
|
+
size="large"
|
|
25
|
+
placeholder="admin"
|
|
26
|
+
v-decorator="['name', {rules: [{ required: true, message: '请输入账户名', whitespace: true}]}]"
|
|
27
|
+
>
|
|
28
|
+
<a-icon slot="prefix" type="user" />
|
|
29
|
+
</a-input>
|
|
30
|
+
</a-form-item>
|
|
31
|
+
<a-form-item>
|
|
32
|
+
<a-input
|
|
33
|
+
size="large"
|
|
34
|
+
placeholder="888888"
|
|
35
|
+
autocomplete="autocomplete"
|
|
36
|
+
type="password"
|
|
37
|
+
v-decorator="['password', {rules: [{ required: true, message: '请输入密码', whitespace: true}]}]"
|
|
38
|
+
>
|
|
39
|
+
<a-icon slot="prefix" type="lock" />
|
|
40
|
+
</a-input>
|
|
41
|
+
</a-form-item>
|
|
42
|
+
</a-tab-pane>
|
|
43
|
+
</a-tabs>
|
|
44
|
+
<div>
|
|
45
|
+
<a-checkbox :checked="true" >自动登录</a-checkbox>
|
|
46
|
+
</div>
|
|
47
|
+
<a-form-item>
|
|
48
|
+
<a-button :loading="logging" style="width: 100%;margin-top: 24px" size="large" htmlType="submit" type="primary">登录</a-button>
|
|
49
|
+
</a-form-item>
|
|
50
|
+
</a-form>
|
|
51
|
+
</div>
|
|
52
|
+
</common-layout>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script>
|
|
56
|
+
import CommonLayout from '@vue2-client/layouts/CommonLayout'
|
|
57
|
+
import { getRoutesConfig, login } from '@vue2-client/services/user'
|
|
58
|
+
import { setAuthorization } from '@vue2-client/utils/request'
|
|
59
|
+
import { loadRoutes, funcToRouter } from '@vue2-client/utils/routerUtil'
|
|
60
|
+
import { mapMutations } from 'vuex'
|
|
61
|
+
import JSEncrypt from 'jsencrypt'
|
|
62
|
+
import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
|
|
63
|
+
import Vue from 'vue'
|
|
64
|
+
import { positions } from '@vue2-client/mock/common'
|
|
65
|
+
import { timeFix } from '@vue2-client/utils/util'
|
|
66
|
+
const { homePage, ticketPage } = require('@vue2-client/config')
|
|
67
|
+
// import { router } from '@vue2-client/mock/user/routes'
|
|
68
|
+
|
|
69
|
+
export default {
|
|
70
|
+
name: 'Login',
|
|
71
|
+
components: { CommonLayout },
|
|
72
|
+
data () {
|
|
73
|
+
return {
|
|
74
|
+
logging: false,
|
|
75
|
+
error: '',
|
|
76
|
+
form: this.$form.createForm(this)
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
computed: {
|
|
80
|
+
systemName () {
|
|
81
|
+
return this.$store.state.setting.systemName
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
methods: {
|
|
85
|
+
...mapMutations('account', ['setUser', 'setPermissions', 'setRoles']),
|
|
86
|
+
onSubmit (e) {
|
|
87
|
+
e.preventDefault()
|
|
88
|
+
this.form.validateFields((err) => {
|
|
89
|
+
if (!err) {
|
|
90
|
+
this.logging = true
|
|
91
|
+
const name = this.form.getFieldValue('name')
|
|
92
|
+
const password = this.form.getFieldValue('password')
|
|
93
|
+
login(name, password).then(this.afterLogin)
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
},
|
|
97
|
+
afterLogin (res) {
|
|
98
|
+
const name = this.form.getFieldValue('name')
|
|
99
|
+
const password = this.form.getFieldValue('password')
|
|
100
|
+
this.logging = false
|
|
101
|
+
const loginRes = res.states
|
|
102
|
+
if (loginRes === '登录成功') {
|
|
103
|
+
const encrypt = new JSEncrypt()
|
|
104
|
+
encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB')
|
|
105
|
+
const data = encrypt.encrypt(JSON.stringify({ username: name, password: password }))
|
|
106
|
+
localStorage.setItem(ACCESS_TOKEN, data)
|
|
107
|
+
// 获取路由配置
|
|
108
|
+
getRoutesConfig(data).then(result => {
|
|
109
|
+
Vue.$login.login(result).then(() => {
|
|
110
|
+
const user = Object.assign({
|
|
111
|
+
username: result.ename,
|
|
112
|
+
name: result.name,
|
|
113
|
+
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png',
|
|
114
|
+
address: '西安市',
|
|
115
|
+
position: positions[0]
|
|
116
|
+
}, result)
|
|
117
|
+
this.setUser(user)
|
|
118
|
+
this.setPermissions([{ id: 'queryForm', operation: ['add', 'edit'] }])
|
|
119
|
+
this.setRoles([{ id: 'admin', operation: ['add', 'edit', 'delete'] }])
|
|
120
|
+
let timestamp = new Date().getTime()// 当前的时间戳
|
|
121
|
+
timestamp = timestamp + 60 * 60 * 1000
|
|
122
|
+
// 格式化时间获取年月日, 登陆过期时间
|
|
123
|
+
const dateAfter = new Date(timestamp)
|
|
124
|
+
setAuthorization({ token: data, expireAt: dateAfter })
|
|
125
|
+
loadRoutes(funcToRouter(user.functions))
|
|
126
|
+
if (result.deps === '用户工单登记') {
|
|
127
|
+
this.$router.push(ticketPage).catch(() => {})
|
|
128
|
+
} else {
|
|
129
|
+
this.$router.push(homePage).catch(() => {})
|
|
130
|
+
}
|
|
131
|
+
this.$message.success(timeFix().CN + ',欢迎回来', 3)
|
|
132
|
+
})
|
|
133
|
+
})
|
|
134
|
+
} else {
|
|
135
|
+
this.error = loginRes
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
</script>
|
|
141
|
+
|
|
142
|
+
<style lang="less" scoped>
|
|
143
|
+
.common-layout{
|
|
144
|
+
.top {
|
|
145
|
+
text-align: center;
|
|
146
|
+
.header {
|
|
147
|
+
height: 44px;
|
|
148
|
+
line-height: 44px;
|
|
149
|
+
a {
|
|
150
|
+
text-decoration: none;
|
|
151
|
+
}
|
|
152
|
+
.logo {
|
|
153
|
+
height: 44px;
|
|
154
|
+
vertical-align: top;
|
|
155
|
+
margin-right: 16px;
|
|
156
|
+
}
|
|
157
|
+
.title {
|
|
158
|
+
font-size: 33px;
|
|
159
|
+
color: @title-color;
|
|
160
|
+
font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
161
|
+
font-weight: 600;
|
|
162
|
+
position: relative;
|
|
163
|
+
top: 2px;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
.desc {
|
|
167
|
+
font-size: 14px;
|
|
168
|
+
color: @text-color-second;
|
|
169
|
+
margin-top: 12px;
|
|
170
|
+
margin-bottom: 40px;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
.login{
|
|
174
|
+
width: 368px;
|
|
175
|
+
margin: 0 auto;
|
|
176
|
+
@media screen and (max-width: 576px) {
|
|
177
|
+
width: 95%;
|
|
178
|
+
}
|
|
179
|
+
@media screen and (max-width: 320px) {
|
|
180
|
+
.captcha-button{
|
|
181
|
+
font-size: 14px;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
.icon {
|
|
185
|
+
font-size: 24px;
|
|
186
|
+
color: @text-color-second;
|
|
187
|
+
margin-left: 16px;
|
|
188
|
+
vertical-align: middle;
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
transition: color 0.3s;
|
|
191
|
+
|
|
192
|
+
&:hover {
|
|
193
|
+
color: @primary-color;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
</style>
|