@smart100/spu-web-plugin 0.0.22 → 0.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/spu-web-plugin.mjs +17 -2
- package/package.json +1 -1
- package/src/index.ts +5 -2
- package/src/utils.ts +8 -8
package/dist/spu-web-plugin.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var version = "0.0.
|
|
1
|
+
var version = "0.0.23";
|
|
2
2
|
|
|
3
3
|
function _iterableToArrayLimit(r, l) {
|
|
4
4
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
@@ -59250,6 +59250,18 @@ var uploadService = {
|
|
|
59250
59250
|
upload: upload
|
|
59251
59251
|
};
|
|
59252
59252
|
|
|
59253
|
+
// 是否企微软件内 包括电脑端和APP端
|
|
59254
|
+
var isWxwork = function isWxwork() {
|
|
59255
|
+
return navigator.userAgent.indexOf('wxwork') >= 0;
|
|
59256
|
+
};
|
|
59257
|
+
// 是否在电脑端企微软件内
|
|
59258
|
+
var isWxworkPc = function isWxworkPc() {
|
|
59259
|
+
return isWxwork() && navigator.userAgent.indexOf('Mobile') === -1;
|
|
59260
|
+
};
|
|
59261
|
+
// 是否在企微APP内
|
|
59262
|
+
var isWxworkApp = function isWxworkApp() {
|
|
59263
|
+
return isWxwork() && navigator.userAgent.indexOf('Mobile') >= 0;
|
|
59264
|
+
};
|
|
59253
59265
|
// 生成唯一id
|
|
59254
59266
|
var getUniqueid = function getUniqueid() {
|
|
59255
59267
|
var random = Math.ceil(Math.random() * 100000);
|
|
@@ -60251,7 +60263,10 @@ var getUser = login.getUser.bind(login);
|
|
|
60251
60263
|
var checkLogin = login.checkLogin.bind(login);
|
|
60252
60264
|
var wxworkSuite = {
|
|
60253
60265
|
JSSDK: jssdk,
|
|
60254
|
-
isWxworkSuiteTenant: jssdk.checkData
|
|
60266
|
+
isWxworkSuiteTenant: jssdk.checkData,
|
|
60267
|
+
isWxwork: isWxwork,
|
|
60268
|
+
isWxworkPc: isWxworkPc,
|
|
60269
|
+
isWxworkApp: isWxworkApp
|
|
60255
60270
|
};
|
|
60256
60271
|
|
|
60257
60272
|
export { AMapLoader, Module, apaasAxios$1 as apaasAxios, checkLogin, index as components, SPUWebPlugin as default, downloadService, expandexp, functionCheck, getDistance, getLocation, getRefreshToken, getToken, getTokenExpires, getUniqueid, getUser, v4 as getUuid, lsProxy, spuAxios, spuConfig, ssProxy, uploadService, wxworkSuite };
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { getLocation, getDistance } from './location'
|
|
|
5
5
|
import { spuAxios, apaasAxios } from './axios'
|
|
6
6
|
import { spuConfig } from './spuConfig'
|
|
7
7
|
import { downloadService, uploadService } from './oss'
|
|
8
|
-
import { getUniqueid, functionCheck } from './utils'
|
|
8
|
+
import { getUniqueid, functionCheck, isWxwork, isWxworkPc, isWxworkApp } from './utils'
|
|
9
9
|
import AMapLoader from './AMapLoader'
|
|
10
10
|
import login from './login'
|
|
11
11
|
import { v4 as getUuid } from 'uuid'
|
|
@@ -34,7 +34,10 @@ const getUser = login.getUser.bind(login)
|
|
|
34
34
|
const checkLogin = login.checkLogin.bind(login)
|
|
35
35
|
const wxworkSuite = {
|
|
36
36
|
JSSDK: jssdk,
|
|
37
|
-
isWxworkSuiteTenant: jssdk.checkData
|
|
37
|
+
isWxworkSuiteTenant: jssdk.checkData,
|
|
38
|
+
isWxwork,
|
|
39
|
+
isWxworkPc,
|
|
40
|
+
isWxworkApp
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
export {
|
package/src/utils.ts
CHANGED
|
@@ -6,18 +6,18 @@ const isIOS = () => {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
// 是否企微软件内 包括电脑端和APP端
|
|
9
|
-
const
|
|
9
|
+
const isWxwork = () => {
|
|
10
10
|
return navigator.userAgent.indexOf('wxwork') >= 0
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
// 是否在电脑端企微软件内
|
|
14
|
-
const
|
|
15
|
-
return
|
|
14
|
+
const isWxworkPc = () => {
|
|
15
|
+
return isWxwork() && navigator.userAgent.indexOf('Mobile') === -1
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
// 是否在企微APP内
|
|
19
|
-
const
|
|
20
|
-
return
|
|
19
|
+
const isWxworkApp = () => {
|
|
20
|
+
return isWxwork() && navigator.userAgent.indexOf('Mobile') >= 0
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// 生成唯一id
|
|
@@ -40,9 +40,9 @@ const functionCheck = (functioncode?: string): boolean => {
|
|
|
40
40
|
|
|
41
41
|
export {
|
|
42
42
|
isIOS,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
isWxwork,
|
|
44
|
+
isWxworkPc,
|
|
45
|
+
isWxworkApp,
|
|
46
46
|
getUniqueid,
|
|
47
47
|
functionCheck
|
|
48
48
|
}
|