interceptors.min.js
1.62 KB
!function(e){e.baseInterceptor=function(){}}(gxb.interceptors),function(e){e.registerNamespace("gxb.interceptors.security")}(gxb.components),function(e){e.security.authorizationInterceptor=function(e){return{request:function(e){var t=window.location.pathname,n=gxb.settings.env.getContextPath(),i=n,r=n+"/admin",o=n+"/console",s="#/user",g="#/mgrentry",c=(0==t.indexOf(i),0==t.indexOf(r)),a=0==t.indexOf(o),u=gxb.settings.identifier.hasTenantAdminRole(),f=gxb.settings.identifier.hasSuperAdminRole(),b=gxb.settings.identifier.getUserID()||"";return a?b?f||gxb.settings.identifier.hasAnyYYRole()||gxb.settings.identifier.hasAnyKHRole()||gxb.settings.identifier.hasPlatformAdminRole()||gxb.settings.identifier.goPage401():gxb.settings.identifier.goLoginUrl():c?b?u||f||gxb.settings.identifier.goPage401():gxb.settings.identifier.goLoginUrl():((window.location.hash||"").indexOf(s)>=0||(window.location.hash||"").indexOf(g)>=0)&&(b||gxb.settings.identifier.goLoginUrl()),e},response:function(e){return e},requestError:function(){},responseError:function(){}}},e.inheritFromInterceptor(e.security.authorizationInterceptor),e.registerDependency("gxb.interceptors.security.authorizationInterceptor",["$q","$location"])}(gxb.interceptors),function(e){var t=e.interceptors,n=e.utils,i="gxb.interceptors",r="",o=[],s=function(e,i){n.objectUtils.isObjectOnly(e)||(e=o.pop()),o.length&&n.objectUtils.getKeys(e,function(e,r){var g=i+"."+r;n.objectUtils.isObjectOnly(e)?(o.push(e),s(e,g)):n.langUtils.isFunction(e)&&t.registerInterceptor(g,t.getDependency(g))})};n.objectUtils.getKeys(t,function(e,t){n.objectUtils.isObjectOnly(e)&&(r=i+"."+t,o.push(e),s(e,r))})}(gxb);