ソースを参照

地址设置

tags/录制修改前
zhangxueyang 4年前
コミット
40df10009a

+ 2
- 2
XHWK.Model/Properties/AssemblyInfo.cs ファイルの表示

@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
31 31
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
32 32
 //通过使用 "*",如下所示:
33 33
 // [assembly: AssemblyVersion("1.0.*")]
34
-[assembly: AssemblyVersion("1.0.9.0")]
35
-[assembly: AssemblyFileVersion("1.0.9.0")]
34
+[assembly: AssemblyVersion("1.1.0.0")]
35
+[assembly: AssemblyFileVersion("1.1.0.0")]

+ 5
- 5
XHWK.WKTool/App.config ファイルの表示

@@ -19,11 +19,11 @@
19 19
     <!--记住密码-->
20 20
     <add key="isRemind" value="" />
21 21
     <!--API请求地址-->
22
-    <add key="APIRequestAddress" value="https://schoolapi.xhkjedu.com"/>
22
+    <add key="APIRequestAddress" value="http://schoolapi.xhkjedu.com"/>
23 23
     <!--文件平台请求地址-->
24
-    <add key="FileRequestAddress" value="https://schoolfile.xhkjedu.com"/>
24
+    <add key="FileRequestAddress" value="http://schoolfile.xhkjedu.com"/>
25 25
     <!--展示文件服务器请求地址-->
26
-    <add key="SchoolfileRequestAddress" value="https://schoolfile.xhkjedu.com"/>
26
+    <add key="SchoolfileRequestAddress" value="http://schoolfile.xhkjedu.com"/>
27 27
     <!--认证请求地址-->
28 28
     <add key="CertapiRequestAddress" value="http://certapi.xhkjedu.com"/>
29 29
     <!--摄像头位置 1.右上 2.左上 3.右下 4.左下-->
@@ -31,7 +31,7 @@
31 31
     <!--上传每片大小 Mb-->
32 32
     <add key="UploadSliceLen" value="1"/>
33 33
     <!--版本号-->
34
-    <add key="VersionCode" value="10"/>
35
-    <add key="VersionName" value="1.0.9"/>
34
+    <add key="VersionCode" value="11"/>
35
+    <add key="VersionName" value="1.1.0"/>
36 36
   </appSettings>
37 37
 </configuration>

+ 5
- 1
XHWK.WKTool/App.cs ファイルの表示

@@ -23,7 +23,7 @@ namespace XHWK.WKTool
23 23
         /// <summary>
24 24
         /// 是否为测试版
25 25
         /// </summary>
26
-        public static bool isDebug = false;
26
+        public static bool isDebug = true;
27 27
         /// <summary>
28 28
         /// 接口地址
29 29
         /// </summary>
@@ -40,6 +40,10 @@ namespace XHWK.WKTool
40 40
         /// 认证接口地址
41 41
         /// </summary>
42 42
         public static string certapiUrl = isDebug ? "http://certapitest.xhkjedu.com" : FileToolsCommon.GetConfigValue("CertapiRequestAddress");
43
+        /// <summary>
44
+        /// 数据存放目录
45
+        /// </summary>
46
+        public static string dataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\XHMicroLesson\\";
43 47
 
44 48
         /// <summary>
45 49
         /// 用户信息

+ 1
- 0
XHWK.WKTool/LoginWindow.xaml.cs ファイルの表示

@@ -133,6 +133,7 @@ namespace XHWK.WKTool
133 133
             }
134 134
             else
135 135
             {
136
+                APP.IsLoginType = false;
136 137
                 APP.myloading.Hide();
137 138
                 MessageWindow.Show(APP.ServerMsg);
138 139
             }

+ 5
- 5
XHWK.WKTool/UploadWindow.xaml.cs ファイルの表示

@@ -95,11 +95,11 @@ namespace XHWK.WKTool
95 95
             if (code == 0)
