vue2-client 1.4.63 → 1.4.64

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.
Files changed (99) hide show
  1. package/CHANGELOG.md +487 -484
  2. package/index.js +30 -30
  3. package/package.json +78 -78
  4. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +225 -225
  5. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +151 -151
  6. package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
  7. package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
  8. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +327 -327
  9. package/src/base-client/components/common/XCard/XCard.vue +64 -64
  10. package/src/base-client/components/common/XForm/XForm.vue +274 -274
  11. package/src/base-client/components/common/XFormTable/XFormTable.vue +565 -570
  12. package/src/base-client/components/common/XFormTable/index.md +96 -96
  13. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +109 -109
  14. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  15. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
  16. package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
  17. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  18. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  19. package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
  20. package/src/base-client/plugins/AppData.js +73 -73
  21. package/src/base-client/plugins/GetLoginInfoService.js +179 -179
  22. package/src/base-client/plugins/PagedList.js +177 -177
  23. package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
  24. package/src/base-client/plugins/i18n-extend.js +32 -32
  25. package/src/components/Ellipsis/index.md +38 -38
  26. package/src/components/NumberInfo/index.md +43 -43
  27. package/src/components/STable/README.md +341 -341
  28. package/src/components/STable/index.js +318 -318
  29. package/src/components/Trend/index.md +45 -45
  30. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  31. package/src/components/checkbox/ImgCheckbox.vue +163 -163
  32. package/src/components/exception/ExceptionPage.vue +70 -70
  33. package/src/components/form/FormRow.vue +52 -52
  34. package/src/components/index.js +36 -36
  35. package/src/components/menu/SideMenu.vue +62 -62
  36. package/src/components/menu/menu.js +273 -273
  37. package/src/components/page/header/index.less +40 -40
  38. package/src/components/setting/Setting.vue +235 -235
  39. package/src/components/table/StandardTable.vue +141 -141
  40. package/src/components/table/advance/ActionColumns.vue +158 -158
  41. package/src/components/table/advance/SearchArea.vue +355 -355
  42. package/src/components/tool/AStepItem.vue +60 -60
  43. package/src/components/tool/AvatarList.vue +68 -68
  44. package/src/components/tool/Drawer.vue +142 -142
  45. package/src/components/tool/TagSelect.vue +83 -83
  46. package/src/components/transition/PageToggleTransition.vue +97 -97
  47. package/src/config/default/admin.config.js +18 -18
  48. package/src/config/default/setting.config.js +44 -44
  49. package/src/config/replacer/resolve.config.js +67 -67
  50. package/src/layouts/AdminLayout.vue +174 -174
  51. package/src/layouts/CommonLayout.vue +42 -42
  52. package/src/layouts/ComponentLayoutOne.vue +47 -47
  53. package/src/layouts/PageLayout.vue +151 -151
  54. package/src/layouts/SinglePageView.vue +111 -111
  55. package/src/layouts/footer/PageFooter.vue +49 -49
  56. package/src/layouts/header/AdminHeader.vue +104 -104
  57. package/src/layouts/header/HeaderNotice.vue +167 -167
  58. package/src/layouts/header/HeaderSearch.vue +67 -67
  59. package/src/layouts/header/InstitutionDetail.vue +181 -181
  60. package/src/layouts/header/index.less +92 -92
  61. package/src/layouts/tabs/TabsHead.vue +190 -190
  62. package/src/layouts/tabs/TabsView.vue +379 -379
  63. package/src/mock/goods/index.js +108 -108
  64. package/src/pages/exception/404.vue +25 -25
  65. package/src/pages/login/Login.vue +348 -348
  66. package/src/pages/report/ReportTable.js +124 -124
  67. package/src/pages/report/ReportTableHome.vue +28 -28
  68. package/src/pages/resourceManage/orgListManage.vue +98 -98
  69. package/src/pages/system/dictionary/index.vue +43 -43
  70. package/src/pages/system/file/index.vue +317 -317
  71. package/src/pages/system/monitor/loginInfor/index.vue +36 -36
  72. package/src/pages/system/monitor/operLog/index.vue +36 -36
  73. package/src/pages/system/queryParams/index.vue +43 -43
  74. package/src/router/async/config.async.js +27 -27
  75. package/src/router/async/router.map.js +68 -68
  76. package/src/router/guards.js +104 -104
  77. package/src/router/index.js +27 -27
  78. package/src/services/api/DictionaryDetailsViewApi.js +6 -6
  79. package/src/services/api/LogDetailsViewApi.js +10 -10
  80. package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
  81. package/src/services/api/TicketDetailsViewApi.js +34 -34
  82. package/src/services/api/cas.js +79 -79
  83. package/src/services/api/commonTempTable.js +10 -10
  84. package/src/services/api/index.js +17 -17
  85. package/src/services/api/logininfor/index.js +6 -6
  86. package/src/services/api/manage.js +8 -8
  87. package/src/services/apiService.js +13 -13
  88. package/src/services/user.js +53 -53
  89. package/src/store/modules/index.js +4 -4
  90. package/src/theme/default/nprogress.less +76 -76
  91. package/src/theme/default/style.less +47 -47
  92. package/src/utils/colors.js +107 -107
  93. package/src/utils/excel/Blob.js +180 -180
  94. package/src/utils/excel/Export2Excel.js +141 -141
  95. package/src/utils/formatter.js +68 -68
  96. package/src/utils/i18n.js +80 -80
  97. package/src/utils/theme-color-replacer-extend.js +91 -91
  98. package/src/utils/themeUtil.js +100 -100
  99. package/src/utils/util.js +230 -230
