예제 #1
0
        public static async Task <CodeResultJson> ChangeVisitStatusAsync(string accessToken, ChangVisitStatusAction action, int timeOut = Config.TIME_OUT)
        {
            var url = string.Format(Config.ApiMpHost + "/wxa/change_visitstatus?access_token={0}", accessToken.AsUrlData());

            object data;

            data = new
            {
                action = action.ToString()
            };

            return(await CommonJsonSend.SendAsync <CodeResultJson>(null, url, data, CommonJsonSendType.POST, timeOut));
        }
예제 #2
0
        /// <summary>
        /// 修改小程序线上代码的可见状态
        /// </summary>
        /// <param name="accessToken">从第三方平台获取到的该小程序授权</param>
        /// <param name="action">设置可访问状态,发布后默认可访问,close为不可见,open为可见</param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        public static CodeResultJson ChangeVisitStatus(string accessToken, ChangVisitStatusAction action, int timeOut = Config.TIME_OUT)
        {
            var url = string.Format("https://api.weixin.qq.com/wxa/change_visitstatus?access_token={0}", accessToken.AsUrlData());

            object data;

            data = new
            {
                action = action.ToString()
            };

            return(CommonJsonSend.Send <CodeResultJson>(null, url, data, CommonJsonSendType.POST, timeOut));
        }