Пример #1
0
        /// <summary>
        /// 操作结果(返回json字符串)
        /// </summary>
        /// <returns></returns>
        public static string ToJsonStr(int code, string errMsg, object data)
        {
            var instance = new CommonResult(code, errMsg, data);

            return(jss.Serialize(instance));
        }
Пример #2
0
        /// <summary>
        /// 操作失败(返回json字符串)
        /// </summary>
        /// <returns></returns>
        public static string ToJsonStr(string errMsg)
        {
            var instance = new CommonResult(errMsg);

            return(jss.Serialize(instance));
        }