コード例 #1
0
        public virtual void Init(MvcContext ctx)
        {
            if (ctx.utils.isEnd())
            {
                return;
            }

            initPrivate(ctx);

            if (ctx.app.obj != null)
            {
                // 检查app是否停用
                Type         appType   = ctx.app.obj.GetType();
                AppInstaller installer = new AppInstallerService().GetByType(appType);
                if (installer == null || installer.IsInstanceClose(ctx.owner.obj.GetType()))
                {
                    ctx.utils.endMsg("对不起,本app已经停用", HttpStatus.NotFound_404);
                    return;
                }

                if (InitHelperFactory.GetHelper(ctx).IsAppRunning(ctx) == false)       // 检查app是否属于暂停状态
                {
                    ctx.utils.endMsg(lang.get("exAppNotFound") + ": appType=" + appType + ", appId=" + ctx.app.Id, HttpStatus.NotFound_404);
                }
            }
        }
コード例 #2
0
ファイル: AppInit.cs プロジェクト: xia7410/cnblogsbywojilu
        public void Init(MvcContext ctx)
        {
            if (ctx.utils.isEnd())
            {
                return;
            }

            initPrivate(ctx);

            if (ctx.app.obj != null)
            {
                // 检查app是否停用
                Type         appType   = ctx.app.obj.GetType();
                AppInstaller installer = new AppInstallerService().GetByType(appType);
                if (installer == null || installer.IsInstanceClose(ctx.owner.obj.GetType()))
                {
                    ctx.utils.endMsg("对不起,本app已经停用", HttpStatus.NotFound_404);
                    return;
                }


                InitHelperFactory.GetHelper(ctx).IsAppRunning(ctx);     // 检查app是否属于暂停状态
            }
        }