vue2-client 1.7.0 → 1.7.2

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 (128) hide show
  1. package/.env +15 -15
  2. package/CHANGELOG.md +661 -628
  3. package/Components.md +60 -0
  4. package/index.js +31 -30
  5. package/package.json +83 -81
  6. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +316 -316
  7. package/src/base-client/components/common/CitySelect/CitySelect.vue +247 -247
  8. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -667
  9. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +735 -733
  10. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +466 -468
  11. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +510 -508
  12. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +144 -146
  13. package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
  14. package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
  15. package/src/base-client/components/common/Upload/Upload.vue +168 -168
  16. package/src/base-client/components/common/XAddForm/XAddForm.vue +72 -325
  17. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +369 -279
  18. package/src/base-client/components/common/XAddNativeForm/index.md +107 -17
  19. package/src/base-client/components/common/XCard/XCard.vue +64 -64
  20. package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -0
  21. package/src/base-client/components/common/XDataDrawer/index.js +3 -0
  22. package/src/base-client/components/common/XDataDrawer/index.md +41 -0
  23. package/src/base-client/components/common/XForm/XForm.vue +178 -180
  24. package/src/base-client/components/common/XForm/XFormItem.vue +521 -513
  25. package/src/base-client/components/common/XForm/XTreeSelect.vue +184 -184
  26. package/src/base-client/components/common/XFormCol/XFormCol.vue +38 -38
  27. package/src/base-client/components/common/XFormTable/XFormTable.vue +356 -344
  28. package/src/base-client/components/common/XFormTable/index.md +97 -97
  29. package/src/base-client/components/common/XImportExcel/XImportExcel.vue +132 -132
  30. package/src/base-client/components/common/XTable/XTable.vue +519 -506
  31. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +111 -111
  32. package/src/base-client/components/index.js +41 -0
  33. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +231 -231
  34. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  35. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
  36. package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
  37. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  38. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  39. package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
  40. package/src/base-client/plugins/AppData.js +76 -76
  41. package/src/base-client/plugins/GetLoginInfoService.js +179 -179
  42. package/src/base-client/plugins/PagedList.js +177 -177
  43. package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
  44. package/src/base-client/plugins/i18n-extend.js +32 -32
  45. package/src/components/Ellipsis/Ellipsis.vue +65 -65
  46. package/src/components/Ellipsis/index.md +38 -38
  47. package/src/components/NumberInfo/index.md +43 -43
  48. package/src/components/STable/README.md +341 -341
  49. package/src/components/STable/index.js +318 -318
  50. package/src/components/Trend/index.md +45 -45
  51. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  52. package/src/components/checkbox/ImgCheckbox.vue +163 -163
  53. package/src/components/exception/ExceptionPage.vue +70 -70
  54. package/src/components/form/FormRow.vue +52 -52
  55. package/src/components/index.js +36 -36
  56. package/src/components/menu/SideMenu.vue +75 -62
  57. package/src/components/menu/menu.js +273 -273
  58. package/src/components/page/header/index.less +40 -40
  59. package/src/components/setting/Setting.vue +235 -235
  60. package/src/components/table/StandardTable.vue +141 -141
  61. package/src/components/table/advance/ActionColumns.vue +158 -158
  62. package/src/components/table/advance/SearchArea.vue +355 -355
  63. package/src/components/tool/AStepItem.vue +60 -60
  64. package/src/components/tool/AvatarList.vue +68 -68
  65. package/src/components/tool/Drawer.vue +142 -142
  66. package/src/components/tool/TagSelect.vue +83 -83
  67. package/src/components/transition/PageToggleTransition.vue +97 -97
  68. package/src/config/CreateQueryConfig.js +307 -307
  69. package/src/config/default/admin.config.js +18 -18
  70. package/src/config/default/setting.config.js +4 -2
  71. package/src/config/replacer/resolve.config.js +67 -67
  72. package/src/layouts/CommonLayout.vue +42 -42
  73. package/src/layouts/ComponentLayoutOne.vue +47 -47
  74. package/src/layouts/PageLayout.vue +151 -151
  75. package/src/layouts/SinglePageView.vue +116 -116
  76. package/src/layouts/footer/PageFooter.vue +49 -49
  77. package/src/layouts/header/AdminHeader.vue +134 -134
  78. package/src/layouts/header/HeaderAvatar.vue +64 -64
  79. package/src/layouts/header/HeaderNotice.vue +176 -176
  80. package/src/layouts/header/HeaderSearch.vue +67 -67
  81. package/src/layouts/header/InstitutionDetail.vue +181 -181
  82. package/src/layouts/header/index.less +92 -92
  83. package/src/layouts/tabs/TabsHead.vue +190 -190
  84. package/src/layouts/tabs/TabsView.vue +379 -379
  85. package/src/lib.js +1 -0
  86. package/src/mock/goods/index.js +108 -108
  87. package/src/pages/CreateQueryPage.vue +84 -84
  88. package/src/pages/login/Login.vue +369 -369
  89. package/src/pages/report/ReportTable.js +124 -124
  90. package/src/pages/report/ReportTableHome.vue +28 -28
  91. package/src/pages/resourceManage/orgListManage.vue +98 -98
  92. package/src/pages/system/dictionary/index.vue +43 -43
  93. package/src/pages/system/file/index.vue +317 -317
  94. package/src/pages/system/monitor/loginInfor/index.vue +36 -36
  95. package/src/pages/system/monitor/operLog/index.vue +36 -36
  96. package/src/pages/system/settings/index.vue +126 -126
  97. package/src/pages/system/settings/modifyPassword.vue +109 -109
  98. package/src/router/async/config.async.js +28 -28
  99. package/src/router/async/router.map.js +66 -66
  100. package/src/router/guards.js +52 -12
  101. package/src/router/index.js +27 -27
  102. package/src/services/api/DictionaryDetailsViewApi.js +6 -6
  103. package/src/services/api/LogDetailsViewApi.js +10 -10
  104. package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
  105. package/src/services/api/TicketDetailsViewApi.js +34 -34
  106. package/src/services/api/cas.js +79 -79
  107. package/src/services/api/common.js +137 -137
  108. package/src/services/api/commonTempTable.js +10 -10
  109. package/src/services/api/index.js +17 -17
  110. package/src/services/api/logininfor/index.js +6 -6
  111. package/src/services/api/manage.js +8 -8
  112. package/src/services/apiService.js +14 -14
  113. package/src/services/user.js +67 -67
  114. package/src/store/modules/index.js +4 -4
  115. package/src/theme/default/nprogress.less +76 -76
  116. package/src/theme/default/style.less +58 -58
  117. package/src/utils/EncryptUtil.js +53 -53
  118. package/src/utils/colors.js +107 -107
  119. package/src/utils/excel/Blob.js +180 -180
  120. package/src/utils/excel/Export2Excel.js +141 -141
  121. package/src/utils/formatter.js +68 -68
  122. package/src/utils/i18n.js +80 -80
  123. package/src/utils/login.js +138 -0
  124. package/src/utils/map-utils.js +37 -37
  125. package/src/utils/theme-color-replacer-extend.js +91 -91
  126. package/src/utils/themeUtil.js +100 -100
  127. package/src/utils/util.js +230 -230
  128. package/vue.config.js +106 -106
@@ -1,137 +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
- 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
+ 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/system/logic/initApplySubTable',
4
- // 创建临时表,根据配置文件动态生成
5
- createTempTable: '/api/system/logic/createTempTable',
6
- // 向临时表中插入数据
7
- insertDataToTempTable: '/api/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/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/system/logic/getDictionaryValue',
4
- // 查询:获取省市区街道三级分类
5
- getDivisionsOhChina: '/api/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 }