Пример #1
0
 public JsonResult AddOrUpdate(WX_ApiConfig config)
 {
     try
     {
         config.Domain = config.Domain.TrimEnd('/');
         bool result = WXApiConfigServices.AddOrUpdate(config);
         if (!result)
         {
             throw new MyException("保存配置失败");
         }
         return(Json(MyResult.Success()));
     }
     catch (MyException ex)
     {
         return(Json(MyResult.Error(ex.Message)));
     }
     catch (Exception ex)
     {
         ExceptionsServices.AddExceptions(ex, "保存微信API配置信息失败");
         return(Json(MyResult.Error("保存失败")));
     }
 }