From 685e189807c825ab812c6325122c7a1c7b2c42b6 Mon Sep 17 00:00:00 2001 From: timlai Date: Sun, 28 Jun 2020 12:35:36 +0800 Subject: [PATCH 01/40] preview7 --- src/SSCMS.Cli/Abstractions/IApplication.cs | 16 + src/SSCMS.Cli/Application.cs | 37 +- src/SSCMS.Cli/Core/CliUtils.cs | 33 +- src/SSCMS.Cli/Core/SchedulerJob.cs | 3 +- src/SSCMS.Cli/Core/WriteUtils.cs | 46 +- src/SSCMS.Cli/Jobs/InstallSsCmsJob.cs | 2 +- src/SSCMS.Cli/Jobs/StatusJob.cs | 26 +- src/SSCMS.Cli/Program.cs | 16 +- src/SSCMS.Cli/Services/ApiService.cs | 2 +- src/SSCMS.Core/Plugins/CloudUtils.cs | 2 +- src/SSCMS.Core/Plugins/Plugin.cs | 2 +- .../Services/OldPluginManager.Menu.cs | 13 +- src/SSCMS.Core/Services/ParseManager.cs | 24 +- src/SSCMS.Core/Services/PathManager.Api.cs | 151 - .../Services/PathManager.Plugins.cs | 19 - src/SSCMS.Core/Services/PathManager.Root.cs | 263 + src/SSCMS.Core/Services/PathManager.Site.cs | 125 +- .../Services/PathManager.SiteFiles.cs | 96 - .../Services/PathManager.Special.cs | 2 +- src/SSCMS.Core/Services/PluginManager.cs | 3 +- src/SSCMS.Core/Services/SettingsManager.cs | 6 +- .../StlParser/StlElement/StlAudio.cs | 16 +- .../StlParser/StlElement/StlChannel.cs | 2 +- .../StlParser/StlElement/StlContent.cs | 20 +- .../StlParser/StlElement/StlDynamic.cs | 4 +- .../StlParser/StlElement/StlFile.cs | 4 +- .../StlParser/StlElement/StlFocusViewer.cs | 22 +- src/SSCMS.Core/StlParser/StlElement/StlIf.cs | 3 +- .../StlParser/StlElement/StlPageContents.cs | 2 +- .../StlElement/StlPageSqlContents.cs | 2 +- .../StlParser/StlElement/StlPlayer.cs | 2 +- .../StlParser/StlElement/StlPrinter.cs | 4 +- .../StlParser/StlElement/StlSearch.cs | 11 +- .../StlParser/StlElement/StlSite.cs | 2 +- .../StlParser/StlElement/StlValue.cs | 12 +- .../StlParser/StlEntity/StlChannelEntities.cs | 2 +- .../StlParser/StlEntity/StlContentEntities.cs | 4 +- .../StlParser/StlEntity/StlStlEntities.cs | 4 +- src/SSCMS.Core/Utils/InputParserManager.cs | 33 +- src/SSCMS.Core/Utils/Office/WordManager.cs | 19 +- .../Admin/Cms/Channels/ChannelsController.cs | 2 +- .../ContentsLayerWordController.Dto.cs | 10 +- .../Contents/ContentsLayerWordController.cs | 36 +- .../Cms/Editor/EditorController.Preview.cs | 2 +- .../EditorLayerTranslateController.Dto.cs | 13 +- .../Editor/EditorLayerTranslateController.cs | 29 +- .../Library/LibraryLayerWordController.Dto.cs | 8 +- .../Cms/Library/LibraryLayerWordController.cs | 26 +- .../Cms/Library/LibraryTextController.cs | 17 +- .../SettingsStyleChannelController.cs | 2 +- .../SettingsStyleContentController.cs | 2 +- .../SettingsStyleRelatedFieldController.cs | 2 +- .../Settings/SettingsStyleSiteController.cs | 2 +- .../Controllers/Admin/IndexController.Get.cs | 2 +- .../Admin/InstallController.Install.cs | 2 +- .../Controllers/Admin/RedirectController.cs | 2 +- .../AdministratorsController.cs | 2 +- .../Sites/SitesChangeRootController.cs | 2 +- .../Settings/Sites/SitesUrlController.Dto.cs | 8 - .../Settings/Sites/SitesUrlController.cs | 40 +- .../UtilitiesParametersController.cs | 1 + .../Shared/EditorLayerWordController.Dto.cs | 8 +- .../Admin/Shared/EditorLayerWordController.cs | 30 +- .../Admin/Shared/FileLayerUploadController.cs | 2 +- .../Shared/VideoLayerUploadController.cs | 2 +- .../ToDel/ContentsLayerWordController.Dto.cs | 7 +- .../Home/ToDel/ContentsLayerWordController.cs | 39 +- .../Home/Write/EditorController.Preview.cs | 2 +- .../Stl/ActionsDownloadController.cs | 4 +- .../Stl/ActionsDynamicController.cs | 2 +- .../Controllers/Stl/ActionsIfController.cs | 2 +- .../Stl/ActionsPageContentsController.cs | 2 +- .../Stl/ActionsRelatedFieldController.cs | 2 +- .../Stl/ActionsSearchController.cs | 4 +- .../Stl/ActionsTriggerController.cs | 2 +- .../shared/_PartialContentsCommands.cshtml | 4 +- .../Pages/ss-admin/cms/editor.cshtml | 4 + .../ss-admin/cms/editorLayerTranslate.cshtml | 5 +- .../Pages/ss-admin/settings/sitesUrl.cshtml | 43 - src/SSCMS.Web/build.ps1 | 8 +- .../sitefiles/assets/js/admin/cms/contents.js | 8 +- .../assets/js/admin/cms/contentsLayerWord.js | 19 +- .../assets/js/admin/cms/contentsSearch.js | 8 +- .../sitefiles/assets/js/admin/cms/editor.js | 2 +- .../js/admin/cms/editorLayerTranslate.js | 25 +- .../assets/js/admin/cms/libraryLayerWord.js | 14 +- .../assets/js/admin/cms/libraryText.js | 8 +- .../js/admin/settings/administrators.js | 6 +- .../settings/administratorsLayerProfile.js | 10 +- .../assets/js/admin/settings/sitesUrl.js | 55 +- .../assets/js/admin/shared/editorLayerWord.js | 14 +- .../assets/js/home/write/contents.js | 8 +- .../wwwroot/sitefiles/assets/js/utils.js | 4 +- .../resources/components/jquery-1.9.1.min.js | 5 + .../resources/components/js.cookie.js | 156 + .../resources/components/lodash-4.17.4.min.js | 136 + .../resources/components/stlclient.js | 121 + .../sitefiles/resources/default_avatar.png | Bin 0 -> 1113 bytes .../sitefiles/resources/dynamic/script.js | 36 + .../resources/flashes/audiojs/audio.min.js | 24 + .../resources/flashes/audiojs/audiojs.swf | Bin 0 -> 1644 bytes .../flashes/audiojs/player-graphics.gif | Bin 0 -> 4499 bytes .../sitefiles/resources/flashes/bcastr31.swf | Bin 0 -> 14892 bytes .../resources/flashes/brplayer/player.swf | Bin 0 -> 82626 bytes .../flowplayer/flowplayer-3.2.12.min.js | 24 + .../flashes/flowplayer/flowplayer-3.2.16.swf | Bin 0 -> 126911 bytes .../flowplayer/flowplayer.controls-3.2.15.swf | Bin 0 -> 38359 bytes .../sitefiles/resources/flashes/focusali.swf | Bin 0 -> 8866 bytes .../resources/flashes/focusviewer.swf | Bin 0 -> 10305 bytes .../resources/flashes/focusviewerbg.png | Bin 0 -> 5895 bytes .../sitefiles/resources/flashes/jwplayer.swf | Bin 0 -> 39836 bytes .../flashes/jwplayer6/jwplayer.flash.swf | Bin 0 -> 138302 bytes .../flashes/jwplayer6/jwplayer.html5.js | 192 + .../resources/flashes/jwplayer6/jwplayer.js | 71 + .../flashes/mediaelement/lang/zh-cn.js | 90 + .../mediaelement-and-player.min.js | 12 + .../mediaelement-flash-audio-ogg.swf | Bin 0 -> 303972 bytes .../mediaelement/mediaelement-flash-audio.swf | Bin 0 -> 4556 bytes .../mediaelement-flash-video-hls.swf | Bin 0 -> 92955 bytes .../mediaelement-flash-video-mdash.swf | Bin 0 -> 401613 bytes .../mediaelement/mediaelement-flash-video.swf | Bin 0 -> 8471 bytes .../flashes/mediaelement/mediaelement.min.js | 12 + .../mediaelementplayer-legacy.min.css | 1 + .../mediaelement/mediaelementplayer.min.css | 1 + .../flashes/mediaelement/mejs-controls.png | Bin 0 -> 2883 bytes .../flashes/mediaelement/mejs-controls.svg | 1 + .../sitefiles/resources/flashes/vcastr3.swf | Bin 0 -> 25414 bytes .../resources/flashes/videojs/captions.vtt | 41 + .../resources/flashes/videojs/video-js.css | 499 ++ .../flashes/videojs/video-js.min.css | 1 + .../resources/flashes/videojs/video-js.png | Bin 0 -> 8235 bytes .../resources/flashes/videojs/video-js.swf | Bin 0 -> 9612 bytes .../resources/flashes/videojs/video.js | 4569 ++++++++++++ .../resources/flashes/videojs/video.min.js | 21 + .../sitefiles/resources/input/loading.html | 1 + .../wwwroot/sitefiles/resources/input/no.html | 1 + .../sitefiles/resources/input/script.js | 49 + .../sitefiles/resources/input/template.html | 4 + .../sitefiles/resources/input/yes.html | 1 + .../sitefiles/resources/jquery/ajaxupload.js | 673 ++ .../bootstrap/css/bootstrap-responsive.css | 1092 +++ .../css/bootstrap-responsive.min.css | 9 + .../jquery/bootstrap/css/bootstrap.css | 6103 +++++++++++++++++ .../jquery/bootstrap/css/bootstrap.min.css | 868 +++ .../img/glyphicons-halflings-white.png | Bin 0 -> 8777 bytes .../bootstrap/img/glyphicons-halflings.png | Bin 0 -> 12799 bytes .../jquery/bootstrap/js/bootstrap.js | 2170 ++++++ .../jquery/bootstrap/js/bootstrap.min.js | 7 + .../jquery/clipboard/jquery.clipboard.js | 1110 +++ .../jquery/clipboard/jquery.clipboard.swf | Bin 0 -> 1923 bytes .../jquery/colorpicker/css/colorpicker.css | 161 + .../jquery/colorpicker/images/blank.gif | Bin 0 -> 49 bytes .../images/colorpicker_background.png | Bin 0 -> 1897 bytes .../colorpicker/images/colorpicker_hex.png | Bin 0 -> 532 bytes .../colorpicker/images/colorpicker_hsb_b.png | Bin 0 -> 970 bytes .../colorpicker/images/colorpicker_hsb_h.png | Bin 0 -> 1012 bytes .../colorpicker/images/colorpicker_hsb_s.png | Bin 0 -> 1171 bytes .../colorpicker/images/colorpicker_indic.gif | Bin 0 -> 86 bytes .../images/colorpicker_overlay.png | Bin 0 -> 10355 bytes .../colorpicker/images/colorpicker_rgb_b.png | Bin 0 -> 970 bytes .../colorpicker/images/colorpicker_rgb_g.png | Bin 0 -> 1069 bytes .../colorpicker/images/colorpicker_rgb_r.png | Bin 0 -> 1066 bytes .../colorpicker/images/colorpicker_select.gif | Bin 0 -> 78 bytes .../colorpicker/images/colorpicker_submit.png | Bin 0 -> 984 bytes .../colorpicker/images/custom_background.png | Bin 0 -> 1916 bytes .../jquery/colorpicker/images/custom_hex.png | Bin 0 -> 562 bytes .../colorpicker/images/custom_hsb_b.png | Bin 0 -> 1097 bytes .../colorpicker/images/custom_hsb_h.png | Bin 0 -> 970 bytes .../colorpicker/images/custom_hsb_s.png | Bin 0 -> 1168 bytes .../colorpicker/images/custom_indic.gif | Bin 0 -> 86 bytes .../colorpicker/images/custom_rgb_b.png | Bin 0 -> 1008 bytes .../colorpicker/images/custom_rgb_g.png | Bin 0 -> 1069 bytes .../colorpicker/images/custom_rgb_r.png | Bin 0 -> 1018 bytes .../colorpicker/images/custom_submit.png | Bin 0 -> 997 bytes .../jquery/colorpicker/images/select.png | Bin 0 -> 506 bytes .../jquery/colorpicker/images/select2.png | Bin 0 -> 518 bytes .../jquery/colorpicker/images/slider.png | Bin 0 -> 315 bytes .../jquery/colorpicker/js/colorpicker.js | 484 ++ .../resources/jquery/fancybox/blank.gif | Bin 0 -> 43 bytes .../resources/jquery/fancybox/fancy_close.png | Bin 0 -> 1517 bytes .../jquery/fancybox/fancy_loading.png | Bin 0 -> 10195 bytes .../jquery/fancybox/fancy_nav_left.png | Bin 0 -> 1446 bytes .../jquery/fancybox/fancy_nav_right.png | Bin 0 -> 1454 bytes .../jquery/fancybox/fancy_shadow_e.png | Bin 0 -> 107 bytes .../jquery/fancybox/fancy_shadow_n.png | Bin 0 -> 106 bytes .../jquery/fancybox/fancy_shadow_ne.png | Bin 0 -> 347 bytes .../jquery/fancybox/fancy_shadow_nw.png | Bin 0 -> 324 bytes .../jquery/fancybox/fancy_shadow_s.png | Bin 0 -> 111 bytes .../jquery/fancybox/fancy_shadow_se.png | Bin 0 -> 352 bytes .../jquery/fancybox/fancy_shadow_sw.png | Bin 0 -> 340 bytes .../jquery/fancybox/fancy_shadow_w.png | Bin 0 -> 103 bytes .../jquery/fancybox/fancy_title_left.png | Bin 0 -> 503 bytes .../jquery/fancybox/fancy_title_main.png | Bin 0 -> 96 bytes .../jquery/fancybox/fancy_title_over.png | Bin 0 -> 70 bytes .../jquery/fancybox/fancy_title_right.png | Bin 0 -> 506 bytes .../resources/jquery/fancybox/fancybox-x.png | Bin 0 -> 203 bytes .../resources/jquery/fancybox/fancybox-y.png | Bin 0 -> 176 bytes .../resources/jquery/fancybox/fancybox.png | Bin 0 -> 15287 bytes .../jquery/fancybox/jquery.easing-1.3.pack.js | 72 + .../jquery/fancybox/jquery.fancybox-1.3.4.css | 359 + .../jquery/fancybox/jquery.fancybox-1.3.4.js | 1156 ++++ .../fancybox/jquery.fancybox-1.3.4.pack.js | 46 + .../fancybox/jquery.mousewheel-3.0.4.pack.js | 14 + .../jquery/jcarousel/jquery.jcarousel.min.js | 16 + .../resources/jquery/jquery-1.11.0.min.js | 4 + .../resources/jquery/jquery-1.4.3.min.js | 166 + .../resources/jquery/jquery-1.8.3.min.js | 2 + .../resources/jquery/jquery-1.9.1.min.js | 5 + .../resources/jquery/jquery-jtemplates.js | 2 + .../sitefiles/resources/jquery/jquery.form.js | 803 +++ .../resources/jquery/jqzoom/css/jqzoom.css | 38 + .../jquery/jqzoom/images/zoomloader.gif | Bin 0 -> 1849 bytes .../resources/jquery/jqzoom/jqzoom.js | 120 + .../resources/jquery/jscolor/arrow.gif | Bin 0 -> 66 bytes .../resources/jquery/jscolor/cross.gif | Bin 0 -> 83 bytes .../resources/jquery/jscolor/demo.html | 12 + .../sitefiles/resources/jquery/jscolor/hs.png | Bin 0 -> 2684 bytes .../sitefiles/resources/jquery/jscolor/hv.png | Bin 0 -> 2865 bytes .../resources/jquery/jscolor/jscolor.js | 997 +++ .../jquery/layer/extend/layer.ext.js | 372 + .../resources/jquery/layer/layer.min.js | 19 + .../jquery/layer/skin/default/icon_ext.png | Bin 0 -> 7677 bytes .../jquery/layer/skin/default/textbg.png | Bin 0 -> 210 bytes .../jquery/layer/skin/default/xubox_ico0.png | Bin 0 -> 32954 bytes .../layer/skin/default/xubox_loading0.gif | Bin 0 -> 5793 bytes .../layer/skin/default/xubox_loading1.gif | Bin 0 -> 701 bytes .../layer/skin/default/xubox_loading2.gif | Bin 0 -> 1787 bytes .../layer/skin/default/xubox_loading3.gif | Bin 0 -> 2364 bytes .../layer/skin/default/xubox_title0.png | Bin 0 -> 221 bytes .../resources/jquery/layer/skin/layer.css | 83 + .../resources/jquery/layer/skin/layer.ext.css | 45 + .../sitefiles/resources/jquery/querystring.js | 37 + .../jquery/showloading/css/showloading.css | 13 + .../showloading/images/loading-bars.gif | Bin 0 -> 3951 bytes .../jquery/showloading/images/loading.gif | Bin 0 -> 2608 bytes .../jquery.showLoading.example.html | 178 + .../jquery/showloading/js/jquery-1.3.2.min.js | 19 + .../showloading/js/jquery.showloading.js | 250 + .../showloading/js/jquery.showloading.min.js | 34 + .../resources/jquery/toastr/toastr.min.css | 1 + .../resources/jquery/toastr/toastr.min.js | 1 + .../sitefiles/resources/jquery/validate.js | 162 + .../wwwroot/sitefiles/resources/loading.gif | Bin 0 -> 381 bytes .../sitefiles/resources/print/print.gif | Bin 0 -> 252 bytes .../sitefiles/resources/print/return.gif | Bin 0 -> 204 bytes .../resources/resume/css/preview.css | 64 + .../sitefiles/resources/resume/css/resume.css | 376 + .../resources/resume/images/bn_aboutbg.jpg | Bin 0 -> 330 bytes .../resources/resume/images/bn_peoplebg.jpg | Bin 0 -> 327 bytes .../resources/resume/images/btn_l.jpg | Bin 0 -> 596 bytes .../resources/resume/images/btn_lo.jpg | Bin 0 -> 581 bytes .../resources/resume/images/btn_r.jpg | Bin 0 -> 1892 bytes .../resources/resume/images/btn_ro.jpg | Bin 0 -> 1834 bytes .../resources/resume/images/btngray_l.jpg | Bin 0 -> 468 bytes .../resources/resume/images/btngray_lo.jpg | Bin 0 -> 476 bytes .../resources/resume/images/btngray_r.jpg | Bin 0 -> 1243 bytes .../resources/resume/images/btngray_ro.jpg | Bin 0 -> 1343 bytes .../resources/resume/images/btns_l.jpg | Bin 0 -> 436 bytes .../resources/resume/images/btns_lo.jpg | Bin 0 -> 451 bytes .../resources/resume/images/btns_r.jpg | Bin 0 -> 1145 bytes .../resources/resume/images/btns_ro.jpg | Bin 0 -> 1186 bytes .../resources/resume/images/container_bg.jpg | Bin 0 -> 382 bytes .../resume/images/container_bottom.jpg | Bin 0 -> 1188 bytes .../resources/resume/images/container_top.jpg | Bin 0 -> 3882 bytes .../resources/resume/images/dot_orange.gif | Bin 0 -> 73 bytes .../resources/resume/images/email.png | Bin 0 -> 47630 bytes .../resources/resume/images/line_dot.gif | Bin 0 -> 13112 bytes .../resources/resume/images/lineshadow.jpg | Bin 0 -> 13573 bytes .../resources/resume/images/pre_resume.jpg | Bin 0 -> 1658 bytes .../resume/images/resume_picture.jpg | Bin 0 -> 3309 bytes .../resume/images/resume_titlebg.jpg | Bin 0 -> 407 bytes .../resources/resume/images/site_path.jpg | Bin 0 -> 12017 bytes .../resources/resume/images/split.gif | Bin 0 -> 62 bytes .../resources/resume/images/topnav_bg.jpg | Bin 0 -> 352 bytes .../sitefiles/resources/resume/index.html | 1171 ++++ .../sitefiles/resources/resume/js/resume.js | 51 + .../sitefiles/resources/resume/template.html | 1116 +++ .../wwwroot/sitefiles/resources/s.gif | Bin 0 -> 43 bytes .../resources/scripts/bairongflash.js | 1 + .../resources/scripts/datepicker/calendar.js | 5 + .../resources/scripts/datepicker/lang/en.js | 14 + .../scripts/datepicker/lang/zh-cn.js | 14 + .../scripts/datepicker/lang/zh-tw.js | 14 + .../scripts/datepicker/skin/WdatePicker.css | 10 + .../scripts/datepicker/skin/datePicker.gif | Bin 0 -> 1043 bytes .../datepicker/skin/default/datepicker.css | 246 + .../scripts/datepicker/skin/default/img.gif | Bin 0 -> 1578 bytes .../scripts/datepicker/skin/whyGreen/bg.jpg | Bin 0 -> 307 bytes .../datepicker/skin/whyGreen/datepicker.css | 256 + .../scripts/datepicker/skin/whyGreen/img.gif | Bin 0 -> 1679 bytes .../scripts/datepicker/wdatepicker.js | 50 + .../sitefiles/resources/scripts/datestring.js | 166 + .../resources/scripts/float/floatleft.js | 33 + .../scripts/float/floatleft_close.js | 49 + .../resources/scripts/float/floatright.js | 33 + .../scripts/float/floatright_close.js | 47 + .../resources/scripts/independent/tw_cn.js | 163 + .../resources/scripts/independent/validate.js | 200 + .../resources/scripts/jquery-1.4.2.js | 154 + .../scripts/lightbox/Images/blank.gif | Bin 0 -> 43 bytes .../scripts/lightbox/Images/close.gif | Bin 0 -> 222 bytes .../scripts/lightbox/Images/closelabel.gif | Bin 0 -> 979 bytes .../scripts/lightbox/Images/loading.gif | Bin 0 -> 2767 bytes .../scripts/lightbox/Images/next.gif | Bin 0 -> 305 bytes .../scripts/lightbox/Images/nextlabel.gif | Bin 0 -> 354 bytes .../scripts/lightbox/Images/prev.gif | Bin 0 -> 307 bytes .../scripts/lightbox/Images/prevlabel.gif | Bin 0 -> 371 bytes .../resources/scripts/lightbox/lightbox.css | 104 + .../resources/scripts/lightbox/lightbox.js | 693 ++ .../sitefiles/resources/scripts/pngfix.js | 29 + .../sitefiles/resources/scripts/print.js | 592 ++ .../sitefiles/resources/scripts/print_uft8.js | 592 ++ .../resources/scripts/slide/fullscreen.swf | Bin 0 -> 44799 bytes .../scripts/slide/images/arr_left.cur | Bin 0 -> 2238 bytes .../scripts/slide/images/arr_right.cur | Bin 0 -> 2238 bytes .../resources/scripts/slide/images/e_m_01.png | Bin 0 -> 22651 bytes .../resources/scripts/slide/images/e_m_02.png | Bin 0 -> 703 bytes .../resources/scripts/slide/images/e_m_03.gif | Bin 0 -> 72 bytes .../resources/scripts/slide/images/e_m_05.gif | Bin 0 -> 155 bytes .../resources/scripts/slide/images/e_m_06.png | Bin 0 -> 1210 bytes .../resources/scripts/slide/images/e_m_07.gif | Bin 0 -> 926 bytes .../scripts/slide/images/fullScreen2.png | Bin 0 -> 9100 bytes .../scripts/slide/images/loading_01.gif | Bin 0 -> 1787 bytes .../scripts/slide/images/unfcn_mj_01.png | Bin 0 -> 769 bytes .../resources/scripts/slide/script.js | 1352 ++++ .../resources/scripts/slide/style.css | 233 + .../resources/scripts/slide/template.html | 165 + .../resources/scripts/stl/pagescript.js | 355 + .../resources/scripts/stl/userscript.js | 172 + .../sitefiles/resources/scripts/swfobject.js | 8 + .../sitefiles/resources/scripts/tabstrip.js | 45 + .../sitefiles/resources/scripts/validate.js | 219 + .../resources/scripts/wz_tooltip.v3.33.js | 477 ++ .../sitefiles/resources/search/loading.html | 1 + .../sitefiles/resources/search/no.html | 1 + .../sitefiles/resources/search/yes.html | 21 + .../sitefiles/resources/star/script.js | 40 + .../sitefiles/resources/star/style1.css | 5 + .../sitefiles/resources/star/style1_off.gif | Bin 0 -> 411 bytes .../sitefiles/resources/star/style1_on.gif | Bin 0 -> 1378 bytes .../sitefiles/resources/star/style2.css | 1 + .../sitefiles/resources/star/style2_off.gif | Bin 0 -> 881 bytes .../sitefiles/resources/star/style2_on.gif | Bin 0 -> 884 bytes .../sitefiles/resources/star/style3.css | 7 + .../sitefiles/resources/star/style3_off.gif | Bin 0 -> 730 bytes .../sitefiles/resources/star/style3_on.gif | Bin 0 -> 727 bytes .../sitefiles/resources/tags/default.css | 41 + .../sitefiles/resources/tree/brand.gif | Bin 0 -> 1049 bytes .../sitefiles/resources/tree/category.gif | Bin 0 -> 375 bytes .../sitefiles/resources/tree/content.gif | Bin 0 -> 604 bytes .../sitefiles/resources/tree/content.png | Bin 0 -> 342 bytes .../sitefiles/resources/tree/department.gif | Bin 0 -> 1031 bytes .../wwwroot/sitefiles/resources/tree/dot.gif | Bin 0 -> 316 bytes .../sitefiles/resources/tree/empty.gif | Bin 0 -> 135 bytes .../sitefiles/resources/tree/feedback.gif | Bin 0 -> 926 bytes .../sitefiles/resources/tree/folder.gif | Bin 0 -> 400 bytes .../sitefiles/resources/tree/goods.gif | Bin 0 -> 996 bytes .../sitefiles/resources/tree/goods.png | Bin 0 -> 421 bytes .../sitefiles/resources/tree/govInteract.gif | Bin 0 -> 354 bytes .../sitefiles/resources/tree/govpublic.gif | Bin 0 -> 581 bytes .../sitefiles/resources/tree/image.gif | Bin 0 -> 389 bytes .../resources/tree/itemContainer.gif | Bin 0 -> 970 bytes .../wwwroot/sitefiles/resources/tree/job.gif | Bin 0 -> 596 bytes .../sitefiles/resources/tree/minus.gif | Bin 0 -> 316 bytes .../sitefiles/resources/tree/minus.png | Bin 0 -> 2924 bytes .../wwwroot/sitefiles/resources/tree/open.png | Bin 0 -> 249 bytes .../sitefiles/resources/tree/openedfolder.gif | Bin 0 -> 381 bytes .../sitefiles/resources/tree/photo.gif | Bin 0 -> 600 bytes .../wwwroot/sitefiles/resources/tree/plus.gif | Bin 0 -> 317 bytes .../wwwroot/sitefiles/resources/tree/plus.png | Bin 0 -> 2932 bytes .../wwwroot/sitefiles/resources/tree/site.gif | Bin 0 -> 1077 bytes .../sitefiles/resources/tree/siteHQ.gif | Bin 0 -> 967 bytes .../sitefiles/resources/tree/subsite2.gif | Bin 0 -> 1080 bytes .../sitefiles/resources/tree/subsite3.gif | Bin 0 -> 1079 bytes .../sitefiles/resources/tree/subsite4.gif | Bin 0 -> 1081 bytes .../sitefiles/resources/tree/subsite5.gif | Bin 0 -> 1080 bytes .../sitefiles/resources/tree/subsite6.gif | Bin 0 -> 1079 bytes .../sitefiles/resources/tree/subsite7.gif | Bin 0 -> 1080 bytes .../sitefiles/resources/tree/subsite8.gif | Bin 0 -> 1079 bytes .../sitefiles/resources/tree/subsite9.gif | Bin 0 -> 1078 bytes .../sitefiles/resources/tree/teleplay.gif | Bin 0 -> 1685 bytes .../sitefiles/resources/tree/tree_bottom.gif | Bin 0 -> 111 bytes .../sitefiles/resources/tree/tree_empty.gif | Bin 0 -> 135 bytes .../sitefiles/resources/tree/tree_line.gif | Bin 0 -> 140 bytes .../sitefiles/resources/tree/tree_middle.gif | Bin 0 -> 76 bytes .../resources/tree/tree_minusbottom.gif | Bin 0 -> 125 bytes .../resources/tree/tree_minusmiddle.gif | Bin 0 -> 97 bytes .../resources/tree/tree_plusbottom.gif | Bin 0 -> 130 bytes .../resources/tree/tree_plusmiddle.gif | Bin 0 -> 92 bytes .../wwwroot/sitefiles/resources/tree/vote.gif | Bin 0 -> 570 bytes .../sitefiles/resources/vote/css/style.css | Bin 0 -> 219308 bytes .../sitefiles/resources/vote/css/vote.css | 80 + .../sitefiles/resources/vote/images/bg_16.gif | Bin 0 -> 3834 bytes .../sitefiles/resources/vote/images/bg_17.gif | Bin 0 -> 3986 bytes .../resources/vote/images/bg_column_1.gif | Bin 0 -> 3736 bytes .../resources/vote/images/bg_column_2.gif | Bin 0 -> 3736 bytes .../resources/vote/images/bg_column_3.gif | Bin 0 -> 3736 bytes .../resources/vote/images/bg_column_4.gif | Bin 0 -> 3736 bytes .../resources/vote/images/bg_column_5.gif | Bin 0 -> 3736 bytes .../resources/vote/images/bg_column_6.gif | Bin 0 -> 3736 bytes .../resources/vote/images/bg_column_7.gif | Bin 0 -> 3736 bytes .../resources/vote/images/bg_column_8.gif | Bin 0 -> 3736 bytes .../sitefiles/resources/vote/images/but_9.gif | Bin 0 -> 2546 bytes .../resources/vote/images/ico_warn.png | Bin 0 -> 11654 bytes .../resources/vote/inputTemplate.html | 31 + .../sitefiles/resources/vote/js/vote.js | 56 + .../resources/vuejs/element-ui/index.js | 1 + .../theme-chalk/fonts/element-icons.ttf | Bin 0 -> 55956 bytes .../theme-chalk/fonts/element-icons.woff | Bin 0 -> 28200 bytes .../vuejs/element-ui/theme-chalk/index.css | 1 + .../resources/vuejs/vue-2.5.16.min.js | 6 + .../wwwroot/sitefiles/resources/waiting.gif | Bin 0 -> 10819 bytes src/SSCMS/Models/Config.cs | 4 - src/SSCMS/Parse/ParsePage.cs | 114 +- src/SSCMS/Parse/Resources.cs | 153 + src/SSCMS/Parse/SiteFilesAssets.cs | 192 - src/SSCMS/Plugins/IPluginAfterStlParse.cs | 4 +- .../Plugins/IPluginAfterStlParseAsync.cs | 9 + src/SSCMS/Services/IPathManager.Api.cs | 40 - src/SSCMS/Services/IPathManager.Root.cs | 74 + src/SSCMS/Services/IPathManager.Site.cs | 32 +- src/SSCMS/Services/IPathManager.SiteFiles.cs | 37 - src/SSCMS/Services/ISettingsManager.cs | 3 +- src/SSCMS/Utils/Constants.cs | 3 +- src/SSCMS/Utils/FileUtils.cs | 18 + src/SSCMS/Utils/PathUtils.cs | 12 + .../IntegrationTestsFixture.cs | 2 +- tests/SSCMS.Tests/UnitTestsFixture.cs | 2 +- 428 files changed, 34417 insertions(+), 1233 deletions(-) create mode 100644 src/SSCMS.Cli/Abstractions/IApplication.cs delete mode 100644 src/SSCMS.Core/Services/PathManager.Api.cs create mode 100644 src/SSCMS.Core/Services/PathManager.Root.cs delete mode 100644 src/SSCMS.Core/Services/PathManager.SiteFiles.cs create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/components/jquery-1.9.1.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/components/js.cookie.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/components/lodash-4.17.4.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/components/stlclient.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/default_avatar.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/dynamic/script.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/audiojs/audio.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/audiojs/audiojs.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/audiojs/player-graphics.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/bcastr31.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/brplayer/player.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/flowplayer/flowplayer-3.2.12.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/flowplayer/flowplayer-3.2.16.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/flowplayer/flowplayer.controls-3.2.15.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/focusali.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/focusviewer.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/focusviewerbg.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/jwplayer.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/jwplayer6/jwplayer.flash.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/jwplayer6/jwplayer.html5.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/jwplayer6/jwplayer.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/mediaelement/lang/zh-cn.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/mediaelement/mediaelement-and-player.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/mediaelement/mediaelement-flash-audio-ogg.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/mediaelement/mediaelement-flash-audio.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/mediaelement/mediaelement-flash-video-hls.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/mediaelement/mediaelement-flash-video-mdash.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/mediaelement/mediaelement-flash-video.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/mediaelement/mediaelement.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/mediaelement/mediaelementplayer-legacy.min.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/mediaelement/mediaelementplayer.min.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/mediaelement/mejs-controls.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/mediaelement/mejs-controls.svg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/vcastr3.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/videojs/captions.vtt create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/videojs/video-js.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/videojs/video-js.min.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/videojs/video-js.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/videojs/video-js.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/videojs/video.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/flashes/videojs/video.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/input/loading.html create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/input/no.html create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/input/script.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/input/template.html create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/input/yes.html create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/ajaxupload.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/bootstrap/css/bootstrap-responsive.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/bootstrap/css/bootstrap-responsive.min.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/bootstrap/css/bootstrap.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/bootstrap/css/bootstrap.min.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/bootstrap/img/glyphicons-halflings-white.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/bootstrap/img/glyphicons-halflings.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/bootstrap/js/bootstrap.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/bootstrap/js/bootstrap.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/clipboard/jquery.clipboard.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/clipboard/jquery.clipboard.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/css/colorpicker.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/blank.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/colorpicker_background.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/colorpicker_hex.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/colorpicker_hsb_b.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/colorpicker_hsb_h.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/colorpicker_hsb_s.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/colorpicker_indic.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/colorpicker_overlay.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/colorpicker_rgb_b.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/colorpicker_rgb_g.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/colorpicker_rgb_r.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/colorpicker_select.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/colorpicker_submit.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/custom_background.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/custom_hex.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/custom_hsb_b.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/custom_hsb_h.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/custom_hsb_s.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/custom_indic.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/custom_rgb_b.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/custom_rgb_g.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/custom_rgb_r.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/custom_submit.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/select.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/select2.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/images/slider.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/colorpicker/js/colorpicker.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/blank.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancy_close.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancy_loading.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancy_nav_left.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancy_nav_right.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancy_shadow_e.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancy_shadow_n.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancy_shadow_ne.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancy_shadow_nw.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancy_shadow_s.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancy_shadow_se.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancy_shadow_sw.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancy_shadow_w.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancy_title_left.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancy_title_main.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancy_title_over.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancy_title_right.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancybox-x.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancybox-y.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/fancybox.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/jquery.easing-1.3.pack.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/jquery.fancybox-1.3.4.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/jquery.fancybox-1.3.4.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/jquery.fancybox-1.3.4.pack.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/fancybox/jquery.mousewheel-3.0.4.pack.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/jcarousel/jquery.jcarousel.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/jquery-1.11.0.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/jquery-1.4.3.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/jquery-1.8.3.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/jquery-1.9.1.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/jquery-jtemplates.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/jquery.form.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/jqzoom/css/jqzoom.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/jqzoom/images/zoomloader.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/jqzoom/jqzoom.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/jscolor/arrow.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/jscolor/cross.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/jscolor/demo.html create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/jscolor/hs.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/jscolor/hv.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/jscolor/jscolor.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/layer/extend/layer.ext.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/layer/layer.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/layer/skin/default/icon_ext.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/layer/skin/default/textbg.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/layer/skin/default/xubox_ico0.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/layer/skin/default/xubox_loading0.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/layer/skin/default/xubox_loading1.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/layer/skin/default/xubox_loading2.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/layer/skin/default/xubox_loading3.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/layer/skin/default/xubox_title0.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/layer/skin/layer.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/layer/skin/layer.ext.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/querystring.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/showloading/css/showloading.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/showloading/images/loading-bars.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/showloading/images/loading.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/showloading/jquery.showLoading.example.html create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/showloading/js/jquery-1.3.2.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/showloading/js/jquery.showloading.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/showloading/js/jquery.showloading.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/toastr/toastr.min.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/toastr/toastr.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/jquery/validate.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/loading.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/print/print.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/print/return.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/css/preview.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/css/resume.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/bn_aboutbg.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/bn_peoplebg.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/btn_l.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/btn_lo.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/btn_r.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/btn_ro.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/btngray_l.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/btngray_lo.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/btngray_r.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/btngray_ro.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/btns_l.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/btns_lo.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/btns_r.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/btns_ro.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/container_bg.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/container_bottom.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/container_top.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/dot_orange.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/email.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/line_dot.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/lineshadow.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/pre_resume.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/resume_picture.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/resume_titlebg.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/site_path.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/split.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/images/topnav_bg.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/index.html create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/js/resume.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/resume/template.html create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/s.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/bairongflash.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/datepicker/calendar.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/datepicker/lang/en.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/datepicker/lang/zh-cn.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/datepicker/lang/zh-tw.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/datepicker/skin/WdatePicker.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/datepicker/skin/datePicker.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/datepicker/skin/default/datepicker.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/datepicker/skin/default/img.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/datepicker/skin/whyGreen/bg.jpg create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/datepicker/skin/whyGreen/datepicker.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/datepicker/skin/whyGreen/img.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/datepicker/wdatepicker.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/datestring.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/float/floatleft.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/float/floatleft_close.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/float/floatright.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/float/floatright_close.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/independent/tw_cn.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/independent/validate.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/jquery-1.4.2.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/lightbox/Images/blank.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/lightbox/Images/close.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/lightbox/Images/closelabel.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/lightbox/Images/loading.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/lightbox/Images/next.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/lightbox/Images/nextlabel.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/lightbox/Images/prev.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/lightbox/Images/prevlabel.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/lightbox/lightbox.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/lightbox/lightbox.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/pngfix.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/print.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/print_uft8.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/slide/fullscreen.swf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/slide/images/arr_left.cur create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/slide/images/arr_right.cur create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/slide/images/e_m_01.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/slide/images/e_m_02.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/slide/images/e_m_03.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/slide/images/e_m_05.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/slide/images/e_m_06.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/slide/images/e_m_07.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/slide/images/fullScreen2.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/slide/images/loading_01.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/slide/images/unfcn_mj_01.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/slide/script.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/slide/style.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/slide/template.html create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/stl/pagescript.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/stl/userscript.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/swfobject.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/tabstrip.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/validate.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/scripts/wz_tooltip.v3.33.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/search/loading.html create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/search/no.html create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/search/yes.html create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/star/script.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/star/style1.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/star/style1_off.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/star/style1_on.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/star/style2.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/star/style2_off.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/star/style2_on.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/star/style3.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/star/style3_off.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/star/style3_on.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tags/default.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/brand.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/category.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/content.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/content.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/department.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/dot.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/empty.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/feedback.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/folder.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/goods.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/goods.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/govInteract.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/govpublic.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/image.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/itemContainer.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/job.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/minus.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/minus.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/open.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/openedfolder.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/photo.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/plus.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/plus.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/site.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/siteHQ.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/subsite2.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/subsite3.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/subsite4.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/subsite5.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/subsite6.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/subsite7.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/subsite8.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/subsite9.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/teleplay.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/tree_bottom.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/tree_empty.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/tree_line.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/tree_middle.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/tree_minusbottom.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/tree_minusmiddle.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/tree_plusbottom.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/tree_plusmiddle.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/tree/vote.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vote/css/style.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vote/css/vote.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vote/images/bg_16.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vote/images/bg_17.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vote/images/bg_column_1.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vote/images/bg_column_2.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vote/images/bg_column_3.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vote/images/bg_column_4.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vote/images/bg_column_5.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vote/images/bg_column_6.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vote/images/bg_column_7.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vote/images/bg_column_8.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vote/images/but_9.gif create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vote/images/ico_warn.png create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vote/inputTemplate.html create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vote/js/vote.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vuejs/element-ui/index.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vuejs/element-ui/theme-chalk/fonts/element-icons.ttf create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vuejs/element-ui/theme-chalk/fonts/element-icons.woff create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vuejs/element-ui/theme-chalk/index.css create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/vuejs/vue-2.5.16.min.js create mode 100644 src/SSCMS.Web/wwwroot/sitefiles/resources/waiting.gif create mode 100644 src/SSCMS/Parse/Resources.cs delete mode 100644 src/SSCMS/Parse/SiteFilesAssets.cs create mode 100644 src/SSCMS/Plugins/IPluginAfterStlParseAsync.cs delete mode 100644 src/SSCMS/Services/IPathManager.Api.cs create mode 100644 src/SSCMS/Services/IPathManager.Root.cs delete mode 100644 src/SSCMS/Services/IPathManager.SiteFiles.cs diff --git a/src/SSCMS.Cli/Abstractions/IApplication.cs b/src/SSCMS.Cli/Abstractions/IApplication.cs new file mode 100644 index 000000000..49c36573d --- /dev/null +++ b/src/SSCMS.Cli/Abstractions/IApplication.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using Quartz; + +namespace SSCMS.Cli.Abstractions +{ + public interface IApplication + { + Task RunAsync(string[] args); + + Task RunExecuteAsync(string commandName, string[] commandArgs, string[] commandExtras, + IJobExecutionContext jobContext); + } +} diff --git a/src/SSCMS.Cli/Application.cs b/src/SSCMS.Cli/Application.cs index 217fbb717..56a91e62e 100644 --- a/src/SSCMS.Cli/Application.cs +++ b/src/SSCMS.Cli/Application.cs @@ -1,17 +1,20 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; +using System.Linq; using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; using Mono.Options; using Quartz; using Quartz.Impl; +using SSCMS.Cli.Abstractions; using SSCMS.Cli.Core; using SSCMS.Services; using SSCMS.Utils; namespace SSCMS.Cli { - public class Application + public class Application : IApplication { private bool _isHelp; private string _repeat; @@ -22,10 +25,12 @@ public class Application public static string[] CommandExtras { get; private set; } private readonly ISettingsManager _settingsManager; + private readonly IPluginManager _pluginManager; - public Application(ISettingsManager settingsManager) + public Application(ISettingsManager settingsManager, IPluginManager pluginManager) { _settingsManager = settingsManager; + _pluginManager = pluginManager; _options = new OptionSet { { "r|repeat=", "schedule CRON expression", @@ -39,7 +44,7 @@ public async Task RunAsync(string[] args) { if (!CliUtils.ParseArgs(_options, args)) return; - var jobServiceCommandNames = CliUtils.GetJobServiceCommandNames(); + var jobServiceCommandNames = GetJobServiceCommandNames(); var isJobService = false; var commandName = string.Empty; @@ -115,10 +120,10 @@ private async Task RunHelpAsync(string commandName) { if (_isHelp || string.IsNullOrEmpty(commandName)) { - await WriteUtils.PrintInfoAsync(_settingsManager); + await Console.Out.WriteLineAsync("Welcome to SSCMS Command Line"); await Console.Out.WriteLineAsync(); - var services = CliUtils.GetJobServices(); + var services = GetJobServices(); foreach (var service in services) { await WriteUtils.PrintRowLine(); @@ -171,7 +176,7 @@ public async Task RunExecuteAsync(string commandName, string[] commandArgs, stri { try { - var service = CliUtils.GetJobService(commandName); + var service = GetJobService(commandName); if (service != null) { var context = new JobContext(commandName, commandArgs, commandExtras, jobContext); @@ -195,5 +200,25 @@ public async Task RunExecuteAsync(string commandName, string[] commandArgs, stri //}); } } + + private IJobService GetJobService(string commandName) + { + var provider = _settingsManager.BuildServiceProvider(); + var services = provider.GetServices(); + return services.FirstOrDefault(x => StringUtils.EqualsIgnoreCase(x.CommandName, commandName)); + } + + private List GetJobServiceCommandNames() + { + var provider = _settingsManager.BuildServiceProvider(); + var services = provider.GetServices(); + return services.Select(x => x.CommandName).ToList(); + } + + private IEnumerable GetJobServices() + { + var provider = _settingsManager.BuildServiceProvider(); + return provider.GetServices(); + } } } \ No newline at end of file diff --git a/src/SSCMS.Cli/Core/CliUtils.cs b/src/SSCMS.Cli/Core/CliUtils.cs index 1a3c85545..44894c862 100644 --- a/src/SSCMS.Cli/Core/CliUtils.cs +++ b/src/SSCMS.Cli/Core/CliUtils.cs @@ -1,10 +1,7 @@ using System.Collections.Generic; -using System.Linq; using System.Text; using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; using Mono.Options; -using SSCMS.Cli.Abstractions; using SSCMS.Services; using SSCMS.Utils; @@ -12,34 +9,6 @@ namespace SSCMS.Cli.Core { public static class CliUtils { - private static ServiceProvider Provider { get; set; } - public static void SetProvider(ServiceProvider provider) - { - Provider = provider; - } - - public static Application GetApplication() - { - return Provider.GetRequiredService(); - } - - public static IJobService GetJobService(string commandName) - { - var services = Provider.GetServices(); - return services.FirstOrDefault(x => StringUtils.EqualsIgnoreCase(x.CommandName, commandName)); - } - - public static List GetJobServiceCommandNames() - { - var services = Provider.GetServices(); - return services.Select(x => x.CommandName).ToList(); - } - - public static IEnumerable GetJobServices() - { - return Provider.GetServices(); - } - // https://stackoverflow.com/questions/491595/best-way-to-parse-command-line-arguments-in-c public static bool ParseArgs(OptionSet options, string[] args) { @@ -110,7 +79,7 @@ public static string GetWebConfigPath(string configFile, ISettingsManager settin public static bool IsSsCmsExists(string directoryPath) { - return FileUtils.IsFileExists(PathUtils.Combine(directoryPath, Constants.ConfigFileName)) && FileUtils.IsFileExists(PathUtils.Combine(directoryPath, "appsettings.json")) && DirectoryUtils.IsDirectoryExists("wwwroot"); + return FileUtils.IsFileExists(PathUtils.Combine(directoryPath, Constants.ConfigFileName)) && FileUtils.IsFileExists(PathUtils.Combine(directoryPath, "appsettings.json")) && DirectoryUtils.IsDirectoryExists(Constants.WwwrootDirectory); } public static string GetOsUserConfigFilePath() diff --git a/src/SSCMS.Cli/Core/SchedulerJob.cs b/src/SSCMS.Cli/Core/SchedulerJob.cs index 9069c1429..13596b436 100644 --- a/src/SSCMS.Cli/Core/SchedulerJob.cs +++ b/src/SSCMS.Cli/Core/SchedulerJob.cs @@ -8,8 +8,7 @@ internal class SchedulerJob : IJob { public async Task Execute(IJobExecutionContext context) { - var application = CliUtils.GetApplication(); - await application.RunExecuteAsync(Application.CommandName, Application.CommandArgs, Application.CommandExtras, context); + await Program.Application.RunExecuteAsync(Application.CommandName, Application.CommandArgs, Application.CommandExtras, context); if (context.NextFireTimeUtc != null) { diff --git a/src/SSCMS.Cli/Core/WriteUtils.cs b/src/SSCMS.Cli/Core/WriteUtils.cs index 6fec304d8..ac752466f 100644 --- a/src/SSCMS.Cli/Core/WriteUtils.cs +++ b/src/SSCMS.Cli/Core/WriteUtils.cs @@ -1,10 +1,6 @@ using System; -using System.Reflection; +using System.Linq; using System.Threading.Tasks; -using Datory; -using SSCMS.Cli.Models; -using SSCMS.Services; -using SSCMS.Utils; namespace SSCMS.Cli.Core { @@ -13,12 +9,9 @@ public static class WriteUtils public static async Task PrintSuccessAsync(string successMessage) { var backgroundColor = Console.BackgroundColor; - //var foregroundColor = Console.ForegroundColor; Console.BackgroundColor = ConsoleColor.DarkGreen; - //Console.ForegroundColor = ConsoleColor.Black; await Console.Out.WriteAsync(" SUCCESS "); Console.BackgroundColor = backgroundColor; - //Console.ForegroundColor = foregroundColor; await Console.Out.WriteAsync($" {successMessage}"); } @@ -26,32 +19,13 @@ public static async Task PrintSuccessAsync(string successMessage) public static async Task PrintErrorAsync(string errorMessage) { var backgroundColor = Console.BackgroundColor; - //var foregroundColor = Console.ForegroundColor; Console.BackgroundColor = ConsoleColor.DarkRed; - //Console.ForegroundColor = ConsoleColor.Black; await Console.Out.WriteAsync(" ERROR "); Console.BackgroundColor = backgroundColor; - //Console.ForegroundColor = foregroundColor; await Console.Out.WriteAsync($" {errorMessage}"); } - public static async Task PrintInfoAsync(ISettingsManager settingsManager) - { - await Console.Out.WriteLineAsync($"Cli version: {settingsManager.Version}"); - var entryAssembly = Assembly.GetExecutingAssembly(); - await Console.Out.WriteLineAsync($"Cli location: {entryAssembly.Location}"); - await Console.Out.WriteLineAsync($"Work location: {settingsManager.ContentRootPath}"); - - var configPath = PathUtils.Combine(settingsManager.ContentRootPath, Constants.ConfigFileName); - - if (FileUtils.IsFileExists(configPath)) - { - await Console.Out.WriteLineAsync($"Database type: {settingsManager.Database.DatabaseType.GetDisplayName()}"); - await Console.Out.WriteLineAsync($"Database connection string: {settingsManager.DatabaseConnectionString}"); - } - } - public static async Task PrintRowLineAsync() { await Console.Out.WriteLineAsync(new string('-', CliConstants.ConsoleTableWidth)); @@ -59,13 +33,8 @@ public static async Task PrintRowLineAsync() public static async Task PrintRowAsync(params string[] columns) { - int width = (CliConstants.ConsoleTableWidth - columns.Length) / columns.Length; - string row = "|"; - - foreach (string column in columns) - { - row += AlignCentre(column, width) + "|"; - } + var width = (CliConstants.ConsoleTableWidth - columns.Length) / columns.Length; + var row = columns.Aggregate("|", (current, column) => current + AlignCentre(column, width) + "|"); await Console.Out.WriteLineAsync(row); } @@ -86,13 +55,8 @@ private static string AlignCentre(string text, int width) public static async Task PrintRow(params string[] columns) { - int width = (CliConstants.ConsoleTableWidth - columns.Length) / columns.Length; - string row = "|"; - - foreach (string column in columns) - { - row += AlignCentre(column, width) + "|"; - } + var width = (CliConstants.ConsoleTableWidth - columns.Length) / columns.Length; + var row = columns.Aggregate("|", (current, column) => current + AlignCentre(column, width) + "|"); await Console.Out.WriteLineAsync(row); } diff --git a/src/SSCMS.Cli/Jobs/InstallSsCmsJob.cs b/src/SSCMS.Cli/Jobs/InstallSsCmsJob.cs index 2c32cee27..5e730f595 100644 --- a/src/SSCMS.Cli/Jobs/InstallSsCmsJob.cs +++ b/src/SSCMS.Cli/Jobs/InstallSsCmsJob.cs @@ -101,7 +101,7 @@ public async Task ExecuteAsync(IJobContext context) return; } - await FileUtils.WriteTextAsync(_pathManager.GetWebRootPath("index.html"), Constants.Html5Empty); + await FileUtils.WriteTextAsync(_pathManager.GetRootPath("index.html"), Constants.Html5Empty); await WriteUtils.PrintSuccessAsync("Congratulations, SS CMS was installed successfully!"); } diff --git a/src/SSCMS.Cli/Jobs/StatusJob.cs b/src/SSCMS.Cli/Jobs/StatusJob.cs index 6f6e93ac4..b15545268 100644 --- a/src/SSCMS.Cli/Jobs/StatusJob.cs +++ b/src/SSCMS.Cli/Jobs/StatusJob.cs @@ -1,9 +1,12 @@ using System; +using System.Reflection; using System.Threading.Tasks; +using Datory; using Mono.Options; using SSCMS.Cli.Abstractions; using SSCMS.Cli.Core; using SSCMS.Services; +using SSCMS.Utils; namespace SSCMS.Cli.Jobs { @@ -14,12 +17,14 @@ public class StatusJob : IJobService private bool _isHelp; private readonly ISettingsManager _settingsManager; + private readonly IPluginManager _pluginManager; private readonly IApiService _apiService; private readonly OptionSet _options; - public StatusJob(ISettingsManager settingsManager, IApiService apiService) + public StatusJob(ISettingsManager settingsManager, IPluginManager pluginManager, IApiService apiService) { _settingsManager = settingsManager; + _pluginManager = pluginManager; _apiService = apiService; _options = new OptionSet { @@ -49,7 +54,24 @@ public async Task ExecuteAsync(IJobContext context) return; } - await WriteUtils.PrintInfoAsync(_settingsManager); + await Console.Out.WriteLineAsync($"Cli version: {_settingsManager.Version}"); + var entryAssembly = Assembly.GetExecutingAssembly(); + await Console.Out.WriteLineAsync($"Cli location: {entryAssembly.Location}"); + await Console.Out.WriteLineAsync($"Work location: {_settingsManager.ContentRootPath}"); + + var configPath = PathUtils.Combine(_settingsManager.ContentRootPath, Constants.ConfigFileName); + + if (FileUtils.IsFileExists(configPath)) + { + await Console.Out.WriteLineAsync($"Database type: {_settingsManager.Database.DatabaseType.GetDisplayName()}"); + await Console.Out.WriteLineAsync($"Database connection string: {_settingsManager.DatabaseConnectionString}"); + } + + var plugins = _pluginManager.Plugins; + foreach (var plugin in plugins) + { + await Console.Out.WriteLineAsync($"PluginId: {plugin.PluginId}, Version: {plugin.Version}"); + } var (status, _) = _apiService.GetStatus(); if (status != null) diff --git a/src/SSCMS.Cli/Program.cs b/src/SSCMS.Cli/Program.cs index eab3355ca..23651dc07 100644 --- a/src/SSCMS.Cli/Program.cs +++ b/src/SSCMS.Cli/Program.cs @@ -13,11 +13,14 @@ using SSCMS.Core.Plugins.Extensions; using SSCMS.Utils; using Serilog; +using SSCMS.Cli.Abstractions; namespace SSCMS.Cli { internal static class Program { + public static IApplication Application { get; private set; } + static async Task Main(string[] args) { try @@ -59,12 +62,11 @@ static async Task Main(string[] args) var entryAssembly = Assembly.GetExecutingAssembly(); var assemblies = new List { entryAssembly }.Concat(entryAssembly.GetReferencedAssemblies().Select(Assembly.Load)); - var settingsManager = services.AddSettingsManager(configuration, contentRootPath, PathUtils.Combine(contentRootPath, "wwwroot"), entryAssembly); - services.AddPlugins(configuration, settingsManager); + var settingsManager = services.AddSettingsManager(configuration, contentRootPath, PathUtils.Combine(contentRootPath, Constants.WwwrootDirectory), entryAssembly); + var pluginManager = services.AddPlugins(configuration, settingsManager); - var application = new Application(settingsManager); + Application = new Application(settingsManager, pluginManager); services.AddSingleton(configuration); - services.AddSingleton(application); services.AddCache(settingsManager.Redis.ConnectionString); services.AddRepositories(assemblies); @@ -72,11 +74,7 @@ static async Task Main(string[] args) services.AddCliServices(); services.AddCliJobs(); - var provider = services.BuildServiceProvider(); - - CliUtils.SetProvider(provider); - - await application.RunAsync(args); + await Application.RunAsync(args); //try //{ diff --git a/src/SSCMS.Cli/Services/ApiService.cs b/src/SSCMS.Cli/Services/ApiService.cs index 793a57605..d6d5656be 100644 --- a/src/SSCMS.Cli/Services/ApiService.cs +++ b/src/SSCMS.Cli/Services/ApiService.cs @@ -81,7 +81,7 @@ public ApiService(IConfigService configService) var response = client.Execute(request); if (!response.IsSuccessful) { - return (false, $"your account or password was incorrect, status code: {response.StatusDescription}"); + return (false, "your account or password was incorrect"); } var loginResult = response.Data; diff --git a/src/SSCMS.Core/Plugins/CloudUtils.cs b/src/SSCMS.Core/Plugins/CloudUtils.cs index 65296f4a7..ca55b9e35 100644 --- a/src/SSCMS.Core/Plugins/CloudUtils.cs +++ b/src/SSCMS.Core/Plugins/CloudUtils.cs @@ -22,7 +22,7 @@ public static string GetPluginUrl(string pluginId) public static class Api { //private const string Host = "https://api.sscms.com"; - private const string Host = "https://localhost:6001"; + private const string Host = "https://localhost:81"; public static string GetCliUrl(string relatedUrl) { diff --git a/src/SSCMS.Core/Plugins/Plugin.cs b/src/SSCMS.Core/Plugins/Plugin.cs index 67dd89e93..12c440e86 100644 --- a/src/SSCMS.Core/Plugins/Plugin.cs +++ b/src/SSCMS.Core/Plugins/Plugin.cs @@ -14,7 +14,7 @@ public class Plugin : IPlugin public Plugin(string folderPath, bool reloadOnChange) { ContentRootPath = folderPath; - WebRootPath = PathUtils.Combine(folderPath, "wwwroot"); + WebRootPath = PathUtils.Combine(folderPath, Constants.WwwrootDirectory); var builder = new ConfigurationBuilder() .SetBasePath(folderPath) .AddJsonFile(Constants.PackageFileName, optional: false, reloadOnChange: reloadOnChange); diff --git a/src/SSCMS.Core/Services/OldPluginManager.Menu.cs b/src/SSCMS.Core/Services/OldPluginManager.Menu.cs index 1e26e3093..e903e4f1e 100644 --- a/src/SSCMS.Core/Services/OldPluginManager.Menu.cs +++ b/src/SSCMS.Core/Services/OldPluginManager.Menu.cs @@ -147,12 +147,13 @@ private string GetMenuHref(string pluginId, string href, int siteId, int channel return href; } - var url = PageUtils.AddQueryStringIfNotExists(_pathManager.ParsePluginUrl(pluginId, href), new NameValueCollection - { - {"v", StringUtils.GetRandomInt(1, 1000).ToString()}, - {"pluginId", pluginId}, - {"apiUrl", _pathManager.InnerApiUrl} - }); + //var url = PageUtils.AddQueryStringIfNotExists(_pathManager.ParsePluginUrl(pluginId, href), new NameValueCollection + //{ + // {"v", StringUtils.GetRandomInt(1, 1000).ToString()}, + // {"pluginId", pluginId}, + // {"apiUrl", _pathManager.InnerApiUrl} + //}); + var url = string.Empty; if (siteId > 0) { url = PageUtils.AddQueryStringIfNotExists(url, new NameValueCollection diff --git a/src/SSCMS.Core/Services/ParseManager.cs b/src/SSCMS.Core/Services/ParseManager.cs index b843dbfc8..20b09c9fd 100644 --- a/src/SSCMS.Core/Services/ParseManager.cs +++ b/src/SSCMS.Core/Services/ParseManager.cs @@ -85,6 +85,23 @@ await AddStlErrorLogAsync(nameof(IPluginBeforeStlParseAsync), string.Empty, await ParseTemplateContentAsync(contentBuilder); } + var afterStlParsesAsync = _pluginManager.GetExtensions(); + if (afterStlParsesAsync != null) + { + foreach (var extension in afterStlParsesAsync) + { + try + { + await extension.AfterStlParseAsync(context); + } + catch (Exception ex) + { + await AddStlErrorLogAsync(nameof(IPluginAfterStlParseAsync), string.Empty, + ex); + } + } + } + var afterStlParses = _pluginManager.GetExtensions(); if (afterStlParses != null) { @@ -93,10 +110,6 @@ await AddStlErrorLogAsync(nameof(IPluginBeforeStlParseAsync), string.Empty, try { extension.AfterStlParse(context); - //plugin.OnAfterStlParse(new ParseEventArgs(PageInfo.SiteId, PageInfo.PageChannelId, - // PageInfo.PageContentId, await GetContentAsync(), - // PageInfo.Template.TemplateType, PageInfo.Template.Id, filePath, PageInfo.HeadCodes, - // PageInfo.BodyCodes, PageInfo.FootCodes, contentBuilder)); } catch (Exception ex) { @@ -152,8 +165,7 @@ await AddStlErrorLogAsync(nameof(IPluginAfterStlParse), string.Empty, fileTemplateId = PageInfo.Template.Id; } - var apiUrl = PageInfo.ApiUrl; - var ajaxUrl = PathManager.GetTriggerApiUrl(apiUrl, PageInfo.SiteId, ContextInfo.ChannelId, + var ajaxUrl = PathManager.GetTriggerApiUrl(PageInfo.SiteId, ContextInfo.ChannelId, ContextInfo.ContentId, fileTemplateId, true); if (!PageInfo.FootCodes.ContainsKey("CreateDoubleClick")) { diff --git a/src/SSCMS.Core/Services/PathManager.Api.cs b/src/SSCMS.Core/Services/PathManager.Api.cs deleted file mode 100644 index 3e794bb5a..000000000 --- a/src/SSCMS.Core/Services/PathManager.Api.cs +++ /dev/null @@ -1,151 +0,0 @@ -using System.Collections.Generic; -using System.Collections.Specialized; -using SSCMS.Core.StlParser.StlElement; -using SSCMS.Models; -using SSCMS.Utils; - -namespace SSCMS.Core.Services -{ - public partial class PathManager - { - public string GetApiUrl(string route) - { - return PageUtils.Combine(Constants.ApiPrefix, route); - } - - public string GetApiUrl(Config config) - { - return config.IsSeparatedApi ? config.SeparatedApiUrl : "/"; - } - - public string InnerApiUrl => Constants.ApiPrefix; - - public string GetInnerApiUrl(string route) - { - return PageUtils.Combine(InnerApiUrl, route); - } - - public string GetDownloadApiUrl(string apiUrl, int siteId, int channelId, int contentId, string fileUrl) - { - return PageUtils.AddQueryString(PageUtils.Combine(apiUrl, Constants.ApiStlPrefix, Constants.RouteStlActionsDownload), new NameValueCollection - { - {"siteId", siteId.ToString()}, - {"channelId", channelId.ToString()}, - {"contentId", contentId.ToString()}, - {"fileUrl", _settingsManager.Encrypt(fileUrl)} - }); - } - - public string GetDownloadApiUrl(string apiUrl, int siteId, string fileUrl) - { - return PageUtils.AddQueryString(PageUtils.Combine(apiUrl, Constants.ApiStlPrefix, Constants.RouteStlActionsDownload), new NameValueCollection - { - {"siteId", siteId.ToString()}, - {"fileUrl", _settingsManager.Encrypt(fileUrl)} - }); - } - - public string GetDownloadApiUrl(string apiUrl, string filePath) - { - return PageUtils.AddQueryString(PageUtils.Combine(apiUrl, Constants.ApiStlPrefix, Constants.RouteStlActionsDownload), new NameValueCollection - { - {"filePath", _settingsManager.Encrypt(filePath)} - }); - } - - public string GetDynamicApiUrl(string apiUrl) - { - return PageUtils.Combine(apiUrl, Constants.ApiStlPrefix, Constants.RouteStlActionsDynamic); - } - - public string GetIfApiUrl(string apiUrl) - { - return PageUtils.Combine(apiUrl, Constants.ApiStlPrefix, Constants.RouteStlRouteActionsIf); - } - - public string GetPageContentsApiUrl(string apiUrl) - { - return PageUtils.Combine(apiUrl, Constants.ApiStlPrefix, Constants.RouteStlActionsPageContents); - } - - public string GetPageContentsApiParameters(int siteId, int pageChannelId, int templateId, int totalNum, int pageCount, - int currentPageIndex, string stlPageContentsElement) - { - return $@" -{{ - siteId: {siteId}, - pageChannelId: {pageChannelId}, - templateId: {templateId}, - totalNum: {totalNum}, - pageCount: {pageCount}, - currentPageIndex: {currentPageIndex}, - stlPageContentsElement: '{_settingsManager.Encrypt(stlPageContentsElement)}' -}}"; - } - - public string GetSearchApiUrl(string apiUrl) - { - return PageUtils.Combine(apiUrl, Constants.ApiStlPrefix, Constants.RouteStlActionsSearch); - } - - public string GetSearchApiParameters(bool isAllSites, string siteName, string siteDir, string siteIds, string channelIndex, string channelName, string channelIds, string type, string word, string dateAttribute, string dateFrom, string dateTo, string since, int pageNum, bool isHighlight, int siteId, string ajaxDivId, string template) - { - return $@" -{{ - {StlSearch.IsAllSites.ToLower()}: {isAllSites.ToString().ToLower()}, - {StlSearch.SiteName.ToLower()}: '{siteName}', - {StlSearch.SiteDir.ToLower()}: '{siteDir}', - {StlSearch.SiteIds.ToLower()}: '{siteIds}', - {StlSearch.ChannelIndex.ToLower()}: '{channelIndex}', - {StlSearch.ChannelName.ToLower()}: '{channelName}', - {StlSearch.ChannelIds.ToLower()}: '{channelIds}', - {StlSearch.Type.ToLower()}: '{type}', - {StlSearch.Word.ToLower()}: '{word}', - {StlSearch.DateAttribute.ToLower()}: '{dateAttribute}', - {StlSearch.DateFrom.ToLower()}: '{dateFrom}', - {StlSearch.DateTo.ToLower()}: '{dateTo}', - {StlSearch.Since.ToLower()}: '{since}', - {StlSearch.PageNum.ToLower()}: {pageNum}, - {StlSearch.IsHighlight.ToLower()}: {isHighlight.ToString().ToLower()}, - siteid: '{siteId}', - ajaxdivid: '{ajaxDivId}', - template: '{_settingsManager.Encrypt(template)}', -}}"; - } - - public List GetSearchExlcudeAttributeNames => new List - { - StlSearch.IsAllSites.ToLower(), - StlSearch.SiteName.ToLower(), - StlSearch.SiteDir.ToLower(), - StlSearch.SiteIds.ToLower(), - StlSearch.ChannelIndex.ToLower(), - StlSearch.ChannelName.ToLower(), - StlSearch.ChannelIds.ToLower(), - StlSearch.Type.ToLower(), - StlSearch.Word.ToLower(), - StlSearch.DateAttribute.ToLower(), - StlSearch.DateFrom.ToLower(), - StlSearch.DateTo.ToLower(), - StlSearch.Since.ToLower(), - StlSearch.PageNum.ToLower(), - StlSearch.IsHighlight.ToLower(), - "siteid", - "ajaxdivid", - "template", - }; - - public string GetTriggerApiUrl(string apiUrl, int siteId, int channelId, int contentId, - int fileTemplateId, bool isRedirect) - { - return PageUtils.AddQueryString(PageUtils.Combine(apiUrl, Constants.ApiStlPrefix, Constants.RouteStlActionsTrigger), new NameValueCollection - { - {"siteId", siteId.ToString()}, - {"channelId", channelId.ToString()}, - {"contentId", contentId.ToString()}, - {"fileTemplateId", fileTemplateId.ToString()}, - {"isRedirect", isRedirect.ToString()} - }); - } - } -} diff --git a/src/SSCMS.Core/Services/PathManager.Plugins.cs b/src/SSCMS.Core/Services/PathManager.Plugins.cs index a9b3824e7..591af0c6a 100644 --- a/src/SSCMS.Core/Services/PathManager.Plugins.cs +++ b/src/SSCMS.Core/Services/PathManager.Plugins.cs @@ -69,24 +69,5 @@ public string GetPluginDllDirectoryPath(string pluginId) return string.Empty; } - - public string ParsePluginUrl(string pluginId, string url) - { - if (string.IsNullOrEmpty(url)) return string.Empty; - - if (PageUtils.IsProtocolUrl(url)) return url; - - if (StringUtils.StartsWith(url, "~/")) - { - return GetWebRootUrl(url.Substring(1)); - } - - if (StringUtils.StartsWith(url, "@/")) - { - return GetAdminUrl(url.Substring(1)); - } - - return GetWebRootUrl(PageUtils.Combine(DirectoryUtils.Plugins, pluginId, url)); - } } } diff --git a/src/SSCMS.Core/Services/PathManager.Root.cs b/src/SSCMS.Core/Services/PathManager.Root.cs new file mode 100644 index 000000000..831d39acc --- /dev/null +++ b/src/SSCMS.Core/Services/PathManager.Root.cs @@ -0,0 +1,263 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using SSCMS.Core.StlParser.StlElement; +using SSCMS.Models; +using SSCMS.Utils; + +namespace SSCMS.Core.Services +{ + public partial class PathManager + { + public string GetRootUrl(params string[] paths) + { + return PathUtils.Combine(_settingsManager.ApiHost, PageUtils.Combine(paths)); + } + + public string GetRootUrlByPath(string physicalPath) + { + var requestPath = PathUtils.GetPathDifference(_settingsManager.WebRootPath, physicalPath); + requestPath = requestPath.Replace(PathUtils.SeparatorChar, PageUtils.SeparatorChar); + return GetRootUrl(requestPath); + } + + public string GetTemporaryFilesUrl(params string[] paths) + { + return GetSiteFilesUrl(DirectoryUtils.SiteFiles.TemporaryFiles, PageUtils.Combine(paths)); + } + + public string GetSiteTemplatesUrl(string relatedUrl) + { + return GetRootUrl(DirectoryUtils.SiteFilesDirectoryName, DirectoryUtils.SiteTemplates.DirectoryName, relatedUrl); + } + + public string ParseNavigationUrl(string url) + { + if (string.IsNullOrEmpty(url)) return string.Empty; + + url = url.StartsWith("~") ? GetRootUrl(url.Substring(1)) : url; + url = url.Replace(PathUtils.SeparatorChar, PageUtils.SeparatorChar); + return url; + } + + public string GetSiteFilesUrl(params string[] paths) + { + return GetRootUrl(DirectoryUtils.SiteFilesDirectoryName, PageUtils.Combine(paths)); + } + + public string GetAdministratorUploadUrl(int userId, params string[] paths) + { + return GetSiteFilesUrl(DirectoryUtils.SiteFiles.Administrators, + PageUtils.Combine(userId.ToString(), PageUtils.Combine(paths))); + } + + public string GetUserUploadUrl(int userId, params string[] paths) + { + return GetSiteFilesUrl(DirectoryUtils.SiteFiles.Users, + PageUtils.Combine(userId.ToString(), PageUtils.Combine(paths))); + } + + public string GetHomeUploadUrl(params string[] paths) + { + return GetSiteFilesUrl(DirectoryUtils.SiteFiles.Home, PageUtils.Combine(paths)); + } + + public string DefaultAvatarUrl => GetHomeUploadUrl("default_avatar.png"); + + public string GetUserUploadFileName(string filePath) + { + var dt = DateTime.Now; + return $"{dt.Day}{dt.Hour}{dt.Minute}{dt.Second}{dt.Millisecond}{PathUtils.GetExtension(filePath)}"; + } + + public string GetUserUploadUrl(int userId, string relatedUrl) + { + return GetHomeUploadUrl(userId.ToString(), relatedUrl); + } + + public string GetUserAvatarUrl(User user) + { + var imageUrl = user?.AvatarUrl; + + if (!string.IsNullOrEmpty(imageUrl)) + { + return PageUtils.IsProtocolUrl(imageUrl) ? imageUrl : GetUserUploadUrl(user.Id, imageUrl); + } + + return DefaultAvatarUrl; + } + + public string GetRootPath(params string[] paths) + { + return PathUtils.Combine(_settingsManager.WebRootPath, PathUtils.Combine(paths)); + } + + public string GetContentRootPath(params string[] paths) + { + return PathUtils.Combine(_settingsManager.ContentRootPath, PathUtils.Combine(paths)); + } + + public string GetSiteFilesPath(params string[] paths) + { + var path = PathUtils.Combine(_settingsManager.WebRootPath, DirectoryUtils.SiteFilesDirectoryName, PathUtils.Combine(paths)); + return path; + } + + public string GetAdministratorUploadPath(int userId, params string[] paths) + { + var path = GetSiteFilesPath(DirectoryUtils.SiteFiles.Administrators, PathUtils.Combine(userId.ToString(), PathUtils.Combine(paths))); + return path; + } + + public string GetUserUploadPath(int userId, params string[] paths) + { + var path = GetSiteFilesPath(DirectoryUtils.SiteFiles.Users, PathUtils.Combine(userId.ToString(), PathUtils.Combine(paths))); + return path; + } + + public string GetHomeUploadPath(params string[] paths) + { + var path = GetSiteFilesPath(DirectoryUtils.SiteFiles.Home, PathUtils.Combine(paths)); + return path; + } + + public string GetTemporaryFilesPath(params string[] paths) + { + var path = GetSiteFilesPath(DirectoryUtils.SiteFiles.TemporaryFiles, PathUtils.Combine(paths)); + return path; + } + + public string GetUserUploadPath(int userId, string relatedPath) + { + return GetHomeUploadPath(userId.ToString(), relatedPath); + } + + public string GetApiUrl(params string[] paths) + { + return PageUtils.Combine(_settingsManager.ApiHost, Constants.ApiPrefix, PathUtils.Combine(paths)); + } + + public string GetDownloadApiUrl(int siteId, int channelId, int contentId, string fileUrl) + { + return PageUtils.AddQueryString(PageUtils.Combine(_settingsManager.ApiHost, Constants.ApiPrefix, Constants.ApiStlPrefix, Constants.RouteStlActionsDownload), new NameValueCollection + { + {"siteId", siteId.ToString()}, + {"channelId", channelId.ToString()}, + {"contentId", contentId.ToString()}, + {"fileUrl", _settingsManager.Encrypt(fileUrl)} + }); + } + + public string GetDownloadApiUrl(int siteId, string fileUrl) + { + return PageUtils.AddQueryString(PageUtils.Combine(_settingsManager.ApiHost, Constants.ApiPrefix, Constants.ApiStlPrefix, Constants.RouteStlActionsDownload), new NameValueCollection + { + {"siteId", siteId.ToString()}, + {"fileUrl", _settingsManager.Encrypt(fileUrl)} + }); + } + + public string GetDownloadApiUrl(bool isInner, string filePath) + { + return PageUtils.AddQueryString(PageUtils.Combine(_settingsManager.ApiHost, Constants.ApiPrefix, Constants.ApiStlPrefix, Constants.RouteStlActionsDownload), new NameValueCollection + { + {"filePath", _settingsManager.Encrypt(filePath)} + }); + } + + public string GetDynamicApiUrl() + { + return PageUtils.Combine(_settingsManager.ApiHost, Constants.ApiPrefix, Constants.ApiStlPrefix, Constants.RouteStlActionsDynamic); + } + + public string GetIfApiUrl() + { + return PageUtils.Combine(_settingsManager.ApiHost, Constants.ApiPrefix, Constants.ApiStlPrefix, Constants.RouteStlRouteActionsIf); + } + + public string GetPageContentsApiUrl() + { + return PageUtils.Combine(_settingsManager.ApiHost, Constants.ApiPrefix, Constants.ApiStlPrefix, Constants.RouteStlActionsPageContents); + } + + public string GetPageContentsApiParameters(int siteId, int pageChannelId, int templateId, int totalNum, int pageCount, + int currentPageIndex, string stlPageContentsElement) + { + return $@" +{{ + siteId: {siteId}, + pageChannelId: {pageChannelId}, + templateId: {templateId}, + totalNum: {totalNum}, + pageCount: {pageCount}, + currentPageIndex: {currentPageIndex}, + stlPageContentsElement: '{_settingsManager.Encrypt(stlPageContentsElement)}' +}}"; + } + + public string GetSearchApiUrl() + { + return PageUtils.Combine(_settingsManager.ApiHost, Constants.ApiPrefix, Constants.ApiStlPrefix, Constants.ApiStlPrefix, Constants.RouteStlActionsSearch); + } + + public string GetSearchApiParameters(bool isAllSites, string siteName, string siteDir, string siteIds, string channelIndex, string channelName, string channelIds, string type, string word, string dateAttribute, string dateFrom, string dateTo, string since, int pageNum, bool isHighlight, int siteId, string ajaxDivId, string template) + { + return $@" +{{ + {StlSearch.IsAllSites.ToLower()}: {isAllSites.ToString().ToLower()}, + {StlSearch.SiteName.ToLower()}: '{siteName}', + {StlSearch.SiteDir.ToLower()}: '{siteDir}', + {StlSearch.SiteIds.ToLower()}: '{siteIds}', + {StlSearch.ChannelIndex.ToLower()}: '{channelIndex}', + {StlSearch.ChannelName.ToLower()}: '{channelName}', + {StlSearch.ChannelIds.ToLower()}: '{channelIds}', + {StlSearch.Type.ToLower()}: '{type}', + {StlSearch.Word.ToLower()}: '{word}', + {StlSearch.DateAttribute.ToLower()}: '{dateAttribute}', + {StlSearch.DateFrom.ToLower()}: '{dateFrom}', + {StlSearch.DateTo.ToLower()}: '{dateTo}', + {StlSearch.Since.ToLower()}: '{since}', + {StlSearch.PageNum.ToLower()}: {pageNum}, + {StlSearch.IsHighlight.ToLower()}: {isHighlight.ToString().ToLower()}, + siteid: '{siteId}', + ajaxdivid: '{ajaxDivId}', + template: '{_settingsManager.Encrypt(template)}', +}}"; + } + + public List GetSearchExcludeAttributeNames => new List + { + StlSearch.IsAllSites.ToLower(), + StlSearch.SiteName.ToLower(), + StlSearch.SiteDir.ToLower(), + StlSearch.SiteIds.ToLower(), + StlSearch.ChannelIndex.ToLower(), + StlSearch.ChannelName.ToLower(), + StlSearch.ChannelIds.ToLower(), + StlSearch.Type.ToLower(), + StlSearch.Word.ToLower(), + StlSearch.DateAttribute.ToLower(), + StlSearch.DateFrom.ToLower(), + StlSearch.DateTo.ToLower(), + StlSearch.Since.ToLower(), + StlSearch.PageNum.ToLower(), + StlSearch.IsHighlight.ToLower(), + "siteid", + "ajaxdivid", + "template", + }; + + public string GetTriggerApiUrl(int siteId, int channelId, int contentId, + int fileTemplateId, bool isRedirect) + { + return PageUtils.AddQueryString(PageUtils.Combine(_settingsManager.ApiHost, Constants.ApiPrefix, Constants.ApiStlPrefix, Constants.RouteStlActionsTrigger), new NameValueCollection + { + {"siteId", siteId.ToString()}, + {"channelId", channelId.ToString()}, + {"contentId", contentId.ToString()}, + {"fileTemplateId", fileTemplateId.ToString()}, + {"isRedirect", isRedirect.ToString()} + }); + } + } +} diff --git a/src/SSCMS.Core/Services/PathManager.Site.cs b/src/SSCMS.Core/Services/PathManager.Site.cs index 40a1bbb97..ef2742b7b 100644 --- a/src/SSCMS.Core/Services/PathManager.Site.cs +++ b/src/SSCMS.Core/Services/PathManager.Site.cs @@ -15,48 +15,6 @@ namespace SSCMS.Core.Services { public partial class PathManager { - // 系统根目录访问地址 - public string GetWebRootUrl(params string[] paths) - { - return PageUtils.Combine("/", PathUtils.Combine(paths)); - } - - public string GetWebRootPath(params string[] paths) - { - return PathUtils.Combine(_settingsManager.WebRootPath, PathUtils.Combine(paths)); - } - - public string GetContentRootPath(params string[] paths) - { - return PathUtils.Combine(_settingsManager.ContentRootPath, PathUtils.Combine(paths)); - } - - public string GetTemporaryFilesUrl(string relatedUrl) - { - return PageUtils.Combine($"/{DirectoryUtils.SiteFilesDirectoryName}", DirectoryUtils.SiteFiles.TemporaryFiles, relatedUrl); - } - - public string GetSiteTemplatesUrl(string relatedUrl) - { - return PageUtils.Combine($"/{DirectoryUtils.SiteFilesDirectoryName}", DirectoryUtils.SiteTemplates.DirectoryName, relatedUrl); - } - - public string GetRootUrlByPhysicalPath(string physicalPath) - { - var requestPath = PathUtils.GetPathDifference(_settingsManager.WebRootPath, physicalPath); - requestPath = requestPath.Replace(PathUtils.SeparatorChar, PageUtils.SeparatorChar); - return GetWebRootUrl(requestPath); - } - - public string ParseNavigationUrl(string url) - { - if (string.IsNullOrEmpty(url)) return string.Empty; - - url = url.StartsWith("~") ? PageUtils.Combine("/", url.Substring(1)) : url; - url = url.Replace(PathUtils.SeparatorChar, PageUtils.SeparatorChar); - return url; - } - //根据发布系统属性判断是否为相对路径并返回解析后路径 public async Task ParseNavigationUrlAsync(Site site, string url, bool isLocal) { @@ -177,50 +135,50 @@ public async Task GetLocalSiteUrlAsync(Site site, string requestPath = n return url; } - public string GetLocalSiteUrl(int siteId) + public string GetPreviewSiteUrl(int siteId) { - var apiUrl = GetInnerApiUrl(Constants.RoutePreview); + var apiUrl = GetApiUrl(Constants.RoutePreview); apiUrl = apiUrl.Replace("{siteId}", siteId.ToString()); return apiUrl; } - public string GetLocalChannelUrl(int siteId, int channelId) + public string GetPreviewChannelUrl(int siteId, int channelId) { - var apiUrl = GetInnerApiUrl(Constants.RoutePreviewChannel); + var apiUrl = GetApiUrl(Constants.RoutePreviewChannel); apiUrl = apiUrl.Replace("{siteId}", siteId.ToString()); apiUrl = apiUrl.Replace("{channelId}", channelId.ToString()); return apiUrl; } - public string GetLocalContentUrl(int siteId, int channelId, int contentId) + public string GetPreviewContentUrl(int siteId, int channelId, int contentId) { - var apiUrl = GetInnerApiUrl(Constants.RoutePreviewContent); + var apiUrl = GetApiUrl(Constants.RoutePreviewContent); apiUrl = apiUrl.Replace("{siteId}", siteId.ToString()); apiUrl = apiUrl.Replace("{channelId}", channelId.ToString()); apiUrl = apiUrl.Replace("{contentId}", contentId.ToString()); return apiUrl; } - public string GetContentPreviewUrl(int siteId, int channelId, int contentId, int previewId) + public string GetPreviewContentUrl(int siteId, int channelId, int contentId, int previewId) { if (contentId == 0) { contentId = previewId; } - return $"{GetLocalContentUrl(siteId, channelId, contentId)}?isPreview=true&previewId={previewId}"; + return $"{GetPreviewContentUrl(siteId, channelId, contentId)}?isPreview=true&previewId={previewId}"; } - public string GetLocalFileUrl(int siteId, int fileTemplateId) + public string GetPreviewFileUrl(int siteId, int fileTemplateId) { - var apiUrl = GetInnerApiUrl(Constants.RoutePreviewFile); + var apiUrl = GetApiUrl(Constants.RoutePreviewFile); apiUrl = apiUrl.Replace("{siteId}", siteId.ToString()); apiUrl = apiUrl.Replace("{fileTemplateId}", fileTemplateId.ToString()); return apiUrl; } - public string GetLocalSpecialUrl(int siteId, int specialId) + public string GetPreviewSpecialUrl(int siteId, int specialId) { - var apiUrl = GetInnerApiUrl(Constants.RoutePreviewSpecial); + var apiUrl = GetApiUrl(Constants.RoutePreviewSpecial); apiUrl = apiUrl.Replace("{siteId}", siteId.ToString()); apiUrl = apiUrl.Replace("{specialId}", specialId.ToString()); return apiUrl; @@ -233,7 +191,7 @@ public async Task GetIndexPageUrlAsync(Site site, bool isLocal) var createdFileFullName = await _templateRepository.GetCreatedFileFullNameAsync(indexTemplateId); var url = isLocal - ? GetLocalSiteUrl(site.Id) + ? GetPreviewSiteUrl(site.Id) : await ParseNavigationUrlAsync(site, createdFileFullName, false); return RemoveDefaultFileName(site, url); @@ -244,7 +202,7 @@ public async Task GetFileUrlAsync(Site site, int fileTemplateId, bool is var createdFileFullName = await _templateRepository.GetCreatedFileFullNameAsync(fileTemplateId); var url = isLocal - ? GetLocalFileUrl(site.Id, fileTemplateId) + ? GetPreviewFileUrl(site.Id, fileTemplateId) : await ParseNavigationUrlAsync(site, createdFileFullName, false); return RemoveDefaultFileName(site, url); @@ -267,7 +225,7 @@ public async Task GetContentUrlByIdAsync(Site site, Content contentCurre if (isLocal) { - return GetLocalContentUrl(site.Id, contentCurrent.ChannelId, + return GetPreviewContentUrl(site.Id, contentCurrent.ChannelId, contentCurrent.Id); } @@ -326,7 +284,7 @@ public async Task GetContentUrlByIdAsync(Site site, int channelId, int c { if (isLocal) { - return GetLocalContentUrl(site.Id, channelId, contentId); + return GetPreviewContentUrl(site.Id, channelId, contentId); } var contentInfoCurrent = await _contentRepository.GetAsync(site, channelId, contentId); @@ -408,7 +366,7 @@ public async Task GetChannelUrlAsync(Site site, Channel channel, bool is if (isLocal) { - return GetLocalChannelUrl(site.Id, channel.Id); + return GetPreviewChannelUrl(site.Id, channel.Id); } var url = string.Empty; @@ -584,37 +542,6 @@ public bool IsRelativeUrl(string url) return url.StartsWith("/"); } - public string GetSiteFilesUrl(string relatedUrl) - { - return PageUtils.Combine($"/{DirectoryUtils.SiteFilesDirectoryName}", relatedUrl); - } - - public string GetSiteFilesUrl(string apiUrl, string relatedUrl) - { - if (string.IsNullOrEmpty(apiUrl)) - { - apiUrl = "/api"; - } - apiUrl = apiUrl.Trim().ToLower(); - if (apiUrl == "/api") - { - apiUrl = "/"; - } - else if (apiUrl.EndsWith("/api")) - { - apiUrl = apiUrl.Substring(0, apiUrl.LastIndexOf("/api", StringComparison.Ordinal)); - } - else if (apiUrl.EndsWith("/api/")) - { - apiUrl = apiUrl.Substring(0, apiUrl.LastIndexOf("/api/", StringComparison.Ordinal)); - } - if (string.IsNullOrEmpty(apiUrl)) - { - apiUrl = "/"; - } - return PageUtils.Combine(apiUrl, DirectoryUtils.SiteFilesDirectoryName, relatedUrl); - } - public List> GetLinkTypeSelects() { return new List> @@ -643,7 +570,7 @@ public async Task GetSitePathAsync(Site site, params string[] paths) { if (site == null) { - return GetWebRootPath(paths); + return GetRootPath(paths); } string sitePath; @@ -671,7 +598,7 @@ public async Task GetSitePathAsync(int siteId, params string[] paths) { if (siteId == 0) { - return GetWebRootPath(paths); + return GetRootPath(paths); } var site = await _siteRepository.GetAsync(siteId); return await GetSitePathAsync(site, paths); @@ -838,19 +765,7 @@ public string GetUploadFileName(Site site, string filePath) isUploadChangeFileName = site.IsVideoUploadChangeFileName; } - return GetUploadFileName(filePath, isUploadChangeFileName); - } - - public string GetUploadFileName(string filePath, bool isUploadChangeFileName) - { - if (isUploadChangeFileName) - { - return $"{StringUtils.GetShortGuid(false)}{PathUtils.GetExtension(filePath)}"; - } - - var fileName = PathUtils.GetFileNameWithoutExtension(filePath); - fileName = PathUtils.GetSafeFilename(fileName); - return $"{fileName}{PathUtils.GetExtension(filePath)}"; + return PathUtils.GetUploadFileName(filePath, isUploadChangeFileName); } private bool Contains(string text, string inner) diff --git a/src/SSCMS.Core/Services/PathManager.SiteFiles.cs b/src/SSCMS.Core/Services/PathManager.SiteFiles.cs deleted file mode 100644 index 1c776b5d5..000000000 --- a/src/SSCMS.Core/Services/PathManager.SiteFiles.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using SSCMS.Models; -using SSCMS.Utils; - -namespace SSCMS.Core.Services -{ - public partial class PathManager - { - public string GetSiteFilesPath(params string[] paths) - { - var path = PathUtils.Combine(_settingsManager.WebRootPath, DirectoryUtils.SiteFilesDirectoryName, PathUtils.Combine(paths)); - return path; - } - - public string GetSiteFilesUrl(params string[] paths) - { - return GetWebRootUrl(DirectoryUtils.SiteFilesDirectoryName, PageUtils.Combine(paths)); - } - - public string GetAdministratorUploadPath(int userId, params string[] paths) - { - var path = GetSiteFilesPath(DirectoryUtils.SiteFiles.Administrators, PathUtils.Combine(userId.ToString(), PathUtils.Combine(paths))); - return path; - } - - public string GetAdministratorUploadUrl(int userId, params string[] paths) - { - return GetWebRootUrl(DirectoryUtils.SiteFilesDirectoryName, DirectoryUtils.SiteFiles.Administrators, - PageUtils.Combine(userId.ToString(), PageUtils.Combine(paths))); - } - - public string GetUserUploadPath(int userId, params string[] paths) - { - var path = GetSiteFilesPath(DirectoryUtils.SiteFiles.Users, PathUtils.Combine(userId.ToString(), PathUtils.Combine(paths))); - return path; - } - - public string GetUserUploadUrl(int userId, params string[] paths) - { - return GetWebRootUrl(DirectoryUtils.SiteFilesDirectoryName, DirectoryUtils.SiteFiles.Users, - PageUtils.Combine(userId.ToString(), PageUtils.Combine(paths))); - } - - public string GetHomeUploadPath(params string[] paths) - { - var path = GetSiteFilesPath(DirectoryUtils.SiteFiles.Home, PathUtils.Combine(paths)); - return path; - } - - public string GetHomeUploadUrl(params string[] paths) - { - return GetSiteFilesUrl(PageUtils.Combine(DirectoryUtils.SiteFiles.Home, PageUtils.Combine(paths))); - } - - public string GetTemporaryFilesPath(params string[] paths) - { - var path = GetSiteFilesPath(DirectoryUtils.SiteFiles.TemporaryFiles, PathUtils.Combine(paths)); - return path; - } - - public string GetTemporaryFilesUrl(params string[] paths) - { - return GetSiteFilesUrl(PageUtils.Combine(DirectoryUtils.SiteFiles.TemporaryFiles, PageUtils.Combine(paths))); - } - - public string DefaultAvatarUrl => GetHomeUploadUrl("default_avatar.png"); - - public string GetUserUploadPath(int userId, string relatedPath) - { - return GetHomeUploadPath(userId.ToString(), relatedPath); - } - - public string GetUserUploadFileName(string filePath) - { - var dt = DateTime.Now; - return $"{dt.Day}{dt.Hour}{dt.Minute}{dt.Second}{dt.Millisecond}{PathUtils.GetExtension(filePath)}"; - } - - public string GetUserUploadUrl(int userId, string relatedUrl) - { - return GetHomeUploadUrl(userId.ToString(), relatedUrl); - } - - public string GetUserAvatarUrl(User user) - { - var imageUrl = user?.AvatarUrl; - - if (!string.IsNullOrEmpty(imageUrl)) - { - return PageUtils.IsProtocolUrl(imageUrl) ? imageUrl : GetUserUploadUrl(user.Id, imageUrl); - } - - return DefaultAvatarUrl; - } - } -} diff --git a/src/SSCMS.Core/Services/PathManager.Special.cs b/src/SSCMS.Core/Services/PathManager.Special.cs index 579321f95..dc0365c5e 100644 --- a/src/SSCMS.Core/Services/PathManager.Special.cs +++ b/src/SSCMS.Core/Services/PathManager.Special.cs @@ -16,7 +16,7 @@ public async Task GetSpecialUrlAsync(Site site, int specialId, bool isLo var specialUrl = await GetSpecialUrlAsync(site, specialId); var url = isLocal - ? GetLocalSpecialUrl(site.Id, specialId) + ? GetPreviewSpecialUrl(site.Id, specialId) : await ParseNavigationUrlAsync(site, specialUrl, false); return RemoveDefaultFileName(site, url); diff --git a/src/SSCMS.Core/Services/PluginManager.cs b/src/SSCMS.Core/Services/PluginManager.cs index 20d20f76e..92da8de41 100644 --- a/src/SSCMS.Core/Services/PluginManager.cs +++ b/src/SSCMS.Core/Services/PluginManager.cs @@ -88,7 +88,8 @@ public IPlugin GetPlugin(string pluginId) public IEnumerable GetExtensions(bool useCaching = false) where T : IPluginExtension { - return PluginUtils.GetInstances(NetCorePlugins, _settingsManager.ServiceProvider, useCaching); + var provider = _settingsManager.BuildServiceProvider(); + return PluginUtils.GetInstances(NetCorePlugins, provider, useCaching); } public async Task> GetConfigAsync(string pluginId) diff --git a/src/SSCMS.Core/Services/SettingsManager.cs b/src/SSCMS.Core/Services/SettingsManager.cs index 04fc1462a..6ee925247 100644 --- a/src/SSCMS.Core/Services/SettingsManager.cs +++ b/src/SSCMS.Core/Services/SettingsManager.cs @@ -37,7 +37,10 @@ public SettingsManager(IServiceCollection services, IConfiguration config, strin } } - public IServiceProvider ServiceProvider => _services.BuildServiceProvider(); + public IServiceProvider BuildServiceProvider() + { + return _services.BuildServiceProvider(); + } public string ContentRootPath { get; } public string WebRootPath { get; } @@ -46,6 +49,7 @@ public SettingsManager(IServiceCollection services, IConfiguration config, strin public bool IsNightlyUpdate => _config.GetValue(nameof(IsNightlyUpdate), false); public bool IsProtectData => _config.GetValue(nameof(IsProtectData), false); public string SecurityKey => _config.GetValue(nameof(SecurityKey)); + public string ApiHost => _config.GetValue(nameof(ApiHost), "/"); public DatabaseType DatabaseType => TranslateUtils.ToEnum(IsProtectData ? Decrypt(_config.GetValue("Database:Type")) : _config.GetValue("Database:Type"), DatabaseType.MySql); public string DatabaseConnectionString => IsProtectData ? Decrypt(_config.GetValue("Database:ConnectionString")) : _config.GetValue("Database:ConnectionString"); public IDatabase Database => new Database(DatabaseType, DatabaseConnectionString); diff --git a/src/SSCMS.Core/StlParser/StlElement/StlAudio.cs b/src/SSCMS.Core/StlParser/StlElement/StlAudio.cs index 51320db01..449f83217 100644 --- a/src/SSCMS.Core/StlParser/StlElement/StlAudio.cs +++ b/src/SSCMS.Core/StlParser/StlElement/StlAudio.cs @@ -102,20 +102,20 @@ private static async Task ParseImplAsync(IParseManager parseManager, str { return playUrl; } - else - { - await pageInfo.AddPageBodyCodeIfNotExistsAsync(ParsePage.Const.Jquery); - await pageInfo.AddPageBodyCodeIfNotExistsAsync(ParsePage.Const.JsAcMediaElement); - return $@" + await pageInfo.AddPageBodyCodeIfNotExistsAsync(ParsePage.Const.Jquery); + await pageInfo.AddPageBodyCodeIfNotExistsAsync(ParsePage.Const.JsAcMediaElement); + + var url = parseManager.PathManager.GetSiteFilesUrl(Resources.MediaElement.Swf); + + return $@"