Browse Source

地址设置

tags/录制修改前
zhangxueyang 4 years ago
parent
commit
40df10009a

+ 2
- 2
XHWK.Model/Properties/AssemblyInfo.cs View File

31
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
31
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
32
 //通过使用 "*",如下所示:
32
 //通过使用 "*",如下所示:
33
 // [assembly: AssemblyVersion("1.0.*")]
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 View File

19
     <!--记住密码-->
19
     <!--记住密码-->
20
     <add key="isRemind" value="" />
20
     <add key="isRemind" value="" />
21
     <!--API请求地址-->
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
     <add key="CertapiRequestAddress" value="http://certapi.xhkjedu.com"/>
28
     <add key="CertapiRequestAddress" value="http://certapi.xhkjedu.com"/>
29
     <!--摄像头位置 1.右上 2.左上 3.右下 4.左下-->
29
     <!--摄像头位置 1.右上 2.左上 3.右下 4.左下-->
31
     <!--上传每片大小 Mb-->
31
     <!--上传每片大小 Mb-->
32
     <add key="UploadSliceLen" value="1"/>
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
   </appSettings>
36
   </appSettings>
37
 </configuration>
37
 </configuration>

+ 5
- 1
XHWK.WKTool/App.cs View File

23
         /// <summary>
23
         /// <summary>
24
         /// 是否为测试版
24
         /// 是否为测试版
25
         /// </summary>
25
         /// </summary>
26
-        public static bool isDebug = false;
26
+        public static bool isDebug = true;
27
         /// <summary>
27
         /// <summary>
28
         /// 接口地址
28
         /// 接口地址
29
         /// </summary>
29
         /// </summary>
40
         /// 认证接口地址
40
         /// 认证接口地址
41
         /// </summary>
41
         /// </summary>
42
         public static string certapiUrl = isDebug ? "http://certapitest.xhkjedu.com" : FileToolsCommon.GetConfigValue("CertapiRequestAddress");
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
         /// <summary>
48
         /// <summary>
45
         /// 用户信息
49
         /// 用户信息

+ 1
- 0
XHWK.WKTool/LoginWindow.xaml.cs View File

133
             }
133
             }
134
             else
134
             else
135
             {
135
             {
136
+                APP.IsLoginType = false;
136
                 APP.myloading.Hide();
137
                 APP.myloading.Hide();
137
                 MessageWindow.Show(APP.ServerMsg);
138
                 MessageWindow.Show(APP.ServerMsg);
138
             }
139
             }

+ 5
- 5
XHWK.WKTool/UploadWindow.xaml.cs View File

95
             if (code == 0)
95
             if (code == 0)
