Comparing version 0.0.21 to 0.0.22
@@ -221,23 +221,53 @@ (function (global, factory) { | ||
// import jbridge from './modules/jbridge/index' | ||
/** | ||
* 登录 | ||
*/ | ||
function bridgeToLogin({ webviewUrl, miniUrl }) { | ||
const url = webviewUrl || location.href; | ||
function init(config) { | ||
if (this.isApp) { | ||
jwebview.initJwebview.apply(this); | ||
console.log(platform); | ||
if (platform.isIOS) { | ||
if (window.webkit && window.webkit.messageHandlers) { | ||
window.webkit.messageHandlers.iOSLoginIn.postMessage(''); | ||
} | ||
return | ||
} | ||
if (this.isWechat) { | ||
jweixin.initJweixin.apply(this, [config]); | ||
if (platform.isAndroid) { | ||
uni.postMessage({ | ||
data: { | ||
action: 'toLogin', | ||
data: {}, | ||
}, | ||
}); | ||
return | ||
} | ||
// console.log(jbridge) | ||
// jbridge.initJbridge.apply(this) | ||
if (platform.isMiniprogram) { | ||
const _url = miniUrl | ||
? `/packageUser/pages/login?redirect=${encodeURIComponent(miniUrl)}` | ||
: `/packageUser/pages/login?webview=${encodeURIComponent(url)}`; | ||
wx.miniProgram.redirectTo({ url: _url }); | ||
return | ||
} | ||
// location.href = | ||
// import.meta.env.MODE === 'production' | ||
// ? `https://m.xfb315.com/login?isto=${url}` | ||
// : `https://m.test.xfb315.com/login?isto=${url}` | ||
location.href = `https://m.test.xfb315.com/login?isto=${url}`; | ||
} | ||
var jbridge = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
bridgeToLogin: bridgeToLogin | ||
}); | ||
console.log(jbridge); | ||
var main = { | ||
init, | ||
...platform, | ||
...jweixin, | ||
...jwebview, | ||
// ...jbridge, | ||
...jbridge, | ||
}; | ||
@@ -244,0 +274,0 @@ |
{ | ||
"name": "xfb-sdk", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"author": "wangfei", | ||
@@ -5,0 +5,0 @@ "description": "", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8470
242