ci-plus 1.2.0 → 1.2.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.
- package/index.ts +3 -1
- package/package.json +1 -1
- package/src/utils/baseApi.ts +4 -53
- package/src/utils/index.ts +8 -2
package/index.ts
CHANGED
package/package.json
CHANGED
package/src/utils/baseApi.ts
CHANGED
|
@@ -5,59 +5,10 @@
|
|
|
5
5
|
* @版本 : 1.0.0
|
|
6
6
|
* @创建时间 : 创建时间 2024-01-05 13:17:56
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import { store } from '@ice/stark-data'
|
|
9
|
+
const apis = store.get('APIs')['1.1.1']
|
|
10
|
+
console.log('apis???: ', apis);
|
|
11
|
+
export default apis
|
|
11
12
|
|
|
12
|
-
import axios from 'axios'
|
|
13
|
-
axios.defaults.withCredentials = true
|
|
14
13
|
|
|
15
|
-
interface IApi {
|
|
16
|
-
[key: string]: string
|
|
17
|
-
}
|
|
18
|
-
const type = import.meta.env.VITE_API_PARAMS // 判断当前环境
|
|
19
|
-
const baseApi =
|
|
20
|
-
type === 'getApiDev'
|
|
21
|
-
? import.meta.env.VITE_BASE_URL
|
|
22
|
-
: import.meta.env.VITE_BASE_URL + ':' + import.meta.env.VITE_PORT_AXIOS
|
|
23
|
-
const getUrl = async (): Promise<IApi> => {
|
|
24
|
-
return new Promise((resolve, reject) => {
|
|
25
|
-
let urldev = `${baseApi}:8510/api/OAM/sys_code_set/v1.1.1/query_function_config_get/`
|
|
26
|
-
let urlPro = `${baseApi}/logapi/OAM/api/OAM/sys_code_set/v1.1.1/query_function_config_get/`
|
|
27
|
-
let apiurl = type === 'getApiDev' ? urldev : urlPro
|
|
28
|
-
try {
|
|
29
|
-
axios
|
|
30
|
-
.get(apiurl, {
|
|
31
|
-
params: { function_code: type || 'getApiPro' },
|
|
32
|
-
})
|
|
33
|
-
.then((res) => {
|
|
34
|
-
if (
|
|
35
|
-
res.data.code === 200 &&
|
|
36
|
-
res.data.data &&
|
|
37
|
-
res.data.data.all_choices &&
|
|
38
|
-
res.data.data.all_choices.length > 0
|
|
39
|
-
) {
|
|
40
|
-
// console.log('接口配置: ', res.data.data.all_choices)
|
|
41
|
-
resolve(
|
|
42
|
-
res.data.data.all_choices.reduce((acc: any, cur: any) => {
|
|
43
|
-
acc[cur.label] = baseApi + cur.value
|
|
44
|
-
return acc
|
|
45
|
-
}, {}),
|
|
46
|
-
)
|
|
47
|
-
} else {
|
|
48
|
-
console.error('没获取到接口数据: ', res.data.msg)
|
|
49
|
-
reject(res.data.msg)
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
.catch((error) => {
|
|
53
|
-
console.error(error)
|
|
54
|
-
reject(error)
|
|
55
|
-
})
|
|
56
|
-
} catch (error) {
|
|
57
|
-
console.log('error: ', error)
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
}
|
|
61
|
-
const apis = await getUrl()
|
|
62
|
-
export default apis
|
|
63
14
|
|
package/src/utils/index.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export { default as withInstall } from './withinstall/index';
|
|
2
2
|
|
|
3
|
-
export { default as setCardList } from './cardPrint'; // 导入默认的导出
|
|
4
|
-
export * from './cardPrint'; // 导入所有导出(不包含默认导出)
|
|
3
|
+
// export { default as setCardList } from './cardPrint'; // 导入默认的导出
|
|
4
|
+
// export * from './cardPrint'; // 导入所有导出(不包含默认导出)
|
|
5
|
+
|
|
6
|
+
import { cardPrint, setCardList } from "./cardPrint";
|
|
7
|
+
import apis from "./baseApi";
|
|
8
|
+
|
|
9
|
+
// 导出 cardPrint 和 apis
|
|
10
|
+
export default { cardPrint, setCardList, apis };
|