Skip to content

Sync #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions APIJSON.NET/APIJSON.NET/APIJSON.NET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@

<ItemGroup>
<PackageReference Include="AspectCore.Extensions.Reflection" Version="1.2.0" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.3" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.4" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Https" Version="2.2.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
<PackageReference Include="MySql.Data" Version="8.0.15" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="2.18.5" />
<PackageReference Include="SqlKata" Version="1.1.7" />
<PackageReference Include="SqlKata.Execution" Version="1.1.7" />
<PackageReference Include="sqlSugarCore" Version="4.9.9.2" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="2.18.6" />
<PackageReference Include="sqlSugarCore" Version="4.9.9.6" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="4.0.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="4.0.1" />
Expand Down
21 changes: 7 additions & 14 deletions APIJSON.NET/APIJSON.NET/Controllers/JsonController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,13 @@ public JsonController(SelectTable _selectTable, DbContext _db,IIdentityService i
/// <returns></returns>
[HttpPost("/get")]

public ActionResult Query([FromBody]string json)
public ActionResult Query([FromBody] JObject jobject)
{
json = HttpUtility.UrlDecode(json);
JObject ht = new JObject();
ht.Add("code", "200");
ht.Add("msg", "success");
try
{
JObject jobject = JObject.Parse(json);
int page = 0, count = 0, query = 0, total = 0;
foreach (var item in jobject)
{
Expand Down Expand Up @@ -178,16 +176,16 @@ public ActionResult Query([FromBody]string json)
/// <param name="json"></param>
/// <returns></returns>
[HttpPost("/add")]
public ActionResult Add([FromBody]string json)
public ActionResult Add([FromBody]JObject jobject)
{
json = HttpUtility.UrlDecode(json);

JObject ht = new JObject();
ht.Add("code", "200");
ht.Add("msg", "success");
try
{
JObject jobject = JObject.Parse(json);
var sb = new System.Text.StringBuilder(100);



foreach (var item in jobject)
{
Expand Down Expand Up @@ -222,16 +220,13 @@ public ActionResult Add([FromBody]string json)
/// <param name="json"></param>
/// <returns></returns>
[HttpPost("/edit")]
public ActionResult Edit([FromBody]string json)
public ActionResult Edit([FromBody]JObject jobject)
{
json = HttpUtility.UrlDecode(json);
JObject ht = new JObject();
ht.Add("code", "200");
ht.Add("msg", "success");
try
{
JObject jobject = JObject.Parse(json);

foreach (var item in jobject)
{
string key = item.Key.Trim();
Expand Down Expand Up @@ -276,16 +271,14 @@ public ActionResult Edit([FromBody]string json)
/// <param name="json"></param>
/// <returns></returns>
[HttpPost("/remove")]
public ActionResult Remove([FromBody]string json)
public ActionResult Remove([FromBody]JObject jobject)
{
json = HttpUtility.UrlDecode(json);
JObject ht = new JObject();
ht.Add("code", "200");
ht.Add("msg", "success");
try
{
var role = _identitySvc.GetRole();
JObject jobject = JObject.Parse(json);
foreach (var item in jobject)
{
string key = item.Key.Trim();
Expand Down
3 changes: 0 additions & 3 deletions APIJSON.NET/APIJSON.NET/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Tokens;
using SqlKata.Execution;
using Swashbuckle.AspNetCore.Swagger;
using MySql.Data.MySqlClient;
using SqlKata.Compilers;

public class Startup
{
Expand Down
2 changes: 1 addition & 1 deletion APIJSON.NET/APIJSON.NET/wwwroot/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
url: $('#rest-url').val(),
type: "POST", dataType: "json",
contentType: "application/json;charset=utf-8",
data: JSON.stringify($('#vInput').val()),
data: $('#vInput').val(),
success: function (data) {

App.jsonhtml = data;
Expand Down