@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 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
- // interface ISPUWebPluginOptions {
79
- // modulekey: string
80
- // modulename: string
81
- // moduleversion: string
82
- // storageproxyprefix?: string
83
- // isfixapptokenexpired?: boolean
84
- // router?: any
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