|
|
@@ -10,12 +10,16 @@ export function getClientURL(value: string, origin?: string) {
|
|
|
}
|
|
|
|
|
|
export function isFrameOpen() {
|
|
|
- return window.parent !== window
|
|
|
+ return window.parent !== window;
|
|
|
}
|
|
|
|
|
|
export function isWechat() {
|
|
|
- const userAgent = navigator.userAgent;
|
|
|
- return userAgent.indexOf('miniprogram') > -1 && ( userAgent.indexOf('wx') || userAgent.indexOf('wechat') );
|
|
|
+ const userAgent = navigator.userAgent.toLowerCase();
|
|
|
+ return userAgent.includes('wx') || userAgent.includes('wechat') || userAgent.includes('micromessenger');
|
|
|
+}
|
|
|
+
|
|
|
+export function isWechatMiniprogram() {
|
|
|
+ return isWechat() && navigator.userAgent.toLowerCase().includes('miniprogram');
|
|
|
}
|
|
|
|
|
|
export function getBackReferrerUrl() {
|