예제 #1
0
        private void initEditorUploadPath( MvcContext ctx )
        {
            if (ctx.viewer.IsLogin) {

                Link lnk = new Link( ctx );
                // 此处使用onwer,避免二级域名下的跨域问题
                ctx.SetItem( "editorUploadUrl", lnk.To( ctx.owner.obj, "Users/UserUpload", "UploadForm", -1, -1 ) );
                ctx.SetItem( "editorMyPicsUrl", lnk.To( ctx.owner.obj, "Users/UserUpload", "MyPics", -1, -1 ) );
            }
        }
예제 #2
0
 /// <summary>
 /// 跳转页面到指定 action
 /// </summary>
 /// <param name="action"></param>
 /// <param name="id"></param>
 public void redirect(string action, long id)
 {
     redirectUrl(Link.To(ctx.owner.obj, LinkHelper.GetControllerName(base.GetType()), action, id));
 }
예제 #3
0
 /// <summary>
 /// 跳转页面到指定 action
 /// </summary>
 /// <param name="action"></param>
 public void redirect(aAction action)
 {
     redirectUrl(Link.To(action));
 }
예제 #4
0
파일: CtxLink.cs 프로젝트: zhdwwf/wojilu
 public String T2(aActionWithId action, int id)
 {
     return(Link.To(_owner, getController(action.Target.GetType()), action.Method.Name, id, 0));
 }
예제 #5
0
파일: CtxLink.cs 프로젝트: zhdwwf/wojilu
        //---------------------------------------------------------------------------

        public String T2(aAction action)
        {
            return(Link.To(_owner, getController(action.Target.GetType()), action.Method.Name, 0, 0));
        }
예제 #6
0
파일: CtxLink.cs 프로젝트: zhdwwf/wojilu
 public String To(aAction action, int appId)
 {
     return(Link.To(_owner, getController(action.Target.GetType()), action.Method.Name, -1, appId));
 }
예제 #7
0
        //-------------------------------- viewer ----------------------------------
        public void InitViewer( MvcContext ctx )
        {
            ctx.setCacheCondition( new CacheCondition() );

            CurrentRequest.setItem( "_user_factory", new UserFactory() );

            User user = this.getViewer( ctx );

            if (user.Id == UserFactory.Guest.Id && ctx.web.UserIsLogin) {
                signOut( ctx );
                return;
            }
            else if (user.Status == MemberStatus.Deleted || user.Status == MemberStatus.Approving) {
                signOut( ctx );
                return;
            }

            if (ctx.web.UserIsLogin) loginService.UpdateLastLogin( user, ctx.Ip );

            ViewerContext context = new ViewerContext();
            context.Id = user.Id;
            context.obj = user;
            context.IsLogin = ctx.web.UserIsLogin;
            ctx.utils.setViewerContext( context );

            // 编辑器
            if (context.IsLogin) {
                Link lnk = new Link( ctx );
                ctx.SetItem( "editorUploadUrl", lnk.To( user, "Users/Admin/UserUpload", "UploadForm", -1, -1 ) );
                ctx.SetItem( "editorMyPicsUrl", lnk.To( user, "Users/Admin/UserUpload", "MyPics", -1, -1 ) );
            }
        }
예제 #8
0
파일: CtxLink.cs 프로젝트: zuhuizou/wojilu
 public String To(aActionWithId action, long id, long appId)
 {
     return(Link.To(_owner, getController(action.Target.GetType()), action.Method.Name, id, appId));
 }