@@ -1,348 +1,348 @@
1
- <template>
2
- <common-layout>
3
- <div class="loginContent">
4
- <div class="illustration"/>
5
- <div class="business">
6
- <div class="top">
7
- <div class="header">
8
- <span class="title">{{ systemName }}</span>
9
- </div>
10
- </div>
11
- <div class="login" id="loginForm">
12
- <a-form :form="form" @submit="onSubmit">
13
- <a-tabs :tabBarStyle="{textAlign: 'center'}" size="large" style="padding: 0 2px;">
14
- <a-tab-pane key="1" tab="账户密码登录">
15
- <a-alert
16
- v-show="error"
17
- :closable="false"
18
- :message="error"
19
- showIcon
20
- style="margin-bottom: 2.8vh;"
21
- type="error" />
22
- <a-form-item>
23
- <a-input
24
- v-decorator="['name', {rules: [{ required: true, message: '请输入账户名', whitespace: true}]}]"
25
- autocomplete="autocomplete"
26
- placeholder="请输入账户名"
27
- size="large"
28
- >
29
- <a-icon slot="prefix" type="user" />
30
- </a-input>
31
- </a-form-item>
32
- <a-form-item>
33
- <a-input
34
- v-decorator="['password', {rules: [{ required: true, message: '请输入密码', whitespace: true}]}]"
35
- autocomplete="autocomplete"
36
- placeholder="请输入密码"
37
- size="large"
38
- type="password"
39
- >
40
- <a-icon slot="prefix" type="lock" />
41
- </a-input>
42
- </a-form-item>
43
- <a-form-item>
44
- <a-button :loading="logging" htmlType="submit" size="large" class="btn" type="primary">登录</a-button>
45
- </a-form-item>
46
- </a-tab-pane>
47
- </a-tabs>
48
- </a-form>
49
- </div>
50
- </div>
51
- </div>
52
- </common-layout>
53
- </template>
54
-
55
- <script>
56
- import CommonLayout from '@vue2-client/layouts/CommonLayout'
57
- import { getRoutesConfig, login, V4Login } 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, mapState } from 'vuex'
61
- import JSEncrypt from 'jsencrypt'
62
- import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
63
- import { positions } from '@vue2-client/mock/common'
64
- import { timeFix } from '@vue2-client/utils/util'
65
- import { loginStart } from '@vue2-client/base-client/plugins/compatible/LoginServiceOA'
66
- import { indexedDB } from '@vue2-client/utils/indexedDB'
67
-
68
- export default {
69
- name: 'Login',
70
- components: { CommonLayout },
71
- data () {
72
- return {
73
- logging: false,
74
- error: '',
75
- form: this.$form.createForm(this)
76
- }
77
- },
78
- computed: {
79
- ...mapState('setting', ['systemName', 'systemDesc', 'homePage', 'ticketPage', 'compatible', 'routeName'])
80
- },
81
- methods: {
82
- ...mapMutations('account', ['setUser', 'setPermissions', 'setRoles']),
83
- onSubmit (e) {
84
- e.preventDefault()
85
- this.form.validateFields((err) => {
86
- if (!err) {
87
- this.logging = true
88
- const name = this.form.getFieldValue('name')
89
- const password = this.form.getFieldValue('password')
90
- switch (this.compatible) {
91
- case 'V3': {
92
- login(name, password).then(this.afterLogin).finally(() => { this.logging = false })
93
- break
94
- }
95
- case 'OA' : {
96
- loginStart(name, password).then(this.afterLoginOA).finally(() => { this.logging = false })
97
- break
98
- }
99
- case 'V4' : {
100
- V4Login(name, password).then(this.afterLoginV4).catch(msg => {
101
- this.error = msg
102
- this.logging = false
103
- })
104
- break
105
- }
106
- }
107
- }
108
- })
109
- },
110
- afterLoginOA (result) {
111
- // 默认第一个是旧OA地址
112
- result.functions[0].navigate = result.functions[0].link
113
- result.functions[0].link = null
114
- this.afterGeneral(result)
115
- this.setAccessToken(result.password)
116
- this.$router.push(this.homePage).catch(() => {})
117
- },
118
- afterLoginV4 (res) {
119
- this.setV4AccessToken(res)
120
- const data = res.resources
121
- this.$login.login(data).then(() => {
122
- this.afterGeneral(data)
123
- if (data.deps === '用户工单登记') {
124
- this.$router.push(this.ticketPage).catch(() => {
125
- })
126
- } else {
127
- this.$router.push(this.homePage).catch(() => {
128
- })
129
- }
130
- })
131
- },
132
- afterLogin (res) {
133
- const name = this.form.getFieldValue('name')
134
- const password = this.form.getFieldValue('password')
135
- this.logging = false
136
- const loginRes = res.states
137
- if (loginRes === '登录成功') {
138
- const encrypt = new JSEncrypt()
139
- encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB')
140
- const data = encrypt.encrypt(JSON.stringify({ username: name, password: password }))
141
- // 获取路由配置
142
- getRoutesConfig(data, this.routeName).then(result => {
143
- this.$login.login(result).then(() => {
144
- // V3任何情况首位加入资源管理
145
- const resourceManageMain = {
146
- name: '资源管理',
147
- icon: 'api',
148
- position: 1,
149
- link: 'resourceManageMain'
150
- }
151
- result.functions.unshift(resourceManageMain)
152
- this.afterGeneral(result)
153
- this.setAccessToken(data)
154
- if (result.deps === '用户工单登记') {
155
- this.$router.push(this.ticketPage).catch(() => {})
156
- } else {
157
- this.$router.push(this.homePage).catch(() => {})
158
- }
159
- })
160
- })
161
- } else {
162
- this.error = loginRes
163
- }
164
- },
165
- afterGeneral (result) {
166
- try {
167
- const user = Object.assign({
168
- username: result.ename,
169
- name: result.name,
170
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png',
171
- address: '西安市',
172
- position: positions[0]
173
- }, result)
174
- this.setUser(user)
175
- this.setPermissions([{ id: 'queryForm', operation: ['add', 'edit'] }])
176
- this.setRoles([{ id: 'admin', operation: ['add', 'edit', 'delete'] }])
177
- loadRoutes(funcToRouter(user.functions))
178
- // 每次重新登录时,清除indexedDB缓存
179
- indexedDB.clear()
180
- this.$message.success(timeFix().CN + `,${result.name} 欢迎回来`, 3)
181
- } catch (msg) {
182
- this.error = msg
183
- } finally {
184
- this.logging = false
185
- }
186
- },
187
- setAccessToken (data) {
188
- if (data) {
189
- localStorage.setItem(ACCESS_TOKEN, data)
190
- let timestamp = new Date().getTime()// 当前的时间戳
191
- timestamp = timestamp + 12 * 60 * 60 * 1000
192
- // 格式化时间获取年月日, 登陆过期时间
193
- const dateAfter = new Date(timestamp)
194
- setAuthorization({ token: data, expireAt: dateAfter })
195
- }
196
- },
197
- setV4AccessToken (res) {
198
- localStorage.setItem(ACCESS_TOKEN, res.access_token)
199
- let timestamp = new Date().getTime()// 当前的时间戳
200
- timestamp = timestamp + res.expire * 60 * 1000
201
- // 格式化时间获取年月日, 登陆过期时间
202
- const dateAfter = new Date(timestamp)
203
- setAuthorization({ token: res.access_token, expireAt: dateAfter })
204
- }
205
- }
206
- }
207
- </script>
208
-
209
- <style lang="less" scoped>
210
- .common-layout {
211
- background-image: url('/img/login/background.webp');
212
- background-size: cover;
213
- background-position: center;
214
- .content {
215
- .loginContent {
216
- position: absolute;
217
- top: 50%;
218
- left: 50%;
219
- width: 63vw;
220
- padding: 12.4vh 4.8vw 13.4vh 3.5vw;
221
- @media screen and (max-width: 479px) {
222
- padding: 6.4vh 4.8vw 4.4vh 3.5vw;
223
- }
224
- transform: translate(-50%, -50%);
225
- background: #fff;
226
- border-radius: 30px;
227
- display: flex;
228
- .illustration {
229
- flex: 1;
230
- background-image: url("/img/login/illustration.webp");
231
- background-size: contain;
232
- background-position: center;
233
- background-repeat: no-repeat;
234
- @media screen and (max-width: 959px) {
235
- flex: 0;
236
- }
237
- }
238
- .business {
239
- flex: 1;
240
- .top {
241
- text-align: center;
242
- .header {
243
- height: 2vh;
244
- line-height: 2.7vh;
245
- padding-bottom: 5.4vh;
246
- .title {
247
- font-size: 1.5rem;
248
- @media screen and (max-width: 479px) {
249
- font-size: 1rem;
250
- }
251
- @media screen and (min-width: 480px) and (max-width: 767px) {
252
- font-size: 1.3rem;
253
- }
254
- @media screen and (min-width: 768px) and (max-width: 959px) {
255
- font-size: 1.5rem;
256
- }
257
- @media screen and (min-width: 960px) {
258
- font-size: 1.3rem;
259
- }
260
- @media screen and (min-width: 1200px) {
261
- font-size: 1.5rem;
262
- }
263
- color: #333333;
264
- font-weight: bold;
265
- font-family: 'Microsoft YaHei UI Light', 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
266
- letter-spacing: 0.13rem;
267
- }
268
- }
269
- }
270
- .login{
271
- width: 20vw;
272
- margin: 0 auto;
273
- @media screen and (max-width: 479px) {
274
- width: 50vw;
275
- }
276
- @media screen and (min-width: 480px) and (max-width: 767px) {
277
- width: 50vw;
278
- }
279
- @media screen and (min-width: 768px) and (max-width: 959px) {
280
- width: 40vw;
281
- }
282
- @media screen and (min-width: 960px) {
283
- width: 20vw;
284
- }
285
- @media screen and (min-width: 1200px) {
286
- width: 20vw;
287
- }
288
- .btn {
289
- width: 100%;
290
- min-height: 43px;
291
- height: 5.4vh;
292
- border-radius: 30px;
293
- background-color: #4F93FE;
294
- }
295
- }
296
- }
297
- }
298
- }
299
- }
300
- </style>
301
- <style lang="less">
302
- .common-layout {
303
- .footer {
304
- .copyright {
305
- color: #fff !important;
306
- }
307
- }
308
- }
309
- #loginForm {
310
- .ant-input {
311
- border-radius: 30px;
312
- }
313
- .ant-input-lg {
314
- min-height: 43px;
315
- height: 5.4vh;
316
- }
317
- .ant-tabs-bar {
318
- margin-bottom: 24px;
319
- }
320
- .ant-input-affix-wrapper {
321
- font-size: 1.15rem;
322
- }
323
- .ant-input-affix-wrapper .ant-input:not(:first-child) {
324
- padding-left: 2.4vw;
325
- @media screen and (max-width: 479px) {
326
- padding-left: 10vw;
327
- }
328
- @media screen and (min-width: 480px) and (max-width: 767px) {
329
- padding-left: 8vw;
330
- }
331
- @media screen and (min-width: 768px) and (max-width: 959px) {
332
- padding-left: 5vw;
333
- }
334
- @media screen and (min-width: 960px) {
335
- padding-left: 4vw;
336
- }
337
- @media screen and (min-width: 1200px) {
338
- padding-left: 2.4vw;
339
- }
340
- }
341
- .ant-input-affix-wrapper .ant-input-prefix, .ant-input-affix-wrapper .ant-input-suffix {
342
- color: #4F93FE;
343
- }
344
- .ant-alert {
345
- border-radius: 12px;
346
- }
347
- }
348
- </style>
1
+ <template>
2
+ <common-layout>
3
+ <div class="loginContent">
4
+ <div class="illustration"/>
5
+ <div class="business">
6
+ <div class="top">
7
+ <div class="header">
8
+ <span class="title">{{ systemName }}</span>
9
+ </div>
10
+ </div>
11
+ <div class="login" id="loginForm">
12
+ <a-form :form="form" @submit="onSubmit">
13
+ <a-tabs :tabBarStyle="{textAlign: 'center'}" size="large" style="padding: 0 2px;">
14
+ <a-tab-pane key="1" tab="账户密码登录">
15
+ <a-alert
16
+ v-show="error"
17
+ :closable="false"
18
+ :message="error"
19
+ showIcon
20
+ style="margin-bottom: 2.8vh;"
21
+ type="error" />
22
+ <a-form-item>
23
+ <a-input
24
+ v-decorator="['name', {rules: [{ required: true, message: '请输入账户名', whitespace: true}]}]"
25
+ autocomplete="autocomplete"
26
+ placeholder="请输入账户名"
27
+ size="large"
28
+ >
29
+ <a-icon slot="prefix" type="user" />
30
+ </a-input>
31
+ </a-form-item>
32
+ <a-form-item>
33
+ <a-input
34
+ v-decorator="['password', {rules: [{ required: true, message: '请输入密码', whitespace: true}]}]"
35
+ autocomplete="autocomplete"
36
+ placeholder="请输入密码"
37
+ size="large"
38
+ type="password"
39
+ >
40
+ <a-icon slot="prefix" type="lock" />
41
+ </a-input>
42
+ </a-form-item>
43
+ <a-form-item>
44
+ <a-button :loading="logging" htmlType="submit" size="large" class="btn" type="primary">登录</a-button>
45
+ </a-form-item>
46
+ </a-tab-pane>
47
+ </a-tabs>
48
+ </a-form>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </common-layout>
53
+ </template>
54
+
55
+ <script>
56
+ import CommonLayout from '@vue2-client/layouts/CommonLayout'
57
+ import { getRoutesConfig, login, V4Login } 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, mapState } from 'vuex'
61
+ import JSEncrypt from 'jsencrypt'
62
+ import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
63
+ import { positions } from '@vue2-client/mock/common'
64
+ import { timeFix } from '@vue2-client/utils/util'
65
+ import { loginStart } from '@vue2-client/base-client/plugins/compatible/LoginServiceOA'
66
+ import { indexedDB } from '@vue2-client/utils/indexedDB'
67
+
68
+ export default {
69
+ name: 'Login',
70
+ components: { CommonLayout },
71
+ data () {
72
+ return {
73
+ logging: false,
74
+ error: '',
75
+ form: this.$form.createForm(this)
76
+ }
77
+ },
78
+ computed: {
79
+ ...mapState('setting', ['systemName', 'systemDesc', 'homePage', 'ticketPage', 'compatible', 'routeName'])
80
+ },
81
+ methods: {
82
+ ...mapMutations('account', ['setUser', 'setPermissions', 'setRoles']),
83
+ onSubmit (e) {
84
+ e.preventDefault()
85
+ this.form.validateFields((err) => {
86
+ if (!err) {
87
+ this.logging = true
88
+ const name = this.form.getFieldValue('name')
89
+ const password = this.form.getFieldValue('password')
90
+ switch (this.compatible) {
91
+ case 'V3': {
92
+ login(name, password).then(this.afterLogin).finally(() => { this.logging = false })
93
+ break
94
+ }
95
+ case 'OA' : {
96
+ loginStart(name, password).then(this.afterLoginOA).finally(() => { this.logging = false })
97
+ break
98
+ }
99
+ case 'V4' : {
100
+ V4Login(name, password).then(this.afterLoginV4).catch(msg => {
101
+ this.error = msg
102
+ this.logging = false
103
+ })
104
+ break
105
+ }
106
+ }
107
+ }
108
+ })
109
+ },
110
+ afterLoginOA (result) {
111
+ // 默认第一个是旧OA地址
112
+ result.functions[0].navigate = result.functions[0].link
113
+ result.functions[0].link = null
114
+ this.afterGeneral(result)
115
+ this.setAccessToken(result.password)
116
+ this.$router.push(this.homePage).catch(() => {})
117
+ },
118
+ afterLoginV4 (res) {
119
+ this.setV4AccessToken(res)
120
+ const data = res.resources
121
+ this.$login.login(data).then(() => {
122
+ this.afterGeneral(data)
123
+ if (data.deps === '用户工单登记') {
124
+ this.$router.push(this.ticketPage).catch(() => {
125
+ })
126
+ } else {
127
+ this.$router.push(this.homePage).catch(() => {
128
+ })
129
+ }
130
+ })
131
+ },
132
+ afterLogin (res) {
133
+ const name = this.form.getFieldValue('name')
134
+ const password = this.form.getFieldValue('password')
135
+ this.logging = false
136
+ const loginRes = res.states
137
+ if (loginRes === '登录成功') {
138
+ const encrypt = new JSEncrypt()
139
+ encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB')
140
+ const data = encrypt.encrypt(JSON.stringify({ username: name, password: password }))
141
+ // 获取路由配置
142
+ getRoutesConfig(data, this.routeName).then(result => {
143
+ this.$login.login(result).then(() => {
144
+ // V3任何情况首位加入资源管理
145
+ const resourceManageMain = {
146
+ name: '资源管理',
147
+ icon: 'api',
148
+ position: 1,
149
+ link: 'resourceManageMain'
150
+ }
151
+ result.functions.unshift(resourceManageMain)
152
+ this.afterGeneral(result)
153
+ this.setAccessToken(data)
154
+ if (result.deps === '用户工单登记') {
155
+ this.$router.push(this.ticketPage).catch(() => {})
156
+ } else {
157
+ this.$router.push(this.homePage).catch(() => {})
158
+ }
159
+ })
160
+ })
161
+ } else {
162
+ this.error = loginRes
163
+ }
164
+ },
165
+ afterGeneral (result) {
166
+ try {
167
+ const user = Object.assign({
168
+ username: result.ename,
169
+ name: result.name,
170
+ avatar: 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png',
171
+ address: '西安市',
172
+ position: positions[0]
173
+ }, result)
174
+ this.setUser(user)
175
+ this.setPermissions([{ id: 'queryForm', operation: ['add', 'edit'] }])
176
+ this.setRoles([{ id: 'admin', operation: ['add', 'edit', 'delete'] }])
177
+ loadRoutes(funcToRouter(user.functions))
178
+ // 每次重新登录时,清除indexedDB缓存
179
+ indexedDB.clear()
180
+ this.$message.success(timeFix().CN + `,${result.name} 欢迎回来`, 3)
181
+ } catch (msg) {
182
+ this.error = msg
183
+ } finally {
184
+ this.logging = false
185
+ }
186
+ },
187
+ setAccessToken (data) {
188
+ if (data) {
189
+ localStorage.setItem(ACCESS_TOKEN, data)
190
+ let timestamp = new Date().getTime()// 当前的时间戳
191
+ timestamp = timestamp + 12 * 60 * 60 * 1000
192
+ // 格式化时间获取年月日, 登陆过期时间
193
+ const dateAfter = new Date(timestamp)
194
+ setAuthorization({ token: data, expireAt: dateAfter })
195
+ }
196
+ },
197
+ setV4AccessToken (res) {
198
+ localStorage.setItem(ACCESS_TOKEN, res.access_token)
199
+ let timestamp = new Date().getTime()// 当前的时间戳
200
+ timestamp = timestamp + res.expire * 60 * 1000
201
+ // 格式化时间获取年月日, 登陆过期时间
202
+ const dateAfter = new Date(timestamp)
203
+ setAuthorization({ token: res.access_token, expireAt: dateAfter })
204
+ }
205
+ }
206
+ }
207
+ </script>
208
+
209
+ <style lang="less" scoped>
210
+ .common-layout {
211
+ background-image: url('/img/login/background.webp');
212
+ background-size: cover;
213
+ background-position: center;
214
+ .content {
215
+ .loginContent {
216
+ position: absolute;
217
+ top: 50%;
218
+ left: 50%;
219
+ width: 63vw;
220
+ padding: 12.4vh 4.8vw 13.4vh 3.5vw;
221
+ @media screen and (max-width: 479px) {
222
+ padding: 6.4vh 4.8vw 4.4vh 3.5vw;
223
+ }
224
+ transform: translate(-50%, -50%);
225
+ background: #fff;
226
+ border-radius: 30px;
227
+ display: flex;
228
+ .illustration {
229
+ flex: 1;
230
+ background-image: url("/img/login/illustration.webp");
231
+ background-size: contain;
232
+ background-position: center;
233
+ background-repeat: no-repeat;
234
+ @media screen and (max-width: 959px) {
235
+ flex: 0;
236
+ }
237
+ }
238
+ .business {
239
+ flex: 1;
240
+ .top {
241
+ text-align: center;
242
+ .header {
243
+ height: 2vh;
244
+ line-height: 2.7vh;
245
+ padding-bottom: 5.4vh;
246
+ .title {
247
+ font-size: 1.5rem;
248
+ @media screen and (max-width: 479px) {
249
+ font-size: 1rem;
250
+ }
251
+ @media screen and (min-width: 480px) and (max-width: 767px) {
252
+ font-size: 1.3rem;
253
+ }
254
+ @media screen and (min-width: 768px) and (max-width: 959px) {
255
+ font-size: 1.5rem;
256
+ }
257
+ @media screen and (min-width: 960px) {
258
+ font-size: 1.3rem;
259
+ }
260
+ @media screen and (min-width: 1200px) {
261
+ font-size: 1.5rem;
262
+ }
263
+ color: #333333;
264
+ font-weight: bold;
265
+ font-family: 'Microsoft YaHei UI Light', 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
266
+ letter-spacing: 0.13rem;
267
+ }
268
+ }
269
+ }
270
+ .login{
271
+ width: 20vw;
272
+ margin: 0 auto;
273
+ @media screen and (max-width: 479px) {
274
+ width: 50vw;
275
+ }
276
+ @media screen and (min-width: 480px) and (max-width: 767px) {
277
+ width: 50vw;
278
+ }
279
+ @media screen and (min-width: 768px) and (max-width: 959px) {
280
+ width: 40vw;
281
+ }
282
+ @media screen and (min-width: 960px) {
283
+ width: 20vw;
284
+ }
285
+ @media screen and (min-width: 1200px) {
286
+ width: 20vw;
287
+ }
288
+ .btn {
289
+ width: 100%;
290
+ min-height: 43px;
291
+ height: 5.4vh;
292
+ border-radius: 30px;
293
+ background-color: #4F93FE;
294
+ }
295
+ }
296
+ }
297
+ }
298
+ }
299
+ }
300
+ </style>
301
+ <style lang="less">
302
+ .common-layout {
303
+ .footer {
304
+ .copyright {
305
+ color: #fff !important;
306
+ }
307
+ }
308
+ }
309
+ #loginForm {
310
+ .ant-input {
311
+ border-radius: 30px;
312
+ }
313
+ .ant-input-lg {
314
+ min-height: 43px;
315
+ height: 5.4vh;
316
+ }
317
+ .ant-tabs-bar {
318
+ margin-bottom: 24px;
319
+ }
320
+ .ant-input-affix-wrapper {
321
+ font-size: 1.15rem;
322
+ }
323
+ .ant-input-affix-wrapper .ant-input:not(:first-child) {
324
+ padding-left: 2.4vw;
325
+ @media screen and (max-width: 479px) {
326
+ padding-left: 10vw;
327
+ }
328
+ @media screen and (min-width: 480px) and (max-width: 767px) {
329
+ padding-left: 8vw;
330
+ }
331
+ @media screen and (min-width: 768px) and (max-width: 959px) {
332
+ padding-left: 5vw;
333
+ }
334
+ @media screen and (min-width: 960px) {
335
+ padding-left: 4vw;
336
+ }
337
+ @media screen and (min-width: 1200px) {
338
+ padding-left: 2.4vw;
339
+ }
340
+ }
341
+ .ant-input-affix-wrapper .ant-input-prefix, .ant-input-affix-wrapper .ant-input-suffix {
342
+ color: #4F93FE;
343
+ }
344
+ .ant-alert {
345
+ border-radius: 12px;
346
+ }
347
+ }
348
+ </style>