|
|
|
@ -25,7 +25,7 @@ namespace Volo.Abp.Http.ProxyScripting.Generators.JQuery |
|
|
|
|
|
|
|
script.AppendLine("/* This file is automatically generated by ABP framework to use MVC Controllers from javascript. */"); |
|
|
|
script.AppendLine(); |
|
|
|
|
|
|
|
|
|
|
|
foreach (var module in model.Modules.Values) |
|
|
|
{ |
|
|
|
script.AppendLine(); |
|
|
|
@ -99,9 +99,12 @@ namespace Volo.Abp.Http.ProxyScripting.Generators.JQuery |
|
|
|
AddAjaxCallParameters(script, action); |
|
|
|
|
|
|
|
var ajaxParamsIsFromForm = action.Parameters.Any(x => x.BindingSourceId == ParameterBindingSources.Form); |
|
|
|
var dataType = action.ReturnValue.Type == ReturnValueApiDescriptionModel.Create(typeof(string)).Type |
|
|
|
? "{ dataType: 'text' }, " |
|
|
|
: string.Empty; |
|
|
|
script.AppendLine(ajaxParamsIsFromForm |
|
|
|
? " }, $.extend(true, {}, ajaxParams, { contentType: 'application/x-www-form-urlencoded; charset=UTF-8' })));" |
|
|
|
: " }, ajaxParams));"); |
|
|
|
? " }, $.extend(true, {}, " + dataType + "{ contentType: 'application/x-www-form-urlencoded; charset=UTF-8' }, ajaxParams)));" |
|
|
|
: " }, " + dataType + "ajaxParams));"); |
|
|
|
|
|
|
|
script.AppendLine(" };"); |
|
|
|
} |
|
|
|
@ -159,7 +162,7 @@ namespace Volo.Abp.Http.ProxyScripting.Generators.JQuery |
|
|
|
script.Append(" data: " + formData); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
script.AppendLine(); |
|
|
|
} |
|
|
|
|
|
|
|
@ -191,7 +194,7 @@ namespace Volo.Abp.Http.ProxyScripting.Generators.JQuery |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void AddInitializedEventTrigger(StringBuilder script) |
|
|
|
{ |
|
|
|
script.AppendLine(); |
|
|
|
@ -213,4 +216,4 @@ namespace Volo.Abp.Http.ProxyScripting.Generators.JQuery |
|
|
|
return name.Split('.').Select(n => n.ToCamelCase()).JoinAsString("."); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|