vue2-client 1.8.0-4 → 1.8.0-6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env
CHANGED
package/package.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
>
|
|
25
25
|
<a-form-model :model="form" :rules="rules" ref="liuliModel">
|
|
26
26
|
<a-form-model-item label="命名空间" prop="namespaceName">
|
|
27
|
-
<a-input v-model="form.namespaceName" :placeholder="'默认值:' +
|
|
27
|
+
<a-input v-model="form.namespaceName" :placeholder="'默认值:' + systemName"/>
|
|
28
28
|
</a-form-model-item>
|
|
29
29
|
<a-form-model-item label="配置名称" prop="configName">
|
|
30
30
|
<a-input v-model="form.configName"/>
|
|
@@ -58,7 +58,6 @@
|
|
|
58
58
|
<script>
|
|
59
59
|
import CreateQuery from '@vue2-client/base-client/components/common/CreateQuery'
|
|
60
60
|
import CreateSimpleFormQuery from '@vue2-client/base-client/components/common/CreateSimpleFormQuery'
|
|
61
|
-
import { mapState } from 'vuex'
|
|
62
61
|
import { getNativeConfig } from '@vue2-client/services/api/common'
|
|
63
62
|
|
|
64
63
|
export default {
|
|
@@ -88,7 +87,9 @@ export default {
|
|
|
88
87
|
}
|
|
89
88
|
},
|
|
90
89
|
computed: {
|
|
91
|
-
|
|
90
|
+
systemName () {
|
|
91
|
+
return process.env.VUE_APP_SYSTEM_NAME
|
|
92
|
+
}
|
|
92
93
|
},
|
|
93
94
|
methods: {
|
|
94
95
|
showDrawer () {
|
|
@@ -5,7 +5,6 @@ import { blobValidate } from '@vue2-client/utils/common'
|
|
|
5
5
|
import errorCode from '@vue2-client/utils/errorCode'
|
|
6
6
|
import { saveAs } from 'file-saver'
|
|
7
7
|
import { post } from '@vue2-client/services/api/restTools'
|
|
8
|
-
import setting from '@vue2-client/store/modules/setting'
|
|
9
8
|
|
|
10
9
|
const commonApi = {
|
|
11
10
|
// 获取配置
|
|
@@ -36,15 +35,15 @@ const commonApi = {
|
|
|
36
35
|
getEmpTree: '/api/af-system/logic/getEmpTree',
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
export function getConfigUrl (serviceName =
|
|
38
|
+
export function getConfigUrl (serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
40
39
|
return '/api/' + serviceName + '/' + commonApi.getConfig
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
export function getNativeConfigUrl (serviceName =
|
|
42
|
+
export function getNativeConfigUrl (serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
44
43
|
return '/api/' + serviceName + '/' + commonApi.getNativeConfig
|
|
45
44
|
}
|
|
46
45
|
|
|
47
|
-
export function parseConfigUrl (serviceName =
|
|
46
|
+
export function parseConfigUrl (serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
48
47
|
return '/api/' + serviceName + '/' + commonApi.parseConfig
|
|
49
48
|
}
|
|
50
49
|
|
|
@@ -61,11 +60,11 @@ export function getDictionaryParam () {
|
|
|
61
60
|
* @param serviceName 命名空间名称
|
|
62
61
|
* @param callback 回调函数
|
|
63
62
|
*/
|
|
64
|
-
export function getConfig (configName, serviceName =
|
|
63
|
+
export function getConfig (configName, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback) {
|
|
65
64
|
indexedDB.getByWeb(configName, getConfigUrl(serviceName), { configName: configName }, callback)
|
|
66
65
|
}
|
|
67
66
|
|
|
68
|
-
export function getNativeConfig (configName, serviceName =
|
|
67
|
+
export function getNativeConfig (configName, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
69
68
|
return post(getNativeConfigUrl(serviceName), { configName: configName })
|
|
70
69
|
}
|
|
71
70
|
|
|
@@ -76,7 +75,7 @@ export function getNativeConfig (configName, serviceName = setting.state.default
|
|
|
76
75
|
* @param serviceName 命名空间名称
|
|
77
76
|
* @param callback 回调函数
|
|
78
77
|
*/
|
|
79
|
-
export function getConfigByLogic (logicName, parameter, serviceName =
|
|
78
|
+
export function getConfigByLogic (logicName, parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback) {
|
|
80
79
|
indexedDB.getByWeb(`${logicName}_${JSON.stringify(parameter)}`, '/api/' + serviceName + '/logic/' + logicName,
|
|
81
80
|
parameter, callback)
|
|
82
81
|
}
|
|
@@ -87,7 +86,7 @@ export function getConfigByLogic (logicName, parameter, serviceName = setting.st
|
|
|
87
86
|
* @param configType 配置类型
|
|
88
87
|
* @param serviceName 命名空间名称
|
|
89
88
|
*/
|
|
90
|
-
export function parseConfig (configContent, configType, serviceName =
|
|
89
|
+
export function parseConfig (configContent, configType, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
91
90
|
const url = parseConfigUrl(serviceName)
|
|
92
91
|
return post(url, {
|
|
93
92
|
configType: configType,
|
|
@@ -98,61 +97,61 @@ export function parseConfig (configContent, configType, serviceName = setting.st
|
|
|
98
97
|
/**
|
|
99
98
|
* 通用执行业务逻辑
|
|
100
99
|
*/
|
|
101
|
-
export function runLogic (logicName, parameter, serviceName =
|
|
100
|
+
export function runLogic (logicName, parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
102
101
|
return post('/api/' + serviceName + '/logic/' + logicName, parameter)
|
|
103
102
|
}
|
|
104
103
|
|
|
105
104
|
/**
|
|
106
105
|
* 通用查询
|
|
107
106
|
*/
|
|
108
|
-
export function query (parameter, serviceName =
|
|
107
|
+
export function query (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
109
108
|
return post('/api/' + serviceName + '/' + commonApi.query, parameter, null)
|
|
110
109
|
}
|
|
111
110
|
|
|
112
111
|
/**
|
|
113
112
|
* 通用表单查询
|
|
114
113
|
*/
|
|
115
|
-
export function queryWithResource (parameter, serviceName =
|
|
114
|
+
export function queryWithResource (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
116
115
|
return post('/api/' + serviceName + '/' + commonApi.queryWithResource, parameter, null)
|
|
117
116
|
}
|
|
118
117
|
|
|
119
118
|
/**
|
|
120
119
|
* 通用新增/修改
|
|
121
120
|
*/
|
|
122
|
-
export function addOrModify (parameter, serviceName =
|
|
121
|
+
export function addOrModify (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
123
122
|
return post('/api/' + serviceName + '/' + commonApi.addOrModify, parameter, null)
|
|
124
123
|
}
|
|
125
124
|
|
|
126
125
|
/**
|
|
127
126
|
* 通用删除
|
|
128
127
|
*/
|
|
129
|
-
export function remove (parameter, serviceName =
|
|
128
|
+
export function remove (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
130
129
|
return post('/api/' + serviceName + '/' + commonApi.delete, parameter, null)
|
|
131
130
|
}
|
|
132
131
|
|
|
133
132
|
/**
|
|
134
133
|
* 通用导入
|
|
135
134
|
*/
|
|
136
|
-
export function importData (parameter, serviceName =
|
|
135
|
+
export function importData (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
137
136
|
return post('/api/' + serviceName + '/' + commonApi.importData, parameter, null)
|
|
138
137
|
}
|
|
139
138
|
|
|
140
139
|
/**
|
|
141
140
|
* 通用导出
|
|
142
141
|
*/
|
|
143
|
-
export function exportData (parameter, serviceName =
|
|
142
|
+
export function exportData (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
144
143
|
return post('/api/' + serviceName + '/' + commonApi.exportData, parameter, null)
|
|
145
144
|
}
|
|
146
145
|
|
|
147
146
|
/**
|
|
148
147
|
* 通用上传
|
|
149
148
|
*/
|
|
150
|
-
export function upload (parameter, serviceName =
|
|
149
|
+
export function upload (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, config) {
|
|
151
150
|
return post('/api/' + serviceName + '/' + commonApi.upload, parameter, config)
|
|
152
151
|
}
|
|
153
152
|
|
|
154
153
|
// 通用下载
|
|
155
|
-
export function download (parameter, filename, serviceName =
|
|
154
|
+
export function download (parameter, filename, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
156
155
|
const notificationKey = 'download'
|
|
157
156
|
notification.open({
|
|
158
157
|
key: notificationKey,
|
|
@@ -192,7 +191,7 @@ export function download (parameter, filename, serviceName = setting.state.defau
|
|
|
192
191
|
}
|
|
193
192
|
|
|
194
193
|
// 文件删除
|
|
195
|
-
export function fileDelete (parameter, serviceName =
|
|
194
|
+
export function fileDelete (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
196
195
|
return post('/api/' + serviceName + '/' + commonApi.fileEntity, parameter)
|
|
197
196
|
}
|
|
198
197
|
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
module.exports = {
|
|
6
6
|
LOGIN: `/rs/logic/getLogin`,
|
|
7
7
|
MODIFY_PASSWORD: '/rs/user/modifypwd',
|
|
8
|
-
V4_LOGIN: '/auth/login',
|
|
9
|
-
V4_LOGOUT: '/auth/logout',
|
|
8
|
+
V4_LOGIN: '/api/af-auth/login',
|
|
9
|
+
V4_LOGOUT: '/api/af-auth/logout',
|
|
10
10
|
ROUTES: `/rs/user/userLogin`,
|
|
11
11
|
SEARCH: `/rs/search`,
|
|
12
12
|
GOODS: `/goods`,
|
package/src/utils/request.js
CHANGED
|
@@ -5,6 +5,7 @@ import notification from 'ant-design-vue/es/notification'
|
|
|
5
5
|
import errorCode from '@vue2-client/utils/errorCode'
|
|
6
6
|
import qs from 'qs'
|
|
7
7
|
import { logout } from '@vue2-client/services/user'
|
|
8
|
+
import { V4_LOGIN } from '@vue2-client/services/apiService'
|
|
8
9
|
|
|
9
10
|
// 是否显示重新登录
|
|
10
11
|
let isReloginShow
|
|
@@ -134,7 +135,7 @@ function loadInterceptors () {
|
|
|
134
135
|
// 如果 token 存在
|
|
135
136
|
// 让每个请求携带自定义 token 请根据实际情况自行修改
|
|
136
137
|
if (token) {
|
|
137
|
-
if (config.url !==
|
|
138
|
+
if (config.url !== V4_LOGIN) {
|
|
138
139
|
// 判断是否为V4环境
|
|
139
140
|
const compatible = getSystemVersion()
|
|
140
141
|
if (compatible === 'V4') {
|
package/vue.config.js
CHANGED
|
@@ -24,11 +24,6 @@ module.exports = {
|
|
|
24
24
|
ws: false,
|
|
25
25
|
changeOrigin: true
|
|
26
26
|
},
|
|
27
|
-
'/auth': {
|
|
28
|
-
pathRewrite: { '^/auth/': '/rs/auth/' },
|
|
29
|
-
target: local,
|
|
30
|
-
changeOrigin: true
|
|
31
|
-
},
|
|
32
27
|
'/api': {
|
|
33
28
|
pathRewrite: { '^/api/af-system/': '/rs/', '^/api/af-iot/': '/rs/' },
|
|
34
29
|
// pathRewrite: { '^/api': '/' },
|