vue2-client 1.6.49 → 1.7.0

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 (119) hide show
  1. package/.env +15 -15
  2. package/CHANGELOG.md +628 -625
  3. package/index.js +30 -30
  4. package/package.json +81 -81
  5. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +316 -316
  6. package/src/base-client/components/common/CitySelect/CitySelect.vue +247 -247
  7. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +667 -667
  8. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +733 -733
  9. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +468 -462
  10. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +508 -508
  11. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +146 -140
  12. package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
  13. package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
  14. package/src/base-client/components/common/Upload/Upload.vue +168 -168
  15. package/src/base-client/components/common/XAddForm/XAddForm.vue +325 -325
  16. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +279 -279
  17. package/src/base-client/components/common/XCard/XCard.vue +64 -64
  18. package/src/base-client/components/common/XForm/XForm.vue +180 -180
  19. package/src/base-client/components/common/XForm/XFormItem.vue +513 -513
  20. package/src/base-client/components/common/XForm/XTreeSelect.vue +184 -184
  21. package/src/base-client/components/common/XFormCol/XFormCol.vue +38 -38
  22. package/src/base-client/components/common/XFormTable/XFormTable.vue +344 -336
  23. package/src/base-client/components/common/XFormTable/index.md +97 -97
  24. package/src/base-client/components/common/XImportExcel/XImportExcel.vue +132 -132
  25. package/src/base-client/components/common/XTable/XTable.vue +506 -506
  26. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +111 -111
  27. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +231 -231
  28. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  29. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
  30. package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
  31. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  32. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  33. package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
  34. package/src/base-client/plugins/AppData.js +76 -76
  35. package/src/base-client/plugins/GetLoginInfoService.js +179 -179
  36. package/src/base-client/plugins/PagedList.js +177 -177
  37. package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
  38. package/src/base-client/plugins/i18n-extend.js +32 -32
  39. package/src/components/Ellipsis/Ellipsis.vue +65 -65
  40. package/src/components/Ellipsis/index.md +38 -38
  41. package/src/components/NumberInfo/index.md +43 -43
  42. package/src/components/STable/README.md +341 -341
  43. package/src/components/STable/index.js +318 -318
  44. package/src/components/Trend/index.md +45 -45
  45. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  46. package/src/components/checkbox/ImgCheckbox.vue +163 -163
  47. package/src/components/exception/ExceptionPage.vue +70 -70
  48. package/src/components/form/FormRow.vue +52 -52
  49. package/src/components/index.js +36 -36
  50. package/src/components/menu/SideMenu.vue +62 -62
  51. package/src/components/menu/menu.js +273 -273
  52. package/src/components/page/header/index.less +40 -40
  53. package/src/components/setting/Setting.vue +235 -235
  54. package/src/components/table/StandardTable.vue +141 -141
  55. package/src/components/table/advance/ActionColumns.vue +158 -158
  56. package/src/components/table/advance/SearchArea.vue +355 -355
  57. package/src/components/tool/AStepItem.vue +60 -60
  58. package/src/components/tool/AvatarList.vue +68 -68
  59. package/src/components/tool/Drawer.vue +142 -142
  60. package/src/components/tool/TagSelect.vue +83 -83
  61. package/src/components/transition/PageToggleTransition.vue +97 -97
  62. package/src/config/CreateQueryConfig.js +307 -307
  63. package/src/config/default/admin.config.js +18 -18
  64. package/src/config/replacer/resolve.config.js +67 -67
  65. package/src/layouts/CommonLayout.vue +42 -42
  66. package/src/layouts/ComponentLayoutOne.vue +47 -47
  67. package/src/layouts/PageLayout.vue +151 -151
  68. package/src/layouts/SinglePageView.vue +116 -116
  69. package/src/layouts/footer/PageFooter.vue +49 -49
  70. package/src/layouts/header/AdminHeader.vue +134 -134
  71. package/src/layouts/header/HeaderAvatar.vue +64 -64
  72. package/src/layouts/header/HeaderNotice.vue +176 -176
  73. package/src/layouts/header/HeaderSearch.vue +67 -67
  74. package/src/layouts/header/InstitutionDetail.vue +181 -181
  75. package/src/layouts/header/index.less +92 -92
  76. package/src/layouts/tabs/TabsHead.vue +190 -190
  77. package/src/layouts/tabs/TabsView.vue +379 -379
  78. package/src/mock/goods/index.js +108 -108
  79. package/src/pages/CreateQueryPage.vue +84 -84
  80. package/src/pages/login/Login.vue +369 -369
  81. package/src/pages/report/ReportTable.js +124 -124
  82. package/src/pages/report/ReportTableHome.vue +28 -28
  83. package/src/pages/resourceManage/orgListManage.vue +98 -98
  84. package/src/pages/system/dictionary/index.vue +43 -43
  85. package/src/pages/system/file/index.vue +317 -317
  86. package/src/pages/system/monitor/loginInfor/index.vue +36 -36
  87. package/src/pages/system/monitor/operLog/index.vue +36 -36
  88. package/src/pages/system/settings/index.vue +126 -126
  89. package/src/pages/system/settings/modifyPassword.vue +109 -109
  90. package/src/router/async/config.async.js +28 -28
  91. package/src/router/async/router.map.js +66 -68
  92. package/src/router/index.js +27 -27
  93. package/src/services/api/DictionaryDetailsViewApi.js +6 -6
  94. package/src/services/api/LogDetailsViewApi.js +10 -10
  95. package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
  96. package/src/services/api/TicketDetailsViewApi.js +34 -34
  97. package/src/services/api/cas.js +79 -79
  98. package/src/services/api/common.js +137 -132
  99. package/src/services/api/commonTempTable.js +10 -10
  100. package/src/services/api/index.js +17 -17
  101. package/src/services/api/logininfor/index.js +6 -6
  102. package/src/services/api/manage.js +8 -8
  103. package/src/services/apiService.js +14 -14
  104. package/src/services/user.js +67 -67
  105. package/src/store/modules/index.js +4 -4
  106. package/src/theme/default/nprogress.less +76 -76
  107. package/src/theme/default/style.less +58 -58
  108. package/src/utils/EncryptUtil.js +53 -53
  109. package/src/utils/colors.js +107 -107
  110. package/src/utils/excel/Blob.js +180 -180
  111. package/src/utils/excel/Export2Excel.js +141 -141
  112. package/src/utils/formatter.js +68 -68
  113. package/src/utils/i18n.js +80 -80
  114. package/src/utils/map-utils.js +37 -37
  115. package/src/utils/theme-color-replacer-extend.js +91 -91
  116. package/src/utils/themeUtil.js +100 -100
  117. package/src/utils/util.js +230 -230
  118. package/vue.config.js +106 -106
  119. package/src/pages/system/queryParams/index.vue +0 -43
