Пример #1
0
        public void TmcUserCancel()
        {
            var user = UserManager.FindByName(Context.User.Identity.Name);

            //除此之外没有其他活动连接时就关掉消息
            if (!user.Connections.Any(x => x.Connected && x.ConnectionID != Context.ConnectionId))
            {
                TopManager.TmcUserCancel(user.TaoOAuth.taobao_user_nick);
            }
        }
Пример #2
0
        public void Configuration(IAppBuilder app)
        {
            ConfigureAuth(app);
            app.UseCors(CorsOptions.AllowAll);

            InitializeAppEnvironment();
            InitializeSignalRConnState();

            //GlobalHost.DependencyResolver.UseSqlServer(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());
            var hubConfiguration = new HubConfiguration();

            hubConfiguration.EnableDetailedErrors    = true;
            hubConfiguration.EnableJavaScriptProxies = false;
            app.MapSignalR("/signalr", hubConfiguration);
            //var hub = GlobalHost.ConnectionManager.GetHubContext<MessageHub>();
            TopManager.Initialize(new TopManager.ApiServiceAccount(AppKey, AppSecret));
        }
Пример #3
0
        public ApiResult TmcGroupAddThenTmcUserPermit()
        {
            var user = UserManager.FindByName(Context.User.Identity.Name);

            return(TopManager.TmcUserPermitThenTmcGroupAdd(user.TaoOAuth.taobao_user_nick, user.TaoOAuth.access_token));
        }