提交 84eca846 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

fix: inject all wechaty in browser AFTER angular bootstrap, because wxapp...

fix: inject all wechaty in browser AFTER angular bootstrap, because wxapp check something when bootstrap.
上级 2d778771
......@@ -97,6 +97,12 @@ return (function(port) {
/////////////////////////////////////////////////////////////////////////////
function init() {
if (!angularIsReady()) {
retObj.code = 503 // 503 SERVICE UNAVAILABLE https://httpstatuses.com/503
retObj.message = 'init() without a ready angular env'
return retObj
}
if (!initClog()) { // make console.log work (wxapp disabled the console.log)
retObj.code = 503 // 503 Service Unavailable http://www.restapitutorial.com/httpstatuscodes.html
retObj.message = 'initClog fail'
......@@ -110,12 +116,6 @@ return (function(port) {
return retObj
}
if (!angularIsReady()) {
retObj.code = 503 // 503 SERVICE UNAVAILABLE https://httpstatuses.com/503
retObj.message = 'init() without a ready angular env'
return retObj
}
clog('init on port:' + port)
if (MMCgiLogined()) {
......@@ -225,6 +225,7 @@ return (function(port) {
function MMCgiLogined() { return !!(window.MMCgi && window.MMCgi.isLogin) }
function angularIsReady() {
// don't log insite, because we has not init clog here.
return (
(typeof angular) !== 'undefined'
&& angular.element
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册