浏览代码

1.升级core3

2.升级协议库
3.TextJson的抽象类解不出,暂时采用json.net(有时间研究下)
pull/3/head
SmallChi(Koike) 5 年前
父节点
当前提交
df749439a5
共有 7 个文件被更改,包括 73 次插入67 次删除
  1. +3
    -3
      src/JTTools.Test/JTTools.Test.csproj
  2. +7
    -7
      src/JTTools/JTTools.csproj
  3. +11
    -8
      src/JTTools/Program.cs
  4. +1
    -0
      src/ui/jttools/.eslintignore
  5. +2
    -0
      src/ui/jttools/.eslintrc.js
  6. +46
    -46
      src/ui/jttools/src/App.vue
  7. +3
    -3
      src/ui/jttools/src/main.js

+ 3
- 3
src/JTTools.Test/JTTools.Test.csproj 查看文件

@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>


+ 7
- 7
src/JTTools/JTTools.csproj 查看文件

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>

@@ -11,15 +11,15 @@

<ItemGroup>
<!--<PackageReference Include="JT1078" Version="1.0.0" />-->
<PackageReference Include="JT1078" Version="1.0.1" />
<PackageReference Include="JT808" Version="2.1.7" />
<PackageReference Include="JT808.Protocol.Extensions.JT1078" Version="2.1.7" />
<PackageReference Include="JT1078" Version="1.0.2" />
<PackageReference Include="JT808" Version="2.2.3" />
<PackageReference Include="JT808.Protocol.Extensions.JT1078" Version="2.2.2" />
<PackageReference Include="JT809" Version="2.1.2" />
<PackageReference Include="JT809.Protocol.Extensions.JT1078" Version="2.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="NLog.Extensions.Logging" Version="1.5.4" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="NLog.Extensions.Logging" Version="1.6.1" />
</ItemGroup>

<ItemGroup>


+ 11
- 8
src/JTTools/Program.cs 查看文件