96
             {
96
             {
97
                 pageData.zhangjieList.Clear();
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
                 for (int i = 0; i < APP.DirectorList.Count; i++)
103
                 for (int i = 0; i < APP.DirectorList.Count; i++)
104
                 {
104
                 {
105
                     Model_DirectorList item = APP.DirectorList[i];
105
                     Model_DirectorList item = APP.DirectorList[i];

+ 32
- 8
XHWK.WKTool/XHMicroLessonSystemWindow.xaml View File

372
                 <RowDefinition Height="70"/>
372
                 <RowDefinition Height="70"/>
373
                 <RowDefinition Height="70"/>
373
                 <RowDefinition Height="70"/>
374
                 <RowDefinition Height="70"/>
374
                 <RowDefinition Height="70"/>
375
+                <RowDefinition Height="70"/>
376
+                <RowDefinition Height="70"/>
377
+                <RowDefinition Height="70"/>
375
                 <RowDefinition Height="*"/>
378
                 <RowDefinition Height="*"/>
376
             </Grid.RowDefinitions>
379
             </Grid.RowDefinitions>
377
             <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,30,0,0">
380
             <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,30,0,0">
396
                 <RadioButton x:Name="rbnY" Cursor="Hand" Content="有" FontSize="14" Foreground="#333333" Margin="10,2,0,0" IsChecked="True"/>
399
                 <RadioButton x:Name="rbnY" Cursor="Hand" Content="有" FontSize="14" Foreground="#333333" Margin="10,2,0,0" IsChecked="True"/>
397
                 <RadioButton x:Name="rbnN" Cursor="Hand" Content="无" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
400
                 <RadioButton x:Name="rbnN" Cursor="Hand" Content="无" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
398
             </StackPanel>
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
                 </Border>
428
                 </Border>
405
                 <!--浏览按钮-->
429
                 <!--浏览按钮-->
406
                 <Button Cursor="Hand" x:Name="btnBrowse" Content="浏览" FontSize="18" Width="80" Height="43" Margin="18,0,0,0" Click="BtnBrowse_Click">
430
                 <Button Cursor="Hand" x:Name="btnBrowse" Content="浏览" FontSize="18" Width="80" Height="43" Margin="18,0,0,0" Click="BtnBrowse_Click">
420
                     </Button.Template>
444
                     </Button.Template>
421
                 </Button>
445
                 </Button>
422
             </StackPanel>
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
                 <TextBlock Text="    版本号" FontSize="16" Width="80" Foreground="#2D8CF0"/>
448
                 <TextBlock Text="    版本号" FontSize="16" Width="80" Foreground="#2D8CF0"/>
425
                 <TextBlock x:Name="txbv" Text="V0.0.0" FontSize="16" Foreground="#333333" Padding="10,0,0,0"/>
449
                 <TextBlock x:Name="txbv" Text="V0.0.0" FontSize="16" Foreground="#333333" Padding="10,0,0,0"/>
426
             </StackPanel>
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
                 <TextBlock Text="版权所有" FontSize="16" Width="80" Foreground="#2D8CF0"/>
452
                 <TextBlock Text="版权所有" FontSize="16" Width="80" Foreground="#2D8CF0"/>
429
                 <TextBlock Text="河南星火燎原软件科技有限公司" FontSize="14" Foreground="#333333" Padding="10,0,0,0"/>
453
                 <TextBlock Text="河南星火燎原软件科技有限公司" FontSize="14" Foreground="#333333" Padding="10,0,0,0"/>
430
             </StackPanel>
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
                 <Button.Template>
457
                 <Button.Template>
434
                     <ControlTemplate TargetType="{x:Type Button}">
458
                     <ControlTemplate TargetType="{x:Type Button}">
435
                         <Border
459
                         <Border

+ 113
- 7
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

13
 using System.Drawing.Imaging;
13
 using System.Drawing.Imaging;
14
 using System.IO;
14
 using System.IO;
15
 using System.Linq;
15
 using System.Linq;
16
+using System.Text;
16
 using System.Threading;
17
 using System.Threading;
17
 using System.Windows;
18
 using System.Windows;
18
 using System.Windows.Controls;
19
 using System.Windows.Controls;
119
             GridContent.Height = Height;
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
             //GridMain.Height= PrimaryScreen.ScaleScreenSize().Height - 40;
138
             //GridMain.Height= PrimaryScreen.ScaleScreenSize().Height - 40;
125
 
139
 
451
                 //ImgRecord.Visibility = Visibility.Collapsed;//设置时不可录制
465
                 //ImgRecord.Visibility = Visibility.Collapsed;//设置时不可录制
452
                 //ImgRecordTwo.Visibility = Visibility.Visible;//设置时不可录制
466
                 //ImgRecordTwo.Visibility = Visibility.Visible;//设置时不可录制
453
                 //BtnRecord.IsEnabled = false;//设置时不可录制
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
                 ///  < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
501
                 ///  < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
455
                 if ("1".Equals(APP.CameraPosition))
502
                 if ("1".Equals(APP.CameraPosition))
456
                 {
503
                 {
490
                 {
537
                 {
491
                     rbnN.IsChecked = true;
538
                     rbnN.IsChecked = true;
492
                 }
539
                 }
540
+                #endregion
493
             }
541
             }
494
         }
542
         }
495
         /// <summary>
543
         /// <summary>
530
             ImgRecord.Visibility = Visibility.Visible;//设置结束时可录制
578
             ImgRecord.Visibility = Visibility.Visible;//设置结束时可录制
531
             ImgRecordTwo.Visibility = Visibility.Collapsed;//设置结束时可录制
579
             ImgRecordTwo.Visibility = Visibility.Collapsed;//设置结束时可录制
532
             BtnRecord.IsEnabled = true;//设置结束时可录制
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
             if (rbnMP4.IsChecked == true)
628
             if (rbnMP4.IsChecked == true)
534
             {
629
             {
535
                 //存储文件
630
                 //存储文件
592
             {
687
             {
593
                 //存储文件
688
                 //存储文件
594
                 FileToolsCommon.SetConfigValue("VideoSavePath", txbStoragePath.Content.ToString());
689
                 FileToolsCommon.SetConfigValue("VideoSavePath", txbStoragePath.Content.ToString());
595
-                System.Windows.MessageBox.Show("路径已变更,下次创建微课时自动生效!!!");
690
+                MessageWindow.Show("路径已变更,下次创建微课时自动生效!!!");
596
             }
691
             }
597
         }
692
         }
598
         /// <summary>
693
         /// <summary>
1154
         public void InitializeUpload()
1249
         public void InitializeUpload()
1155
         {
1250
         {
1156
             APP.myloading.Show();
1251
             APP.myloading.Show();
1252
+
1157
             MouseNumber = 0;
1253
             MouseNumber = 0;
1158
             IsModify = false;
1254
             IsModify = false;
1159
             //加载视频列表
1255
             //加载视频列表
1319
 
1415
 
1320
                     if (dAL_Upload.UploadVideo(pageData.menuList[i].FileGuid, out string ErrMessage))
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
                         //MessageWindow.Show("视频上传服务器成功!");
1418
                         //MessageWindow.Show("视频上传服务器成功!");
1328
                         if (APP.W_UploadWindow == null)
1419
                         if (APP.W_UploadWindow == null)
1329
                         {
1420
                         {
1335
                         //long size = Convert.ToInt64(FileToolsCommon.GetFileSizeByMB(pageData.menuList[i].FilePath));
1426
                         //long size = Convert.ToInt64(FileToolsCommon.GetFileSizeByMB(pageData.menuList[i].FilePath));
1336
                         APP.W_UploadWindow.Initialize(pageData.menuList[i].VideoName, pageData.menuList[i].VideoSizes, pageData.menuList[i].VideoType, pageData.menuList[i].FileGuid);
1427
                         APP.W_UploadWindow.Initialize(pageData.menuList[i].VideoName, pageData.menuList[i].VideoSizes, pageData.menuList[i].VideoType, pageData.menuList[i].FileGuid);
1337
                         APP.W_UploadWindow.ShowDialog();
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
                     else
1435
                     else
2441
             }
2536
             }
2442
         }
2537
         }
2443
         /// <summary>
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
         /// </summary>
2551
         /// </summary>
2446
         /// <returns></returns>
2552
         /// <returns></returns>

Loading…
Cancel
Save