@smart100/spu-web-plugin 1.0.25-beta.5 → 1.0.25-beta.7
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 +15 -8
- package/dist/spu-web-plugin.mjs +4192 -403
- package/package.json +2 -2
- package/src/axios.ts +126 -106
- package/src/axiosCache.ts +290 -0
- package/src/components/expandexp/index.ts +6 -6
- package/src/core.js +29 -6
- package/src/envService.ts +2 -2
- package/src/globalConfig.ts +24 -4
- package/src/index.ts +18 -5
- package/src/login.ts +18 -8
- package/src/map/index.ts +3 -3
- package/src/oss/cache.ts +178 -0
- package/src/oss/downloadService.ts +115 -53
- package/src/oss/servtoken.ts +4 -2
- package/src/oss/uploadService.ts +72 -81
- package/src/spuConfig.ts +30 -7
- package/src/tenantSetting.ts +2 -2
- package/src/types/index.d.ts +15 -8
- package/src/utils.ts +38 -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,16 @@ 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' | 'default'
|
|
87
|
+
checkcachesave?: any
|
|
88
|
+
cachetime?: number
|
|
89
|
+
}
|
|
86
90
|
|
|
87
91
|
interface ISPUWebPlugin {
|
|
88
92
|
// install (app: App, option: ISPUWebPluginOptions): void
|
|
@@ -110,11 +114,13 @@ export const getAddress: (location: {
|
|
|
110
114
|
latitude: string
|
|
111
115
|
[propName: string]: any
|
|
112
116
|
}) => Promise<string>
|
|
117
|
+
export const normalAxios: any
|
|
113
118
|
export const spuAxios: any
|
|
114
119
|
export const apaasAxios: any
|
|
115
120
|
export const axios: any
|
|
116
121
|
export const decryptAxiosResponseData: any
|
|
117
122
|
export const spuConfig: any
|
|
123
|
+
export const axiosCache: any
|
|
118
124
|
export const globalConfig: any
|
|
119
125
|
export const downloadService: IDownloadService
|
|
120
126
|
export const uploadService: IUploadService
|
|
@@ -129,6 +135,7 @@ export const getUniqueid: () => string
|
|
|
129
135
|
export const getUuid: () => string
|
|
130
136
|
export const functionCheck: (functioncode?: string) => boolean
|
|
131
137
|
export const getServerTime: () => Promise<string>
|
|
138
|
+
export const isOnline: (pingUrl?: string) => Promise<boolean>
|
|
132
139
|
export const encrypt: (str: string) => string
|
|
133
140
|
export const decrypt: (str: string) => string
|
|
134
141
|
export const setTitle: (pagetitle?: string) => void
|