wl-design-mobile 0.5.6 → 0.5.8

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.
Files changed (2) hide show
  1. package/package.json +31 -33
  2. package/util/jssdk.js +22 -13
package/package.json CHANGED
@@ -1,33 +1,31 @@
1
- {
2
- "name": "wl-design-mobile",
3
- "version": "0.5.6",
4
- "description": "",
5
- "main": "index.js",
6
- "scripts": {
7
- "publish": "pnpm publish --access public --no-git-checks"
8
- },
9
- "author": "finch",
10
- "license": "ISC",
11
- "publishConfig": {
12
- "access": "public",
13
- "registry": "https://registry.npmjs.org/",
14
- "files": [
15
- "!**/.*",
16
- "!**/CHANGELOG.md",
17
- "**/*"
18
- ]
19
- },
20
- "dependencies": {
21
- "core-js": "^3.8.3",
22
- "vant": "^2.13.2",
23
- "vue-router": "^3.0.5",
24
- "moment": "^2.30.1",
25
- "axios": "^1.7.2",
26
- "dingtalk-jsapi": "^3.0.12",
27
- "weixin-js-sdk": "^1.6.5",
28
- "@wecom/jssdk": "^1.4.5"
29
- },
30
- "devDependencies": {
31
- "vue": "^2.6.14"
32
- }
33
- }
1
+ {
2
+ "name": "wl-design-mobile",
3
+ "version": "0.5.8",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "author": "finch",
7
+ "license": "ISC",
8
+ "publishConfig": {
9
+ "access": "public",
10
+ "registry": "https://registry.npmjs.org/",
11
+ "files": [
12
+ "!**/.*",
13
+ "!**/CHANGELOG.md",
14
+ "**/*"
15
+ ]
16
+ },
17
+ "dependencies": {
18
+ "core-js": "^3.8.3",
19
+ "vant": "^2.13.2",
20
+ "vue-router": "^3.0.5",
21
+ "moment": "^2.30.1",
22
+ "axios": "1.6.7",
23
+ "dingtalk-jsapi": "^3.0.12",
24
+ "weixin-js-sdk": "^1.6.5",
25
+ "@wecom/jssdk": "^1.4.5"
26
+ },
27
+ "devDependencies": {
28
+ "vue": "^2.6.14"
29
+ },
30
+ "scripts": {}
31
+ }
package/util/jssdk.js CHANGED
@@ -58,23 +58,32 @@ function getAppType() {
58
58
  return ''
59
59
  }
60
60
 
61
- function getCurrentUrl() {
62
- // iOS 14+需要特殊处理
63
- if (isIOS14Plus()) {
64
- return window.location.origin +
65
- window.location.pathname +
66
- window.location.search
61
+ /**
62
+ * 判断ios系统版本号是否大于14
63
+ * @returns {boolean}
64
+ */
65
+ const isIos14AndMore = () =>{
66
+ // 判断ios手机版本号是否大于14,大于14就拿App.vue存储的url,否则拿当前页面的url
67
+ try {
68
+ const str = navigator.userAgent.toLowerCase()
69
+ const ver = str.match(/cpu iphone os (.*?) like mac os/)
70
+ if (!ver) {
71
+ return false
72
+ } else {
73
+ return Number(ver[1].split('_')[0]) >= 14
74
+ }
75
+ } catch (e) {
76
+ console.log('isIos14AndMore', e)
77
+ return false
67
78
  }
68
- return window.location.href.split('#')[0]
69
- }
70
-
71
- function isIOS14Plus() {
72
- const os = navigator.userAgent
73
- return /iPhone OS 1[4-9]/.test(os) || /iPhone OS [2-9]\d/.test(os)
74
79
  }
75
80
 
76
81
  function getJsConfig(){
77
- let url = getCurrentUrl()
82
+ let url = window.location.href.split('#')[0].toString();
83
+ if (isIos14AndMore()) {
84
+ console.log('isIos14AndMore true')
85
+ url = sessionStorage.getItem('ios14ConfigUrl')
86
+ }
78
87
  return new Promise((resolve, reject)=>{
79
88
  axios.post(config.platformServerContext + '/api/weixin/getJsConfig', {
80
89
  appType: getAppType(),