@zfqh/uniapp 0.2.17 → 0.2.19
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/modules/dict.js +1 -1
- package/lib/utils/update.d.ts +2 -2
- package/lib/utils/update.js +16 -17
- 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.2.19](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.18...@zfqh/uniapp@0.2.19) (2026-06-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @zfqh/uniapp
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.2.18](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.17...@zfqh/uniapp@0.2.18) (2026-06-25)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @zfqh/uniapp
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [0.2.17](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.16...@zfqh/uniapp@0.2.17) (2026-06-25)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @zfqh/uniapp
|
package/lib/modules/dict.js
CHANGED
|
@@ -16,7 +16,7 @@ const store = {
|
|
|
16
16
|
try {
|
|
17
17
|
const { name, cache } = params;
|
|
18
18
|
if (name && (!cache || (cache && !state.info[name]))) {
|
|
19
|
-
const e = await getDictData({ type: name });
|
|
19
|
+
const e = await getDictData({ type: name }, { custom: { message: false } });
|
|
20
20
|
const enums = {};
|
|
21
21
|
const values = [];
|
|
22
22
|
const labels = [];
|
package/lib/utils/update.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface VersionInfo {
|
|
|
7
7
|
fileUrl: string;
|
|
8
8
|
}
|
|
9
9
|
export interface InstallOptions {
|
|
10
|
-
|
|
10
|
+
appId: string;
|
|
11
11
|
url: string;
|
|
12
12
|
progress?: (p: number) => void;
|
|
13
13
|
success?: () => void;
|
|
@@ -15,6 +15,6 @@ export interface InstallOptions {
|
|
|
15
15
|
message: string;
|
|
16
16
|
}) => void;
|
|
17
17
|
}
|
|
18
|
-
export declare function checkVersion(
|
|
18
|
+
export declare function checkVersion(appId: string): Promise<VersionInfo | null>;
|
|
19
19
|
export declare function installUpdate(options: InstallOptions): void;
|
|
20
20
|
export declare function restartApp(): void;
|
package/lib/utils/update.js
CHANGED
|
@@ -7,13 +7,13 @@ import { getLastVersion } from '../apis/core';
|
|
|
7
7
|
const { platform, brand } = SYSTEM_INFO;
|
|
8
8
|
let _installMessageHandler = null;
|
|
9
9
|
// #ifdef APP
|
|
10
|
-
function appGetProperty(
|
|
10
|
+
function appGetProperty(appId) {
|
|
11
11
|
return new Promise((resolve) => {
|
|
12
|
-
if (
|
|
12
|
+
if (appId === app.appId) {
|
|
13
13
|
plus.runtime.getProperty(String(plus.runtime.appid), (res) => resolve(res));
|
|
14
14
|
}
|
|
15
15
|
else {
|
|
16
|
-
plus.io.resolveLocalFileSystemURL(`_doc/${
|
|
16
|
+
plus.io.resolveLocalFileSystemURL(`_doc/${appId}/manifest.json`, (entry) => {
|
|
17
17
|
entry.file((file) => {
|
|
18
18
|
const reader = new plus.io.FileReader();
|
|
19
19
|
reader.onloadend = (e) => {
|
|
@@ -32,28 +32,27 @@ function appGetProperty(appid) {
|
|
|
32
32
|
}
|
|
33
33
|
// #endif
|
|
34
34
|
// #ifdef H5
|
|
35
|
-
function h5GetProperty(
|
|
35
|
+
function h5GetProperty(appId) {
|
|
36
36
|
return new Promise((resolve) => {
|
|
37
|
-
if (
|
|
37
|
+
if (appId === app.appId) {
|
|
38
38
|
resolve({ version: ver.name, versionCode: ver.code });
|
|
39
39
|
}
|
|
40
40
|
else if (window.electron) {
|
|
41
|
-
window.electron.webUtils.getProperty(
|
|
41
|
+
window.electron.webUtils.getProperty(appId, (manifest) => resolve(manifest || {}));
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
// #endif
|
|
46
|
-
export async function checkVersion(
|
|
46
|
+
export async function checkVersion(appId) {
|
|
47
47
|
try {
|
|
48
48
|
let version = 0;
|
|
49
|
-
let packageName = appid;
|
|
50
49
|
let data = null;
|
|
51
50
|
// #ifdef APP
|
|
52
|
-
data = await appGetProperty(
|
|
51
|
+
data = await appGetProperty(appId);
|
|
53
52
|
version = data.versionCode || 0;
|
|
54
53
|
// #endif
|
|
55
54
|
// #ifdef H5
|
|
56
|
-
data = await h5GetProperty(
|
|
55
|
+
data = await h5GetProperty(appId);
|
|
57
56
|
version = data.versionCode || 0;
|
|
58
57
|
// #endif
|
|
59
58
|
let type = 1;
|
|
@@ -64,20 +63,20 @@ export async function checkVersion(appid) {
|
|
|
64
63
|
// #endif
|
|
65
64
|
const res = await getLastVersion({
|
|
66
65
|
version,
|
|
67
|
-
|
|
66
|
+
appId,
|
|
68
67
|
type,
|
|
69
68
|
platform: { android: 1, ios: 2, windows: 4 }[platform],
|
|
70
|
-
});
|
|
69
|
+
}, { custom: { message: false } });
|
|
71
70
|
const lastVer = { ...res?.data };
|
|
72
71
|
// #ifdef APP
|
|
73
|
-
if (uni.$store
|
|
72
|
+
if (uni.$store?.state?.dict && platform === 'android' && appId === app.appId && env.key === 'prod') {
|
|
74
73
|
await uni.$store.dispatch('getDictInfo', { name: 'group_relation', cache: true });
|
|
75
74
|
if (uni.$store.state.dict.info.group_relation?.values?.includes(brand)) {
|
|
76
75
|
lastVer.hotUpdateUrl = '';
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
78
|
// #endif
|
|
80
|
-
if (
|
|
79
|
+
if (Number(lastVer.version) > Number(version)) {
|
|
81
80
|
return lastVer;
|
|
82
81
|
}
|
|
83
82
|
return null;
|
|
@@ -87,14 +86,14 @@ export async function checkVersion(appid) {
|
|
|
87
86
|
}
|
|
88
87
|
}
|
|
89
88
|
// #ifdef APP
|
|
90
|
-
function appInstall({
|
|
89
|
+
function appInstall({ appId, url, progress, success, fail }) {
|
|
91
90
|
const downloadTask = uni.downloadFile({
|
|
92
91
|
url,
|
|
93
92
|
success(res) {
|
|
94
93
|
if (res.statusCode !== 200)
|
|
95
94
|
return fail?.({ message: 'download failed' });
|
|
96
95
|
progress?.(100);
|
|
97
|
-
if (
|
|
96
|
+
if (appId === app.appId) {
|
|
98
97
|
plus.runtime.install(res.tempFilePath, { force: true }, success, fail);
|
|
99
98
|
}
|
|
100
99
|
else {
|
|
@@ -116,7 +115,7 @@ function h5Install(options) {
|
|
|
116
115
|
postMessage({
|
|
117
116
|
type: TYPES.MESSAGE.APP_INSTALL,
|
|
118
117
|
payload: {
|
|
119
|
-
|
|
118
|
+
appId: options.appId,
|
|
120
119
|
url: options.url,
|
|
121
120
|
},
|
|
122
121
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zfqh/uniapp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
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": "5c4b549af6bc65943179fb99ec1fb7e2641cd610"
|
|
50
50
|
}
|