@smart100/spu-web-plugin 1.0.21 → 1.0.23
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 +3 -0
- package/dist/spu-web-plugin.mjs +14 -2
- package/package.json +1 -1
- package/src/axios.ts +2 -2
- package/src/index.ts +5 -1
- package/src/types/index.d.ts +3 -0
package/dist/index.d.ts
CHANGED
|
@@ -113,6 +113,7 @@ export const getAddress: (location: {
|
|
|
113
113
|
export const spuAxios: any
|
|
114
114
|
export const apaasAxios: any
|
|
115
115
|
export const axios: any
|
|
116
|
+
export const decryptAxiosResponseData: any
|
|
116
117
|
export const spuConfig: any
|
|
117
118
|
export const globalConfig: any
|
|
118
119
|
export const downloadService: IDownloadService
|
|
@@ -128,6 +129,8 @@ export const getUniqueid: () => string
|
|
|
128
129
|
export const getUuid: () => string
|
|
129
130
|
export const functionCheck: (functioncode?: string) => boolean
|
|
130
131
|
export const getServerTime: () => Promise<string>
|
|
132
|
+
export const encrypt: (str: string) => string
|
|
133
|
+
export const decrypt: (str: string) => string
|
|
131
134
|
export const setTitle: (pagetitle?: string) => void
|
|
132
135
|
export const isInApp: () => boolean
|
|
133
136
|
export const AMapLoader: IAMapLoader
|
package/dist/spu-web-plugin.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var version = "1.0.
|
|
1
|
+
var version = "1.0.23";
|
|
2
2
|
|
|
3
3
|
/** Detect free variable `global` from Node.js. */
|
|
4
4
|
var freeGlobal$2 = typeof global == 'object' && global && global.Object === Object && global;
|
|
@@ -15845,6 +15845,18 @@ function byteToString(arr) {
|
|
|
15845
15845
|
return str;
|
|
15846
15846
|
}
|
|
15847
15847
|
var key = byteToString([0x36, 0x31, 0x33, 0x30, 0x32, 0x32, 0x32, 0x32, 0x32]);
|
|
15848
|
+
// 加密算法
|
|
15849
|
+
function encrypt(dataString) {
|
|
15850
|
+
// ENC加密
|
|
15851
|
+
var keyHex = CryptoJS.enc.Utf8.parse(key);
|
|
15852
|
+
var encrypted = CryptoJS.DES.encrypt(dataString, keyHex, {
|
|
15853
|
+
mode: CryptoJS.mode.ECB,
|
|
15854
|
+
padding: CryptoJS.pad.Pkcs7
|
|
15855
|
+
});
|
|
15856
|
+
// base64加密
|
|
15857
|
+
var base64 = encrypted.ciphertext.toString(CryptoJS.enc.Base64);
|
|
15858
|
+
return base64;
|
|
15859
|
+
}
|
|
15848
15860
|
// 解密算法
|
|
15849
15861
|
function decrypt(base64) {
|
|
15850
15862
|
// base64解密
|
|
@@ -70465,4 +70477,4 @@ var SPUWebPlugin = {
|
|
|
70465
70477
|
version: version
|
|
70466
70478
|
};
|
|
70467
70479
|
|
|
70468
|
-
export { AMapLoader, Module, normalAxios$1 as apaasAxios, normalAxios$1 as axios, checkLogin, index as components, SPUWebPlugin as default, downloadService, expandexp, functionCheck, getAddress, getCloudServ, getDistance, getLocation, getRefreshToken, getServToken, getServerTime, getToken, getTokenExpires, getUniqueid, getUser, v4 as getUuid, globalConfig, globalOptions, isInApp, isdebugger, isvirtuallocation, lsProxy, mapService, setRefreshToken, setTitle, setToken, setTokenExpires, singleLogin, spuAxios, spuConfig, ssProxy, updateToken, uploadService, wxworkSuite };
|
|
70480
|
+
export { AMapLoader, Module, normalAxios$1 as apaasAxios, normalAxios$1 as axios, checkLogin, index as components, decrypt, normalizeEncryData as decryptAxiosResponseData, SPUWebPlugin as default, downloadService, encrypt, expandexp, functionCheck, getAddress, getCloudServ, getDistance, getLocation, getRefreshToken, getServToken, getServerTime, getToken, getTokenExpires, getUniqueid, getUser, v4 as getUuid, globalConfig, globalOptions, isInApp, isdebugger, isvirtuallocation, lsProxy, mapService, setRefreshToken, setTitle, setToken, setTokenExpires, singleLogin, spuAxios, spuConfig, ssProxy, updateToken, uploadService, wxworkSuite };
|
package/package.json
CHANGED
package/src/axios.ts
CHANGED
|
@@ -16,7 +16,7 @@ interface Response {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
// _encrydata
|
|
19
|
-
const normalizeEncryData = (response: any) => {
|
|
19
|
+
export const normalizeEncryData = (response: any) => {
|
|
20
20
|
if (response.data && response.data._encrydata && typeof response.data._encrydata === 'string') {
|
|
21
21
|
let res = decrypt(response.data._encrydata)
|
|
22
22
|
try {
|
|
@@ -236,4 +236,4 @@ function installAxios(options: any) {
|
|
|
236
236
|
normalAxios = createAxiosInstance('normal', options)
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
export { installAxios, spuAxios, normalAxios as axios }
|
|
239
|
+
export { installAxios, spuAxios, normalAxios as axios, normalizeEncryData as decryptAxiosResponseData }
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { merge } from 'lodash-es'
|
|
|
3
3
|
import { v4 as getUuid } from 'uuid'
|
|
4
4
|
import { installStorageProxy, lsProxy, ssProxy } from './storageProxy'
|
|
5
5
|
import { getLocation, getDistance, getAddress } from './map/index'
|
|
6
|
-
import { installAxios, spuAxios, axios } from './axios'
|
|
6
|
+
import { installAxios, spuAxios, axios, decryptAxiosResponseData } from './axios'
|
|
7
7
|
import { installSpuConfig, spuConfig } from './spuConfig'
|
|
8
8
|
import { globalConfig } from './globalConfig'
|
|
9
9
|
import { downloadService, uploadService } from './oss'
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
isvirtuallocation,
|
|
19
19
|
getServerTime
|
|
20
20
|
} from './utils'
|
|
21
|
+
import { encrypt, decrypt } from './crypt'
|
|
21
22
|
import { installUrlquery } from './urlquery'
|
|
22
23
|
import { mapService } from './map/MapService'
|
|
23
24
|
import AMapLoader from './map/AMapLoader'
|
|
@@ -119,6 +120,7 @@ export {
|
|
|
119
120
|
spuAxios,
|
|
120
121
|
axios,
|
|
121
122
|
axios as apaasAxios,
|
|
123
|
+
decryptAxiosResponseData,
|
|
122
124
|
spuConfig,
|
|
123
125
|
globalConfig,
|
|
124
126
|
downloadService,
|
|
@@ -129,6 +131,8 @@ export {
|
|
|
129
131
|
getUuid,
|
|
130
132
|
functionCheck,
|
|
131
133
|
getServerTime,
|
|
134
|
+
encrypt,
|
|
135
|
+
decrypt,
|
|
132
136
|
setTitle,
|
|
133
137
|
isInApp,
|
|
134
138
|
AMapLoader,
|
package/src/types/index.d.ts
CHANGED
|
@@ -113,6 +113,7 @@ export const getAddress: (location: {
|
|
|
113
113
|
export const spuAxios: any
|
|
114
114
|
export const apaasAxios: any
|
|
115
115
|
export const axios: any
|
|
116
|
+
export const decryptAxiosResponseData: any
|
|
116
117
|
export const spuConfig: any
|
|
117
118
|
export const globalConfig: any
|
|
118
119
|
export const downloadService: IDownloadService
|
|
@@ -128,6 +129,8 @@ export const getUniqueid: () => string
|
|
|
128
129
|
export const getUuid: () => string
|
|
129
130
|
export const functionCheck: (functioncode?: string) => boolean
|
|
130
131
|
export const getServerTime: () => Promise<string>
|
|
132
|
+
export const encrypt: (str: string) => string
|
|
133
|
+
export const decrypt: (str: string) => string
|
|
131
134
|
export const setTitle: (pagetitle?: string) => void
|
|
132
135
|
export const isInApp: () => boolean
|
|
133
136
|
export const AMapLoader: IAMapLoader
|