96 96
             {
97 97
                 pageData.zhangjieList.Clear();
98
-                //pageData.zhangjieList.Add(new ComboBoxBean()
99
-                //{
100
-                //    Key = 999999,
101
-                //    Value = "全部"
102
-                //});
98
+                pageData.zhangjieList.Add(new ComboBoxBean()
99
+                {
100
+                    Key = 0,
101
+                    Value = "全部",
102
+                });
103 103
                 for (int i = 0; i < APP.DirectorList.Count; i++)
104 104
                 {
105 105
                     Model_DirectorList item = APP.DirectorList[i];

+ 32
- 8
XHWK.WKTool/XHMicroLessonSystemWindow.xaml ファイルの表示

@@ -372,6 +372,9 @@
372 372
                 <RowDefinition Height="70"/>
373 373
                 <RowDefinition Height="70"/>
374 374
                 <RowDefinition Height="70"/>
375
+                <RowDefinition Height="70"/>
376
+                <RowDefinition Height="70"/>
377
+                <RowDefinition Height="70"/>
375 378
                 <RowDefinition Height="*"/>
376 379
             </Grid.RowDefinitions>
377 380
             <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,30,0,0">
@@ -396,11 +399,32 @@
396 399
                 <RadioButton x:Name="rbnY" Cursor="Hand" Content="有" FontSize="14" Foreground="#333333" Margin="10,2,0,0" IsChecked="True"/>
397 400
                 <RadioButton x:Name="rbnN" Cursor="Hand" Content="无" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
398 401
             </StackPanel>
399
-            <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0">
400
-                <TextBlock x:Name="txbFilePath" Text="文件路径" FontSize="16" Width="80"  Foreground="#2D8CF0" Padding="2,26,10,0"/>
401
-                <!--输入框-->
402
-                <Border Background="#CDD6E0" Width="525" Height="43" CornerRadius="3">
403
-                    <Label x:Name="txbStoragePath" Background="#FFFFFF" Content="D:\" FontSize="16" Foreground="#333333" Padding="5,12,2,2" Width="523" Height="42" BorderBrush="{x:Null}" BorderThickness="0"/>
402
+
403
+
404
+        <!--接口地址-->
405
+            <StackPanel Grid.Row="3" Orientation="Horizontal" Margin="30,0,0,0">
406
+                <TextBlock Text="接口地址" FontSize="16" Foreground="#2D8CF0" Width="80" Padding="0,25,0,0" Margin="10,0,0,0"/>
407
+                <TextBlock Text="http://" FontSize="16" Padding="0,25,5,0"/>
408
+                <TextBox x:Name="txbInterfaceAddress" FontSize="16" Width="467" Height="41"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
409
+            </StackPanel>
410
+            <!--上传地址-->
411
+            <StackPanel Grid.Row="4" Orientation="Horizontal" Margin="30,20,0,0">
412
+                <TextBlock Text="上传地址" FontSize="16" Foreground="#2D8CF0" Width="80" Padding="0,10,0,0" Margin="10,5,0,0"/>
413
+                <TextBlock Text="http://" FontSize="16" Padding="0,15,5,0"/>
414
+                <TextBox x:Name="txbImageUploadAddress" FontSize="16" Width="467" Height="41"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
415
+            </StackPanel>
416
+            <!--下载地址-->
417
+            <StackPanel Grid.Row="5" Orientation="Horizontal" Margin="30,20,0,0">
418
+                <TextBlock Text="下载地址" FontSize="16" Foreground="#2D8CF0" Width="80" Padding="0,15,0,0" Margin="10,0,0,0"/>
419
+                <TextBlock Text="http://" FontSize="16" Padding="0,15,5,0"/>
420
+                <TextBox x:Name="txbPictureShowsAddress" FontSize="16" Width="467" Height="41"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
421
+            </StackPanel>
422
+
423
+
424
+            <StackPanel Grid.Row="6" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,20,0,0">
425
+                <TextBlock x:Name="txbFilePath" Text="文件路径" FontSize="16" Width="80"  Foreground="#2D8CF0" Padding="10,18,10,0" />
426
+                <Border Background="#CDD6E0" Width="522" Height="43" CornerRadius="3" Margin="10,0,0,0">
427
+                    <Label x:Name="txbStoragePath" Background="#FFFFFF" Content="D:\" FontSize="16" Foreground="#333333" Padding="10,12,2,2" Width="520" Height="41" BorderBrush="{x:Null}" BorderThickness="0"/>
404 428
                 </Border>
405 429
                 <!--浏览按钮-->
406 430
                 <Button Cursor="Hand" x:Name="btnBrowse" Content="浏览" FontSize="18" Width="80" Height="43" Margin="18,0,0,0" Click="BtnBrowse_Click">
@@ -420,16 +444,16 @@
420 444
                     </Button.Template>
421 445
                 </Button>
422 446
             </StackPanel>
423
-            <StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,30,0,0">
447
+            <StackPanel Grid.Row="7" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,30,0,0">
424 448
                 <TextBlock Text="    版本号" FontSize="16" Width="80" Foreground="#2D8CF0"/>
425 449
                 <TextBlock x:Name="txbv" Text="V0.0.0" FontSize="16" Foreground="#333333" Padding="10,0,0,0"/>
426 450
             </StackPanel>
427
-            <StackPanel Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,30,0,0">
451
+            <StackPanel Grid.Row="8" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,30,0,0">
428 452
                 <TextBlock Text="版权所有" FontSize="16" Width="80" Foreground="#2D8CF0"/>
429 453
                 <TextBlock Text="河南星火燎原软件科技有限公司" FontSize="14" Foreground="#333333" Padding="10,0,0,0"/>
430 454
             </StackPanel>
431 455
             <!--第四行 开始按钮-->
432
-            <Button Cursor="Hand" Grid.Row="6" x:Name="btnSave" Content="保存" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="115" Height="45" Margin="10,0,10,0" Click="BtnSave_Click">
456
+            <Button Cursor="Hand" Grid.Row="9" x:Name="btnSave" Content="保存" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="115" Height="45" Margin="10,0,10,0" Click="BtnSave_Click">
433 457
                 <Button.Template>
434 458
                     <ControlTemplate TargetType="{x:Type Button}">
435 459
                         <Border

+ 113
- 7
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs ファイルの表示

@@ -13,6 +13,7 @@ using System.Drawing;
13 13
 using System.Drawing.Imaging;
14 14
 using System.IO;
15 15
 using System.Linq;
16
+using System.Text;
16 17
 using System.Threading;
17 18
 using System.Windows;
18 19
 using System.Windows.Controls;
@@ -119,7 +120,20 @@ namespace XHWK.WKTool
119 120
             GridContent.Height = Height;
120 121
 
121 122
 
122
-
123
+            #region 读取本地配置
124
+            if (File.Exists(APP.dataPath + "interfaceAddress.txt")) //若不为空
125
+            {
126
+                APP.apiUrl = System.IO.File.ReadAllText(APP.dataPath + "interfaceAddress.txt", Encoding.Default);
127
+            }
128
+            if (File.Exists(APP.dataPath + "imageUploadAddress.txt")) //若不为空
129
+            {
130
+                APP.uploadUrl = System.IO.File.ReadAllText(APP.dataPath + "imageUploadAddress.txt", Encoding.Default);
131
+            }
132
+            if (File.Exists(APP.dataPath + "pictureShowsAddress.txt")) //若不为空
133
+            {
134
+                APP.showImageUrl = System.IO.File.ReadAllText(APP.dataPath + "pictureShowsAddress.txt", Encoding.Default);
135
+            } 
136
+            #endregion
123 137
 
124 138
             //GridMain.Height= PrimaryScreen.ScaleScreenSize().Height - 40;
125 139
 
@@ -451,6 +465,39 @@ namespace XHWK.WKTool
451 465
                 //ImgRecord.Visibility = Visibility.Collapsed;//设置时不可录制
452 466
                 //ImgRecordTwo.Visibility = Visibility.Visible;//设置时不可录制
453 467
                 //BtnRecord.IsEnabled = false;//设置时不可录制
468
+
469
+
470
+
471
+                #region 读取用户配置
472
+                //接口地址
473
+                if (!File.Exists(APP.dataPath + "interfaceAddress.txt")) //若为空
474
+                {
475
+                    txbInterfaceAddress.Text = APP.apiUrl.Replace("http://", "").Trim();
476
+                }
477
+                else
478
+                {
479
+                    txbInterfaceAddress.Text = System.IO.File.ReadAllText(APP.dataPath + "interfaceAddress.txt", Encoding.Default).Replace("http://", "").Trim();
480
+                }
481
+                //上传地址
482
+                if (!File.Exists(APP.dataPath + "imageUploadAddress.txt")) //若为空
483
+                {
484
+                    txbImageUploadAddress.Text = APP.uploadUrl.Replace("http://", "").Replace("/", "").Trim();
485
+                }
486
+                else
487
+                {
488
+                    txbImageUploadAddress.Text = System.IO.File.ReadAllText(APP.dataPath + "imageUploadAddress.txt", Encoding.Default).Replace("http://", "").Replace("/", "").Trim();
489
+                }
490
+                //下载地址
491
+                if (!File.Exists(APP.dataPath + "pictureShowsAddress.txt")) //若为空
492
+                {
493
+                    txbPictureShowsAddress.Text = APP.showImageUrl.Replace("http://", "").Replace("/", "").Replace("static", "").Trim();
494
+                }
495
+                else
496
+                {
497
+                    txbPictureShowsAddress.Text = System.IO.File.ReadAllText(APP.dataPath + "pictureShowsAddress.txt", Encoding.Default).Replace("http://", "").Replace("/", "").Replace("static", "").Trim();
498
+                }
499
+           
500
+
454 501
                 ///  < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
455 502
                 if ("1".Equals(APP.CameraPosition))
456 503
                 {
@@ -490,6 +537,7 @@ namespace XHWK.WKTool
490 537
                 {
491 538
                     rbnN.IsChecked = true;
492 539
                 }
540
+                #endregion
493 541
             }
494 542
         }
495 543
         /// <summary>
@@ -530,6 +578,53 @@ namespace XHWK.WKTool
530 578
             ImgRecord.Visibility = Visibility.Visible;//设置结束时可录制
531 579
             ImgRecordTwo.Visibility = Visibility.Collapsed;//设置结束时可录制
532 580
             BtnRecord.IsEnabled = true;//设置结束时可录制
581
+
582
+            if (!string.IsNullOrWhiteSpace(txbInterfaceAddress.Text))
583
+            {
584
+                string ApplicationData = APP.dataPath + "interfaceAddress.txt";
585
+                string temp = "http://" + txbInterfaceAddress.Text;
586
+                System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
587
+            }
588
+            else
589
+            {
590
+                MessageWindow.Show("接口地址未输入");
591
+                return;
592
+            }
593
+            if (!string.IsNullOrWhiteSpace(txbImageUploadAddress.Text))//图片上传地址
594
+            {
595
+                string ApplicationData = APP.dataPath + "imageUploadAddress.txt";
596
+                string temp = "http://" + txbImageUploadAddress.Text + "/";
597
+                System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
598
+            }
599
+            else
600
+            {
601
+                MessageWindow.Show("上传地址未输入");
602
+                return;
603
+            }
604
+            if (!string.IsNullOrWhiteSpace(txbPictureShowsAddress.Text))
605
+            {
606
+                string ApplicationData = APP.dataPath + "pictureShowsAddress.txt";
607
+                string temp = "http://" + txbPictureShowsAddress.Text + "/static/";
608
+                System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
609
+            }
610
+            else
611
+            {
612
+                MessageWindow.Show("下载地址未输入");
613
+                return;
614
+            }
615
+            if (!APP.apiUrl.Equals(txbInterfaceAddress.Text))
616
+            {
617
+                APP.apiUrl = "http://" + txbInterfaceAddress.Text;
618
+                LoginType();
619
+            }
620
+            if (!APP.uploadUrl.Equals(txbImageUploadAddress.Text))
621
+            {
622
+                APP.uploadUrl = "http://" + txbImageUploadAddress.Text + "/";
623
+            }
624
+            if (!APP.showImageUrl.Equals(txbPictureShowsAddress.Text))
625
+            {
626
+                APP.showImageUrl = "http://" + txbPictureShowsAddress.Text + "/static/";
627
+            }
533 628
             if (rbnMP4.IsChecked == true)
534 629
             {
535 630
                 //存储文件
@@ -592,7 +687,7 @@ namespace XHWK.WKTool
592 687
             {
593 688
                 //存储文件
594 689
                 FileToolsCommon.SetConfigValue("VideoSavePath", txbStoragePath.Content.ToString());
595
-                System.Windows.MessageBox.Show("路径已变更,下次创建微课时自动生效!!!");
690
+                MessageWindow.Show("路径已变更,下次创建微课时自动生效!!!");
596 691
             }
597 692
         }
598 693
         /// <summary>
@@ -1154,6 +1249,7 @@ namespace XHWK.WKTool
1154 1249
         public void InitializeUpload()
1155 1250
         {
1156 1251
             APP.myloading.Show();
1252
+
1157 1253
             MouseNumber = 0;
1158 1254
             IsModify = false;
1159 1255
             //加载视频列表
@@ -1319,11 +1415,6 @@ namespace XHWK.WKTool
1319 1415
 
1320 1416
                     if (dAL_Upload.UploadVideo(pageData.menuList[i].FileGuid, out string ErrMessage))
1321 1417
                     {
1322
-                        pageData.menuList[i].Visi = "Collapsed";
1323
-                        pageData.menuList[i].Coll = "Visible";
1324
-
1325
-                        DataContext = pageData;
1326
-
1327 1418
                         //MessageWindow.Show("视频上传服务器成功!");
1328 1419
                         if (APP.W_UploadWindow == null)
1329 1420
                         {
@@ -1335,6 +1426,10 @@ namespace XHWK.WKTool
1335 1426
                         //long size = Convert.ToInt64(FileToolsCommon.GetFileSizeByMB(pageData.menuList[i].FilePath));
1336 1427
                         APP.W_UploadWindow.Initialize(pageData.menuList[i].VideoName, pageData.menuList[i].VideoSizes, pageData.menuList[i].VideoType, pageData.menuList[i].FileGuid);
1337 1428
                         APP.W_UploadWindow.ShowDialog();
1429
+                        pageData.menuList[i].Visi = "Collapsed";
1430
+                        pageData.menuList[i].Coll = "Visible";
1431
+
1432
+                        DataContext = pageData;
1338 1433
 
1339 1434
                     }
1340 1435
                     else
@@ -2441,6 +2536,17 @@ namespace XHWK.WKTool
2441 2536
             }
2442 2537
         }
2443 2538
         /// <summary>
2539
+        /// 状态更改为未登陆
2540
+        /// </summary>
2541
+        private void LoginType()
2542
+        {
2543
+            APP.IsLoginType = false;
2544
+            txbLoginType.Text = "未登录";
2545
+            APP.UserInfo = new Model_UserInfo();
2546
+            ImgUpload.Visibility = Visibility.Collapsed;
2547
+            ImgUploadTwo.Visibility = Visibility.Visible;
2548
+        }
2549
+        /// <summary>
2444 2550
         /// 获取时间戳
2445 2551
         /// </summary>
2446 2552
         /// <returns></returns>

読み込み中…
キャンセル
保存