@jx3box/jx3box-common 8.7.4 → 8.7.5
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/js/utils.js +9 -0
- package/package.json +1 -1
package/js/utils.js
CHANGED
|
@@ -415,6 +415,15 @@ export function isMiniProgram() {
|
|
|
415
415
|
return navigator.userAgent.toLowerCase().includes("miniprogram");
|
|
416
416
|
}
|
|
417
417
|
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* 判断当前环境是否为app
|
|
421
|
+
* 判断url是否包含__env=app
|
|
422
|
+
*/
|
|
423
|
+
export function isApp() {
|
|
424
|
+
return new URLSearchParams(window.location.search).get("__env") === "app";
|
|
425
|
+
}
|
|
426
|
+
|
|
418
427
|
export function miniprogramHack() {
|
|
419
428
|
document.addEventListener('DOMContentLoaded', function() {
|
|
420
429
|
// 检查 html 标签是否有 wechat-miniprogram 类
|