vue2-client 1.3.21 → 1.3.23

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