@zfqh/uniapp 0.3.1 → 0.3.3
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/CHANGELOG.md +16 -0
- package/lib/configs/cdn.d.ts +1 -1
- package/lib/configs/cdn.js +4 -1
- package/lib/configs/index.d.ts +1 -1
- package/lib/mixins/webview.js +1 -1
- package/lib/utils/navigate.js +8 -3
- package/lib/utils/pages.js +7 -3
- package/lib/utils/query.d.ts +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.3.3](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.3.2...@zfqh/uniapp@0.3.3) (2026-07-14)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @zfqh/uniapp
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.3.2](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.3.1...@zfqh/uniapp@0.3.2) (2026-07-09)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @zfqh/uniapp
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [0.3.1](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.3.0...@zfqh/uniapp@0.3.1) (2026-07-08)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @zfqh/uniapp
|
package/lib/configs/cdn.d.ts
CHANGED
package/lib/configs/cdn.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import query from '../utils/query';
|
|
1
2
|
/** CDN静态资源配置 */
|
|
2
3
|
const cdn = {
|
|
3
4
|
/** 静态资源路径 */
|
|
@@ -9,6 +10,8 @@ const cdn = {
|
|
|
9
10
|
/** 腾讯COS静态资源路径 */
|
|
10
11
|
cosUrl: '',
|
|
11
12
|
/** 是否启用COS全球加速 */
|
|
12
|
-
isAccelerate
|
|
13
|
+
get isAccelerate() {
|
|
14
|
+
return query.accelerate == 1;
|
|
15
|
+
},
|
|
13
16
|
};
|
|
14
17
|
export default cdn;
|
package/lib/configs/index.d.ts
CHANGED
package/lib/mixins/webview.js
CHANGED
package/lib/utils/navigate.js
CHANGED
|
@@ -5,7 +5,7 @@ import { IS_WEBVIEW_ENV, WEBVIEW_ENV } from './consts';
|
|
|
5
5
|
import { inPages, getPage } from './pages';
|
|
6
6
|
import { joinPath } from './index';
|
|
7
7
|
// 检测协议路径
|
|
8
|
-
const checkProtocolMatch = (url) => url.match(/^(\w+):\//);
|
|
8
|
+
const checkProtocolMatch = (url) => url.match(/^([\w.]+):\//);
|
|
9
9
|
// 转换绝对路径
|
|
10
10
|
const getAbsoUrl = (url, current) => {
|
|
11
11
|
if (!url.startsWith('/') && !checkProtocolMatch(url)) {
|
|
@@ -82,8 +82,13 @@ const navigate = function (url = '', type = 'navigateTo') {
|
|
|
82
82
|
isNative = inPages(page.nativePages, url);
|
|
83
83
|
}
|
|
84
84
|
if (!isNative) {
|
|
85
|
-
if (
|
|
86
|
-
|
|
85
|
+
if (!checkProtocolMatch(url)) {
|
|
86
|
+
if (app?.code) {
|
|
87
|
+
url = `${app.code}:/${url}`;
|
|
88
|
+
}
|
|
89
|
+
else if (app?.appId) {
|
|
90
|
+
url = `${app.appId}:/${url}`;
|
|
91
|
+
}
|
|
87
92
|
}
|
|
88
93
|
}
|
|
89
94
|
else if (IS_WEBVIEW_ENV && opts['native'] === false) {
|
package/lib/utils/pages.js
CHANGED
|
@@ -28,9 +28,10 @@ export const createPages = (original = {}, basePath = '') => {
|
|
|
28
28
|
const nativePages = [];
|
|
29
29
|
const needLoginPages = [];
|
|
30
30
|
const notRedirectPages = [];
|
|
31
|
-
const create = ({ path, root, ...rest }) => {
|
|
32
|
-
if (
|
|
31
|
+
const create = ({ path: p, root, ...rest }) => {
|
|
32
|
+
if (p) {
|
|
33
33
|
const { native, needLogin, notRedirect } = { ...original.global, ...rest };
|
|
34
|
+
const { name } = rest;
|
|
34
35
|
const array = [''];
|
|
35
36
|
if (basePath) {
|
|
36
37
|
array.push(basePath);
|
|
@@ -38,9 +39,12 @@ export const createPages = (original = {}, basePath = '') => {
|
|
|
38
39
|
if (root && basePath !== `/${root}`) {
|
|
39
40
|
array.push(root);
|
|
40
41
|
}
|
|
41
|
-
array.push(
|
|
42
|
+
array.push(p);
|
|
42
43
|
const page = array.join('/').replace(/\/+/, '/');
|
|
43
44
|
pages.push(page);
|
|
45
|
+
if (name) {
|
|
46
|
+
path[name] = page;
|
|
47
|
+
}
|
|
44
48
|
if (native || native == null) {
|
|
45
49
|
nativePages.push(page);
|
|
46
50
|
}
|
package/lib/utils/query.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zfqh/uniapp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "uniapp公共模块",
|
|
5
5
|
"author": "yinjiazeng@163.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"@types/qs": "^6.9.16",
|
|
47
47
|
"@types/url-parse": "^1.4.11"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "35c5484693d21d5f8e01fff8e7e568e433faf3c5"
|
|
50
50
|
}
|