@@ -1,132 +1,137 @@
1
- import { indexedDB } from '@vue2-client/utils/indexedDB'
2
- import notification from 'ant-design-vue/lib/notification'
3
- import message from 'ant-design-vue/lib/message'
4
- import { blobValidate } from '@vue2-client/utils/common'
5
- import errorCode from '@vue2-client/utils/errorCode'
6
- import { saveAs } from 'file-saver'
7
- import { post } from '@vue2-client/services/api/restTools'
8
-
9
- const commonApi = {
10
- // 获取表格列配置
11
- getColumnsJson: '/api/af-system/logic/getColumns',
12
- // 通用查询
13
- query: 'logic/commonQuery',
14
- // 表单查询
15
- queryWithResource: 'logic/commonQueryWithResource',
16
- // 通用新增/修改
17
- addOrModify: 'logic/commonAddOrModify',
18
- // 通用删除
19
- delete: 'logic/commonDelete',
20
- // 获取字典键列表
21
- getDictionaryParam: '/api/af-system/logic/getDictionaryParam',
22
- // 获取所有员工及其部门的级联菜单数据
23
- getEmpTree: '/api/af-system/logic/getEmpTree',
24
- // 导入数据
25
- importData: 'logic/importData',
26
- // 导出数据
27
- exportData: 'logic/commonExport',
28
- // 下载数据
29
- download: 'resource/download',
30
- // 通用上传
31
- upload: '/resource/upload'
32
- }
33
-
34
- /**
35
- * 带缓存查询的表格配置文件查询
36
- * @param queryParamsName 配置名称
37
- * @param callback 回调函数
38
- */
39
- export function getColumnsJson (queryParamsName, callback) {
40
- indexedDB.getByWeb(queryParamsName, commonApi.getColumnsJson, { str: queryParamsName }, callback)
41
- }
42
-
43
- /**
44
- * 通用查询
45
- */
46
- export function query (parameter, serviceName = 'af-system') {
47
- return post('/api/' + serviceName + '/' + commonApi.query, parameter, null)
48
- }
49
-
50
- /**
51
- * 通用表单查询
52
- */
53
- export function queryWithResource (parameter, serviceName = 'af-system') {
54
- return post('/api/' + serviceName + '/' + commonApi.queryWithResource, parameter, null)
55
- }
56
-
57
- /**
58
- * 通用新增/修改
59
- */
60
- export function addOrModify (parameter, serviceName = 'af-system') {
61
- return post('/api/' + serviceName + '/' + commonApi.addOrModify, parameter, null)
62
- }
63
-
64
- /**
65
- * 通用删除
66
- */
67
- export function remove (parameter, serviceName = 'af-system') {
68
- return post('/api/' + serviceName + '/' + commonApi.delete, parameter, null)
69
- }
70
-
71
- /**
72
- * 通用导入
73
- */
74
- export function importData (parameter, serviceName = 'af-system') {
75
- return post('/api/' + serviceName + '/' + commonApi.importData, parameter, null)
76
- }
77
-
78
- /**
79
- * 通用导出
80
- */
81
- export function exportData (parameter, serviceName = 'af-system') {
82
- return post('/api/' + serviceName + '/' + commonApi.exportData, parameter, null)
83
- }
84
-
85
- /**
86
- * 通用上传
87
- */
88
- export function upload (parameter, serviceName = 'af-system', config) {
89
- return post('/api/' + serviceName + '/' + commonApi.upload, parameter, config)
90
- }
91
-
92
- // 通用下载
93
- export function download (parameter, filename, serviceName = 'af-system') {
94
- const notificationKey = 'download'
95
- notification.open({
96
- key: notificationKey,
97
- message: '正在下载数据,请稍候',
98
- duration: null,
99
- icon: h => {
100
- return h(
101
- 'a-icon',
102
- {
103
- props: {
104
- type: 'loading'
105
- }
106
- }
107
- )
108
- }
109
- })
110
- return post('/api/' + serviceName + '/' + commonApi.download, parameter, {
111
- responseType: 'blob'
112
- }).then(async (data) => {
113
- const isLogin = await blobValidate(data)
114
- if (isLogin) {
115
- const blob = new Blob([data])
116
- saveAs(blob, filename)
117
- message.success('下载成功')
118
- } else {
119
- const resText = await data.text()
120
- const rspObj = JSON.parse(resText)
121
- const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
122
- message.error(errMsg)
123
- }
124
- notification.close(notificationKey)
125
- }).catch((r) => {
126
- message.error('功能尚未实现,敬请期待!')
127
- // message.error('下载文件出现错误,请联系管理员!')
128
- notification.close(notificationKey)
129
- })
130
- }
131
-
132
- export { commonApi }
1
+ import { indexedDB } from '@vue2-client/utils/indexedDB'
2
+ import notification from 'ant-design-vue/lib/notification'
3
+ import message from 'ant-design-vue/lib/message'
4
+ import { blobValidate } from '@vue2-client/utils/common'
5
+ import errorCode from '@vue2-client/utils/errorCode'
6
+ import { saveAs } from 'file-saver'
7
+ import { post } from '@vue2-client/services/api/restTools'
8
+
9
+ const commonApi = {
10
+ // 获取表格列配置
11
+ getConfig: 'logic/getLiuliConfiguration',
12
+ // 通用查询
13
+ query: 'logic/commonQuery',
14
+ // 表单查询
15
+ queryWithResource: 'logic/commonQueryWithResource',
16
+ // 通用新增/修改
17
+ addOrModify: 'logic/commonAddOrModify',
18
+ // 通用删除
19
+ delete: 'logic/commonDelete',
20
+ // 获取字典键列表
21
+ getDictionaryParam: '/api/system/logic/getDictionaryParam',
22
+ // 获取所有员工及其部门的级联菜单数据
23
+ getEmpTree: '/api/system/logic/getEmpTree',
24
+ // 导入数据
25
+ importData: 'logic/importData',
26
+ // 导出数据
27
+ exportData: 'logic/commonExport',
28
+ // 下载数据
29
+ download: 'resource/download',
30
+ // 通用上传
31
+ upload: '/resource/upload'
32
+ }
33
+
34
+ export function getConfigUrl (serviceName = 'system') {
35
+ return '/api/' + serviceName + '/' + commonApi.getConfig
36
+ }
37
+
38
+ /**
39
+ * 带缓存查询的表格配置文件查询
40
+ * @param queryParamsName 配置名称
41
+ * @param serviceName 命名空间名称
42
+ * @param callback 回调函数
43
+ */
44
+ export function getColumnsJson (queryParamsName, serviceName = 'system', callback) {
45
+ indexedDB.getByWeb(queryParamsName, getConfigUrl(serviceName), { configName: queryParamsName }, callback)
46
+ }
47
+
48
+ /**
49
+ * 通用查询
50
+ */
51
+ export function query (parameter, serviceName = 'system') {
52
+ return post('/api/' + serviceName + '/' + commonApi.query, parameter, null)
53
+ }
54
+
55
+ /**
56
+ * 通用表单查询
57
+ */
58
+ export function queryWithResource (parameter, serviceName = 'system') {
59
+ return post('/api/' + serviceName + '/' + commonApi.queryWithResource, parameter, null)
60
+ }
61
+
62
+ /**
63
+ * 通用新增/修改
64
+ */
65
+ export function addOrModify (parameter, serviceName = 'system') {
66
+ return post('/api/' + serviceName + '/' + commonApi.addOrModify, parameter, null)
67
+ }
68
+
69
+ /**
70
+ * 通用删除
71
+ */
72
+ export function remove (parameter, serviceName = 'system') {
73
+ return post('/api/' + serviceName + '/' + commonApi.delete, parameter, null)
74
+ }
75
+
76
+ /**
77
+ * 通用导入
78
+ */
79
+ export function importData (parameter, serviceName = 'system') {
80
+ return post('/api/' + serviceName + '/' + commonApi.importData, parameter, null)
81
+ }
82
+
83
+ /**
84
+ * 通用导出
85
+ */
86
+ export function exportData (parameter, serviceName = 'system') {
87
+ return post('/api/' + serviceName + '/' + commonApi.exportData, parameter, null)
88
+ }
89
+
90
+ /**
91
+ * 通用上传
92
+ */
93
+ export function upload (parameter, serviceName = 'system', config) {
94
+ return post('/api/' + serviceName + '/' + commonApi.upload, parameter, config)
95
+ }
96
+
97
+ // 通用下载
98
+ export function download (parameter, filename, serviceName = 'system') {
99
+ const notificationKey = 'download'
100
+ notification.open({
101
+ key: notificationKey,
102
+ message: '正在下载数据,请稍候',
103
+ duration: null,
104
+ icon: h => {
105
+ return h(
106
+ 'a-icon',
107
+ {
108
+ props: {
109
+ type: 'loading'
110
+ }
111
+ }
112
+ )
113
+ }
114
+ })
115
+ return post('/api/' + serviceName + '/' + commonApi.download, parameter, {
116
+ responseType: 'blob'
117
+ }).then(async (data) => {
118
+ const isLogin = await blobValidate(data)
119
+ if (isLogin) {
120
+ const blob = new Blob([data])
121
+ saveAs(blob, filename)
122
+ message.success('下载成功')
123
+ } else {
124
+ const resText = await data.text()
125
+ const rspObj = JSON.parse(resText)
126
+ const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
127
+ message.error(errMsg)
128
+ }
129
+ notification.close(notificationKey)
130
+ }).catch((r) => {
131
+ message.error('功能尚未实现,敬请期待!')
132
+ // message.error('下载文件出现错误,请联系管理员!')
133
+ notification.close(notificationKey)
134
+ })
135
+ }
136
+
137
+ export { commonApi }
@@ -1,10 +1,10 @@
1
- const CommonTempTable = {
2
- // 初始化子表
3
- initApplySubTable: '/api/af-system/logic/initApplySubTable',
4
- // 创建临时表,根据配置文件动态生成
5
- createTempTable: '/api/af-system/logic/createTempTable',
6
- // 向临时表中插入数据
7
- insertDataToTempTable: '/api/af-system/logic/insertDataToTempTable'
8
- }
9
-
10
- export { CommonTempTable }
1
+ const CommonTempTable = {
2
+ // 初始化子表
3
+ initApplySubTable: '/api/system/logic/initApplySubTable',
4
+ // 创建临时表,根据配置文件动态生成
5
+ createTempTable: '/api/system/logic/createTempTable',
6
+ // 向临时表中插入数据
7
+ insertDataToTempTable: '/api/system/logic/insertDataToTempTable'
8
+ }
9
+
10
+ export { CommonTempTable }
@@ -1,17 +1,17 @@
1
- import { commonApi, getColumnsJson, query, addOrModify, remove } from '@vue2-client/services/api/common'
2
- import { QueryParamsDetailsViewApi } from '@vue2-client/services/api/QueryParamsDetailsViewApi'
3
- import { DictionaryDetailsViewApi } from '@vue2-client/services/api/DictionaryDetailsViewApi'
4
- import { LogDetailsViewApi } from '@vue2-client/services/api/LogDetailsViewApi'
5
- import { manageApi } from '@vue2-client/services/api/manage'
6
- import { get, post } from '@vue2-client/services/api/restTools'
7
- import { TicketDetailsViewApi } from '@vue2-client/services/api/TicketDetailsViewApi'
8
-
9
- export {
10
- commonApi, getColumnsJson, query, addOrModify, remove,
11
- DictionaryDetailsViewApi,
12
- LogDetailsViewApi,
13
- manageApi,
14
- QueryParamsDetailsViewApi,
15
- get, post,
16
- TicketDetailsViewApi
17
- }
1
+ import { commonApi, getColumnsJson, query, addOrModify, remove } from '@vue2-client/services/api/common'
2
+ import { QueryParamsDetailsViewApi } from '@vue2-client/services/api/QueryParamsDetailsViewApi'
3
+ import { DictionaryDetailsViewApi } from '@vue2-client/services/api/DictionaryDetailsViewApi'
4
+ import { LogDetailsViewApi } from '@vue2-client/services/api/LogDetailsViewApi'
5
+ import { manageApi } from '@vue2-client/services/api/manage'
6
+ import { get, post } from '@vue2-client/services/api/restTools'
7
+ import { TicketDetailsViewApi } from '@vue2-client/services/api/TicketDetailsViewApi'
8
+
9
+ export {
10
+ commonApi, getColumnsJson, query, addOrModify, remove,
11
+ DictionaryDetailsViewApi,
12
+ LogDetailsViewApi,
13
+ manageApi,
14
+ QueryParamsDetailsViewApi,
15
+ get, post,
16
+ TicketDetailsViewApi
17
+ }
@@ -1,6 +1,6 @@
1
- const loginforApi = {
2
- // 查询:获取系统访问记录
3
- query: '/api/af-system/logic/getLogininfor'
4
- }
5
-
6
- export { loginforApi }
1
+ const loginforApi = {
2
+ // 查询:获取系统访问记录
3
+ query: '/api/system/logic/getLogininfor'
4
+ }
5
+
6
+ export { loginforApi }
@@ -1,8 +1,8 @@
1
- const manageApi = {
2
- // 查询:获取字典键列表
3
- getDictionaryValue: '/api/af-system/logic/getDictionaryValue',
4
- // 查询:获取省市区街道三级分类
5
- getDivisionsOhChina: '/api/af-system/logic/getDivisionsOhChina'
6
- }
7
-
8
- export { manageApi }
1
+ const manageApi = {
2
+ // 查询:获取字典键列表
3
+ getDictionaryValue: '/api/system/logic/getDictionaryValue',
4
+ // 查询:获取省市区街道三级分类
5
+ getDivisionsOhChina: '/api/system/logic/getDivisionsOhChina'
6
+ }
7
+
8
+ export { manageApi }
@@ -1,14 +1,14 @@
1
- // 跨域代理前缀
2
- // const API_PROXY_PREFIX='/api'
3
- // const BASE_URL = process.env.NODE_ENV === 'production' ? process.env.VUE_APP_API_BASE_URL : API_PROXY_PREFIX
4
-
5
- module.exports = {
6
- LOGIN: `/rs/logic/getLogin`,
7
- MODIFY_PASSWORD: '/rs/user/modifypwd',
8
- V4_LOGIN: '/auth/login',
9
- V4_LOGOUT: '/auth/logout',
10
- ROUTES: `/rs/user/userLogin`,
11
- SEARCH: `/rs/search`,
12
- GOODS: `/goods`,
13
- GOODS_COLUMNS: `/columns`
14
- }
1
+ // 跨域代理前缀
2
+ // const API_PROXY_PREFIX='/api'
3
+ // const BASE_URL = process.env.NODE_ENV === 'production' ? process.env.VUE_APP_API_BASE_URL : API_PROXY_PREFIX
4
+
5
+ module.exports = {
6
+ LOGIN: `/rs/logic/getLogin`,
7
+ MODIFY_PASSWORD: '/rs/user/modifypwd',
8
+ V4_LOGIN: '/auth/login',
9
+ V4_LOGOUT: '/auth/logout',
10
+ ROUTES: `/rs/user/userLogin`,
11
+ SEARCH: `/rs/search`,
12
+ GOODS: `/goods`,
13
+ GOODS_COLUMNS: `/columns`
14
+ }
@@ -1,67 +1,67 @@
1
- import { LOGIN, MODIFY_PASSWORD, ROUTES, V4_GET_INFO, V4_LOGIN, V4_LOGOUT } from '@vue2-client/services/apiService'
2
- import { request, METHOD, removeAuthorization } from '@vue2-client/utils/request'
3
- import EncryptUtil from '@vue2-client/utils/EncryptUtil'
4
-
5
- /**
6
- * 登录服务
7
- * @param name 账户名
8
- * @param password 账户密码
9
- * @returns {Promise<AxiosResponse<T>>}
10
- */
11
- export async function login (name, password) {
12
- let data = {
13
- name: name,
14
- password: password
15
- }
16
- data = '$' + EncryptUtil.RSAEncrypt(JSON.stringify(data))
17
- return request(LOGIN, METHOD.POST, data)
18
- }
19
-
20
- export async function modifyPassword (name, password, newPassword) {
21
- return request(MODIFY_PASSWORD, METHOD.POST, {
22
- data: {
23
- ename: name,
24
- password: password,
25
- newpassword: newPassword,
26
- affirmpassword: newPassword
27
- }
28
- })
29
- }
30
-
31
- export async function V4Login (name, password) {
32
- return request(V4_LOGIN, METHOD.POST, {
33
- username: name,
34
- password: password
35
- })
36
- }
37
-
38
- export async function V4GetInfo () {
39
- return request(V4_GET_INFO, METHOD.POST, {})
40
- }
41
-
42
- export async function getRoutesConfig (value, routeName = '智慧燃气') {
43
- return request(ROUTES + '/' + routeName, METHOD.POST, value)
44
- }
45
-
46
- /**
47
- * 退出登录
48
- */
49
- export function logout () {
50
- return new Promise((resolve, reject) => {
51
- request(V4_LOGOUT, METHOD.DELETE, {}).then(() => {
52
- resolve()
53
- }).catch(error => {
54
- reject(error)
55
- }).finally(() => {
56
- localStorage.removeItem(process.env.VUE_APP_ROUTES_KEY)
57
- localStorage.removeItem(process.env.VUE_APP_PERMISSIONS_KEY)
58
- localStorage.removeItem(process.env.VUE_APP_ROLES_KEY)
59
- removeAuthorization()
60
- })
61
- })
62
- }
63
- export default {
64
- login,
65
- logout,
66
- getRoutesConfig
67
- }
1
+ import { LOGIN, MODIFY_PASSWORD, ROUTES, V4_GET_INFO, V4_LOGIN, V4_LOGOUT } from '@vue2-client/services/apiService'
2
+ import { request, METHOD, removeAuthorization } from '@vue2-client/utils/request'
3
+ import EncryptUtil from '@vue2-client/utils/EncryptUtil'
4
+
5
+ /**
6
+ * 登录服务
7
+ * @param name 账户名
8
+ * @param password 账户密码
9
+ * @returns {Promise<AxiosResponse<T>>}
10
+ */
11
+ export async function login (name, password) {
12
+ let data = {
13
+ name: name,
14
+ password: password
15
+ }
16
+ data = '$' + EncryptUtil.RSAEncrypt(JSON.stringify(data))
17
+ return request(LOGIN, METHOD.POST, data)
18
+ }
19
+
20
+ export async function modifyPassword (name, password, newPassword) {
21
+ return request(MODIFY_PASSWORD, METHOD.POST, {
22
+ data: {
23
+ ename: name,
24
+ password: password,
25
+ newpassword: newPassword,
26
+ affirmpassword: newPassword
27
+ }
28
+ })
29
+ }
30
+
31
+ export async function V4Login (name, password) {
32
+ return request(V4_LOGIN, METHOD.POST, {
33
+ username: name,
34
+ password: password
35
+ })
36
+ }
37
+
38
+ export async function V4GetInfo () {
39
+ return request(V4_GET_INFO, METHOD.POST, {})
40
+ }
41
+
42
+ export async function getRoutesConfig (value, routeName = '智慧燃气') {
43
+ return request(ROUTES + '/' + routeName, METHOD.POST, value)
44
+ }
45
+
46
+ /**
47
+ * 退出登录
48
+ */
49
+ export function logout () {
50
+ return new Promise((resolve, reject) => {
51
+ request(V4_LOGOUT, METHOD.DELETE, {}).then(() => {
52
+ resolve()
53
+ }).catch(error => {
54
+ reject(error)
55
+ }).finally(() => {
56
+ localStorage.removeItem(process.env.VUE_APP_ROUTES_KEY)
57
+ localStorage.removeItem(process.env.VUE_APP_PERMISSIONS_KEY)
58
+ localStorage.removeItem(process.env.VUE_APP_ROLES_KEY)
59
+ removeAuthorization()
60
+ })
61
+ })
62
+ }
63
+ export default {
64
+ login,
65
+ logout,
66
+ getRoutesConfig
67
+ }
@@ -1,4 +1,4 @@
1
- import account from './account'
2
- import setting from './setting'
3
-
4
- export default { account, setting }
1
+ import account from './account'
2
+ import setting from './setting'
3
+
4
+ export default { account, setting }