@@ -28,16 +28,19 @@ namespace JTTools
{
services.AddControllers()
//Microsoft.AspNetCore.Mvc.NewtonsoftJson
//.AddNewtonsoftJson(jsonOptions =>
.AddNewtonsoftJson(jsonOptions =>
{
jsonOptions.SerializerSettings.Converters.Add(new ByteArrayHexConverter());
jsonOptions.SerializerSettings.ContractResolver = new DefaultContractResolver();
//jsonOptions.SerializerSettings.Formatting = Newtonsoft.Json.Formatting.Indented;
})
//.AddJsonOptions(jsonOptions =>
//{
// jsonOptions.SerializerSettings.Converters.Add(new ByteArrayHexConverter());
// jsonOptions.SerializerSettings.ContractResolver = new DefaultContractResolver();
// jsonOptions.SerializerSettings.Formatting = Newtonsoft.Json.Formatting.Indented;
// jsonOptions.JsonSerializerOptions.MaxDepth = 64;
// jsonOptions.JsonSerializerOptions.Converters.Add(new ByteArrayHexTextJsonConverter());
//})
.AddJsonOptions(jsonOptions =>
{
jsonOptions.JsonSerializerOptions.Converters.Add(new ByteArrayHexTextJsonConverter());
});
;
services.AddCors(options =>
options.AddPolicy("Domain", builder =>
builder.WithOrigins(hostingContext.Configuration.GetSection("AllowedOrigins").Value.Split(","))


+ 1
- 0
src/ui/jttools/.eslintignore 查看文件

@@ -2,3 +2,4 @@
/config/
/dist/
/*.js
/*.vue

+ 2
- 0
src/ui/jttools/.eslintrc.js 查看文件

@@ -22,6 +22,8 @@ module.exports = {
// add your custom rules here
rules: {
// allow async-await
'eslint-disable':'off',
'eslint-disable-next-line':'off',
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'


+ 46
- 46
src/ui/jttools/src/App.vue 查看文件

@@ -20,7 +20,6 @@
<iframe id="github-star" style="border:none;vertical-align: middle;" width="105" height="20" src="https://ghbtns.com/github-btn.html?user=SmallChi&amp;repo=JTTools&amp;type=watch&amp;count=true"></iframe>

</li>
<!-- <li class="ivu-menu-item">
<a href="update-notes.html">更新日志 </a>
</li>-->
@@ -109,92 +108,93 @@
</div>
<div
class="layout-footer-center ivu-layout-footer"
>Copyright © 2015-2019 SmallChi. All Rights Reserved. 粤ICP备15065376号-1</div>
>Copyright © 2015-2019 SmallChi. All Rights Reserved. 粤ICP备19128140号</div>
</div>
</div>
</div>
</template>

<script>
import axios from 'axios';
import axios from 'axios'
export default {
name: "App",
data() {
name: 'App',
data () {
return {
parse808Parameter: {
HexData: "7E 02 00 00 26 12 34 56 78 90 12 00 7D 02 00 00 00 01 00 00 00 02 00 BA 7F 0E 07 E4 F1 1C 00 28 00 3C 00 00 18 10 15 10 10 10 01 04 00 00 00 64 02 02 00 7D 01 13 7E",
HexData: '7E 02 00 00 26 12 34 56 78 90 12 00 7D 02 00 00 00 01 00 00 00 02 00 BA 7F 0E 07 E4 F1 1C 00 28 00 3C 00 00 18 10 15 10 10 10 01 04 00 00 00 64 02 02 00 7D 01 13 7E'
},
parse809Parameter: {
HexData: "5B 00 00 00 92 00 00 06 82 94 00 01 33 EF B8 01 00 00 00 00 00 27 0F D4 C1 41 31 32 33 34 35 00 00 00 00 00 00 00 00 00 00 00 00 00 02 94 01 00 00 00 5C 01 00 02 00 00 00 00 5A 01 AC 3F 40 12 3F FA A1 00 00 00 00 5A 01 AC 4D 50 03 73 6D 61 6C 6C 63 68 69 00 00 00 00 00 00 00 00 31 32 33 34 35 36 37 38 39 30 31 00 00 00 00 00 00 00 00 00 31 32 33 34 35 36 40 71 71 2E 63 6F 6D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 BA D8 5D",
HexData: '5B 00 00 00 92 00 00 06 82 94 00 01 33 EF B8 01 00 00 00 00 00 27 0F D4 C1 41 31 32 33 34 35 00 00 00 00 00 00 00 00 00 00 00 00 00 02 94 01 00 00 00 5C 01 00 02 00 00 00 00 5A 01 AC 3F 40 12 3F FA A1 00 00 00 00 5A 01 AC 4D 50 03 73 6D 61 6C 6C 63 68 69 00 00 00 00 00 00 00 00 31 32 33 34 35 36 37 38 39 30 31 00 00 00 00 00 00 00 00 00 31 32 33 34 35 36 40 71 71 2E 63 6F 6D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 BA D8 5D'
},
parse1078Parameter: {
HexData: "30 31 63 64 81 E2 10 88 01 12 34 56 78 10 01 10 00 00 01 6B B3 92 CA 7C 02 80 00 28 00 2E 00 00 00 01 61 E1 A2 BF 00 98 CF C0 EE 1E 17 28 34 07 78 8E 39 A4 03 FD DB D1 D5 46 BF B0 63 01 3F 59 AC 34 C9 7A 02 1A B9 6A 28 A4 2C 08",
HexData: '30 31 63 64 81 E2 10 88 01 12 34 56 78 10 01 10 00 00 01 6B B3 92 CA 7C 02 80 00 28 00 2E 00 00 00 01 61 E1 A2 BF 00 98 CF C0 EE 1E 17 28 34 07 78 8E 39 A4 03 FD DB D1 D5 46 BF B0 63 01 3F 59 AC 34 C9 7A 02 1A B9 6A 28 A4 2C 08'
},
parse808ResultObject:{},
parse808Result: "",
parse809Result: "",
parse1078Result: "",
apiUrl: "https://jttools.smallchi.cn/api"
};
parse808ResultObject: {},
parse808Result: '',
parse809Result: '',
parse1078Result: '',
apiUrl: 'https://jttools.smallchi.cn/api'
//apiUrl: 'http://localhost:18888/api'
}
},
mounted: function() {},
mounted () {},
methods: {
parse808Click: function() {
if (!this.parse808Parameter) return;
this.$Loading.start();
parse808Click () {
if (!this.parse808Parameter) return
this.$Loading.start()
axios
.post(this.apiUrl + "/JTTools/Parse808", this.parse808Parameter)
.post(this.apiUrl + '/JTTools/Parse808', this.parse808Parameter)
.then(response => {
if (response.data.Code === 200) {
this.parse808Result = response.data.Data;
this.parse808Result = response.data.Data
} else {
this.parse808Result = response.data.Message;
this.parse808Result = response.data.Message
}
this.$Loading.finish();
this.$Loading.finish()
})
.catch(error => {
this.parse808Result = JSON.stringify(error);
this.$Loading.error();
});
this.parse808Result = JSON.stringify(error)
this.$Loading.error()
})
},
parse809Click: function() {
if (!this.parse809Parameter) return;
this.$Loading.start();
parse809Click () {
if (!this.parse809Parameter) return
this.$Loading.start()
axios
.post(this.apiUrl + "/JTTools/Parse809", this.parse809Parameter)
.post(this.apiUrl + '/JTTools/Parse809', this.parse809Parameter)
.then(response => {
if (response.data.Code === 200) {
this.parse809Result = response.data.Data;
this.parse809Result = response.data.Data
} else {
this.parse809Result = response.data.Message;
this.parse809Result = response.data.Message
}
this.$Loading.finish();
this.$Loading.finish()
})
.catch(error => {
this.parse809Result = JSON.stringify(error);
this.$Loading.error();
});
this.parse809Result = JSON.stringify(error)
this.$Loading.error()
})
},
parse1078Click: function() {
if (!this.parse1078Parameter) return;
this.$Loading.start();
parse1078Click () {
if (!this.parse1078Parameter) return
this.$Loading.start()
axios
.post(this.apiUrl + "/JTTools/Parse1078", this.parse1078Parameter)
.post(this.apiUrl + '/JTTools/Parse1078', this.parse1078Parameter)
.then(response => {
if (response.data.Code === 200) {
this.parse1078Result = response.data.Data;
this.parse1078Result = response.data.Data
} else {
this.parse1078Result = response.data.Message;
this.parse1078Result = response.data.Message
}
this.$Loading.finish();
this.$Loading.finish()
})
.catch(error => {
this.parse1078Result = JSON.stringify(error);
this.$Loading.error();
});
this.parse1078Result = JSON.stringify(error)
this.$Loading.error()
})
}
}
};
}
</script>

<style scope>


+ 3
- 3
src/ui/jttools/src/main.js 查看文件

@@ -1,12 +1,12 @@
import Vue from 'vue'
import App from './App'
import iView from 'iview';
import iView from 'iview'
import JsonViewer from 'vue-json-viewer'
import 'iview/dist/styles/iview.css';
import 'iview/dist/styles/iview.css'
import 'vue-json-viewer/style.css'

Vue.config.productionTip = false
Vue.use(iView);
Vue.use(iView)
Vue.use(JsonViewer)
/* eslint-disable no-new */
new Vue({


正在加载...
取消
保存