@smart100/spu-web-plugin 1.0.25-beta.4 → 1.0.25-beta.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/dist/index.d.ts +14 -8
- package/dist/spu-web-plugin.mjs +4067 -314
- package/package.json +2 -2
- package/src/axios.ts +126 -106
- package/src/axiosCache.ts +276 -0
- package/src/components/expandexp/index.ts +6 -6
- package/src/core.js +2 -2
- package/src/envService.ts +2 -2
- package/src/globalConfig.ts +7 -4
- package/src/index.ts +19 -5
- package/src/login.ts +42 -21
- package/src/map/index.ts +3 -3
- package/src/oss/cache.ts +178 -0
- package/src/oss/downloadService.ts +119 -56
- package/src/oss/servtoken.ts +4 -2
- package/src/oss/uploadService.ts +72 -81
- package/src/tenantSetting.ts +2 -2
- package/src/types/index.d.ts +14 -8
- package/src/utils.ts +33 -3
package/dist/index.d.ts
CHANGED
|
@@ -53,6 +53,8 @@ interface IDownload {
|
|
|
53
53
|
|
|
54
54
|
interface IDownloadService {
|
|
55
55
|
getUrl: (options: IDownload) => Promise<any>
|
|
56
|
+
getBlob: (options: IDownload) => Promise<any>
|
|
57
|
+
getObjectURL: (options: IDownload) => Promise<string>
|
|
56
58
|
downloadFile: (options: IDownload) => Promise<any>
|
|
57
59
|
}
|
|
58
60
|
|
|
@@ -75,14 +77,15 @@ interface IUploadService {
|
|
|
75
77
|
copy: (options: ICopy) => Promise<any>
|
|
76
78
|
}
|
|
77
79
|
|
|
78
|
-
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
export interface IAxiosCacheConfig {
|
|
81
|
+
// 缓存策略 cachestrategy:
|
|
82
|
+
// network-only: 不缓存:仅使用联网数据
|
|
83
|
+
// network-first: 网络优先,缓存数据后,下次请求优先使用联网数据,离线才使用缓存数据
|
|
84
|
+
// cache-first: 缓存优先,缓存数据后,下次请求优先使用缓存数据,使用缓存后如果有联网则依然请求最新数据替换旧缓存【比如剑哥需求文档中的表单协议缓存,则属于此策略】【这个策略下需第二次请求接口才能拿到最新数据】
|
|
85
|
+
// d.如果是 b c,支持配置缓存过期时间
|
|
86
|
+
strategy: 'network-only' | 'cache-first' | 'network-first'
|
|
87
|
+
cachetime?: number
|
|
88
|
+
}
|
|
86
89
|
|
|
87
90
|
interface ISPUWebPlugin {
|
|
88
91
|
// install (app: App, option: ISPUWebPluginOptions): void
|
|
@@ -110,11 +113,13 @@ export const getAddress: (location: {
|
|
|
110
113
|
latitude: string
|
|
111
114
|
[propName: string]: any
|
|
112
115
|
}) => Promise<string>
|
|
116
|
+
export const normalAxios: any
|
|
113
117
|
export const spuAxios: any
|
|
114
118
|
export const apaasAxios: any
|
|
115
119
|
export const axios: any
|
|
116
120
|
export const decryptAxiosResponseData: any
|
|
117
121
|
export const spuConfig: any
|
|
122
|
+
export const axiosCache: any
|
|
118
123
|
export const globalConfig: any
|
|
119
124
|
export const downloadService: IDownloadService
|
|
120
125
|
export const uploadService: IUploadService
|
|
@@ -129,6 +134,7 @@ export const getUniqueid: () => string
|
|
|
129
134
|
export const getUuid: () => string
|
|
130
135
|
export const functionCheck: (functioncode?: string) => boolean
|
|
131
136
|
export const getServerTime: () => Promise<string>
|
|
137
|
+
export const isOnline: (pingUrl?: string) => Promise<boolean>
|
|
132
138
|
export const encrypt: (str: string) => string
|
|
133
139
|
export const decrypt: (str: string) => string
|
|
134
140
|
export const setTitle: (pagetitle?: string) => void
|