Browse Source

zhao:1优化日志,增加版本信息。2设置增加打开微课列表。3优化主页代码。4请求增加访问失败提示。

tags/录制修改前
耀 3 years ago
parent
commit
4a7f9d1978

+ 1
- 1
Common/system/LogHelper.cs View File

18
         {
18
         {
19
             if (logerror.IsErrorEnabled)
19
             if (logerror.IsErrorEnabled)
20
             {
20
             {
21
-                logerror.Error(info, ex);
21
+                logerror.Error("[V " + FileToolsCommon.GetConfigValue("VersionName") + "]"+info, ex);
22
             }
22
             }
23
         }
23
         }
24
     }
24
     }

+ 23
- 28
XHWK.WKTool/DAL/DAL_Upload.cs View File

36
                 try
36
                 try
37
                 {
37
                 {
38
                     JObject jo = HttpHelper.PostFunction(FileRequestAddress + @"/chunkdb/isexist", @"application/x-www-form-urlencoded", @"md5=" + MD5, "");
38
                     JObject jo = HttpHelper.PostFunction(FileRequestAddress + @"/chunkdb/isexist", @"application/x-www-form-urlencoded", @"md5=" + MD5, "");
39
-                    ////0成功,1失败
40
-                    //if (jo["code"].ToString() == "0")
41
-                    //{
42
-                    //    if (string.IsNullOrWhiteSpace(jo["obj"].ToString()))
43
-                    //    {
44
-                    //        //不存在 允许上传
45
-                    //        return true;
46
-                    //    }
47
-                    //    else
48
-                    //    {
49
-                    //        //已存在 不允许上传
50
-                    //        return false;
51
-                    //    }
52
-                    //}
53
-                    //else
54
-                    //{
55
-                    //    Message = jo["msg"].ToString();
56
-                    //    return false;
57
-                    //}
39
+                    if(jo==null)
40
+                    {
41
+                        Message = "无法访问文件服务器,请检查网络或文件服务器地址。";
42
+                        return false;
43
+                    }
58
 
44
 
59
                     //修改为0为之前上传成功,1为之前未上传成功
45
                     //修改为0为之前上传成功,1为之前未上传成功
60
                     if (jo["code"].ToString() == "0")
46
                     if (jo["code"].ToString() == "0")
61
                     {
47
                     {
62
-
48
+                        Message = "";
63
                         //已存在 不允许上传
49
                         //已存在 不允许上传
64
                         return false;
50
                         return false;
51
+                        //    if (string.IsNullOrWhiteSpace(jo["obj"].ToString()))
52
+                        //    {
53
+                        //        //不存在 允许上传
54
+                        //        return true;
55
+                        //    }
56
+                        //    else
57
+                        //    {
58
+                        //        //已存在 不允许上传
59
+                        //        return false;
60
+                        //    }
65
                     }
61
                     }
66
                     else
62
                     else
67
                     {
63
                     {
64
+                        Message = "";
68
                         //不存在 允许上传
65
                         //不存在 允许上传
69
                         return true;
66
                         return true;
70
-
71
                     }
67
                     }
72
                 }
68
                 }
73
                 catch (Exception e)
69
                 catch (Exception e)
97
                 try
93
                 try
98
                 {
94
                 {
99
                     JObject jo = HttpHelper.PostFunction(FileRequestAddress + @"/chunkdb/mergechunk", @"application/x-www-form-urlencoded", @"savefolder=" + Savefolder + "&identifier=" + FileCode, "");
95
                     JObject jo = HttpHelper.PostFunction(FileRequestAddress + @"/chunkdb/mergechunk", @"application/x-www-form-urlencoded", @"savefolder=" + Savefolder + "&identifier=" + FileCode, "");
100
-                    Model.ResultVo<Model_ResourceAddTwo> resultObj = JsonHelper.JsonToObj<Model.ResultVo<Model_ResourceAddTwo>>(jo.ToString()); ;
96
+                    if (jo == null)
97
+                    {
98
+                        Message = "无法访问文件服务器,请检查网络或文件服务器地址。";
99
+                        return false;
100
+                    }
101
+                    Model.ResultVo<Model_ResourceAddTwo> resultObj = JsonHelper.JsonToObj<Model.ResultVo<Model_ResourceAddTwo>>(jo.ToString());
101
                     APP.ResourceAddTwo = new Model_ResourceAddTwo();
102
                     APP.ResourceAddTwo = new Model_ResourceAddTwo();
102
                     //0成功,1失败
103
                     //0成功,1失败
103
                     if (resultObj.code == 0 && resultObj.obj != null)
104
                     if (resultObj.code == 0 && resultObj.obj != null)
257
                         long len = VideoInfo.Uploaded * VideoInfo.SliceLen;
258
                         long len = VideoInfo.Uploaded * VideoInfo.SliceLen;
258
                         string fileName = FileToolsCommon.GetFileName(VideoInfo.VideoPath);
259
                         string fileName = FileToolsCommon.GetFileName(VideoInfo.VideoPath);
259
 
260
 
260
-
261
                         ////分块
261
                         ////分块
262
                         //for (; len + VideoInfo.SliceLen < filelen; VideoInfo.Uploaded++)
262
                         //for (; len + VideoInfo.SliceLen < filelen; VideoInfo.Uploaded++)
263
                         //{
263
                         //{
280
                         //    }
280
                         //    }
281
                         //}
281
                         //}
282
 
282
 
283
-
284
-
285
-
286
-
287
-
288
                         //分块
283
                         //分块
289
                         do
284
                         do
290
                         {
285
                         {

+ 19
- 0
XHWK.WKTool/XHMicroLessonSystemWindow.xaml View File

453
                                 </ControlTemplate>
453
                                 </ControlTemplate>
454
                             </Button.Template>
454
                             </Button.Template>
455
                         </Button>
455
                         </Button>
456
+                        <!--打开按钮-->
457
+                        <Button Cursor="Hand" x:Name="btnOpen" Content="打开文件位置" FontSize="14" Width="100" Height="30" Margin="18,-30,0,0" Click="btnOpen_Click">
458
+                            <Button.Template>
459
+                                <ControlTemplate TargetType="{x:Type Button}">
460
+                                    <Border
461
+                                BorderBrush="{TemplateBinding BorderBrush}"
462
+                                BorderThickness="1"
463
+                                CornerRadius="2">
464
+                                        <Border.Background>
465
+                                            <Brush>#EBEFF3</Brush>
466
+                                        </Border.Background>
467
+                                        <ContentPresenter
468
+                                    HorizontalAlignment="Center"
469
+                                    VerticalAlignment="Center"
470
+                                    Content="{TemplateBinding Content}" />
471
+                                    </Border>
472
+                                </ControlTemplate>
473
+                            </Button.Template>
474
+                        </Button>
456
                     </StackPanel>
475
                     </StackPanel>
457
                     <TextBlock Grid.Row="7" Grid.Column="0" Text="录屏快捷键" FontSize="16" HorizontalAlignment="Right" Foreground="#333333" Margin="0,0,0,0"/>
476
                     <TextBlock Grid.Row="7" Grid.Column="0" Text="录屏快捷键" FontSize="16" HorizontalAlignment="Right" Foreground="#333333" Margin="0,0,0,0"/>
458
                     <StackPanel Grid.Row="7" Grid.Column="1">
477
                     <StackPanel Grid.Row="7" Grid.Column="1">

+ 507
- 484
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs
File diff suppressed because it is too large
View File


Loading…
Cancel
Save