SettingController.php 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2013-present http://www.thinkcmf.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 小夏 < 449134904@qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\admin\controller;
  12. use app\admin\model\RouteModel;
  13. use app\admin\model\UserModel;
  14. use cmf\controller\AdminBaseController;
  15. use think\facade\Db;
  16. /**
  17. * Class SettingController
  18. * @package app\admin\controller
  19. * @adminMenuRoot(
  20. * 'name' =>'设置',
  21. * 'action' =>'default',
  22. * 'parent' =>'',
  23. * 'display'=> true,
  24. * 'order' => 0,
  25. * 'icon' =>'cogs',
  26. * 'remark' =>'系统设置入口'
  27. * )
  28. */
  29. class SettingController extends AdminBaseController
  30. {
  31. /**
  32. * 网站信息
  33. * @adminMenu(
  34. * 'name' => '网站信息',
  35. * 'parent' => 'default',
  36. * 'display'=> true,
  37. * 'hasView'=> true,
  38. * 'order' => 0,
  39. * 'icon' => '',
  40. * 'remark' => '网站信息',
  41. * 'param' => ''
  42. * )
  43. */
  44. public function site()
  45. {
  46. $content = hook_one('admin_setting_site_view');
  47. if (!empty($content)) {
  48. return $content;
  49. }
  50. $noNeedDirs = [".", "..", ".svn", 'fonts'];
  51. $adminThemesDir = WEB_ROOT . config('template.cmf_admin_theme_path') . config('template.cmf_admin_default_theme') . '/public/assets/themes/';
  52. $adminStyles = cmf_scan_dir($adminThemesDir . '*', GLOB_ONLYDIR);
  53. $adminStyles = array_diff($adminStyles, $noNeedDirs);
  54. $cdnSettings = cmf_get_option('cdn_settings');
  55. $cmfSettings = cmf_get_option('cmf_settings');
  56. $adminSettings = cmf_get_option('admin_settings');
  57. $adminThemes = [];
  58. $themes = cmf_scan_dir(WEB_ROOT . config('template.cmf_admin_theme_path') . '/*', GLOB_ONLYDIR);
  59. foreach ($themes as $theme) {
  60. if (strpos($theme, 'admin_') === 0) {
  61. array_push($adminThemes, $theme);
  62. }
  63. }
  64. if (APP_DEBUG && false) { // TODO 没确定要不要可以设置默认应用
  65. $apps = cmf_scan_dir($this->app->getAppPath() . '*', GLOB_ONLYDIR);
  66. $apps = array_diff($apps, $noNeedDirs);
  67. $this->assign('apps', $apps);
  68. }
  69. $this->assign('site_info', cmf_get_option('site_info'));
  70. $this->assign("admin_styles", $adminStyles);
  71. $this->assign("templates", []);
  72. $this->assign("admin_themes", $adminThemes);
  73. $this->assign("cdn_settings", $cdnSettings);
  74. $this->assign("admin_settings", $adminSettings);
  75. $this->assign("cmf_settings", $cmfSettings);
  76. return $this->fetch();
  77. }
  78. /**
  79. * 网站信息设置提交
  80. * @adminMenu(
  81. * 'name' => '网站信息设置提交',
  82. * 'parent' => 'site',
  83. * 'display'=> false,
  84. * 'hasView'=> false,
  85. * 'order' => 10000,
  86. * 'icon' => '',
  87. * 'remark' => '网站信息设置提交',
  88. * 'param' => ''
  89. * )
  90. */
  91. public function sitePost(){
  92. if ($this->request->isPost()) {
  93. $result = $this->validate($this->request->param(), 'SettingSite');
  94. if ($result !== true) {
  95. $this->error($result);
  96. }
  97. $oldconfig=cmf_get_option('site_info');
  98. $options = $this->request->param('options/a');
  99. $login_type=isset($options['login_type'])?$options['login_type']:[];
  100. $options['login_type']=$login_type;
  101. $share_type=isset($options['share_type'])?$options['share_type']:[];
  102. $options['share_type']=$share_type;
  103. $brightness=$options['brightness'];
  104. if(!is_numeric($brightness) || $brightness<0 || $brightness>100 || floor($brightness)!=$brightness || strpos($brightness, '.')>0){
  105. $this->error("美颜--亮度请设置0-100之间的整数");
  106. }
  107. $skin_whiting=$options['skin_whiting'];
  108. if(!is_numeric($skin_whiting) || $skin_whiting<0 || $skin_whiting>9 || floor($skin_whiting)!=$skin_whiting || strpos($skin_whiting, '.')>0){
  109. $this->error("美颜--美白请设置0-9之间的整数");
  110. }
  111. $skin_smooth=$options['skin_smooth'];
  112. if(!is_numeric($skin_smooth) || $skin_smooth<0 || $skin_smooth>9 || floor($skin_smooth)!=$skin_smooth || strpos($skin_smooth, '.')>0){
  113. $this->error("美颜--磨皮请设置0-9之间的整数");
  114. }
  115. $skin_tenderness=$options['skin_tenderness'];
  116. if(!is_numeric($skin_tenderness) || $skin_tenderness<0 || $skin_tenderness>9 || floor($skin_tenderness)!=$skin_tenderness || strpos($skin_tenderness, '.')>0){
  117. $this->error("美颜--红润请设置0-9之间的整数");
  118. }
  119. $eye_brow=$options['eye_brow'];
  120. if(!is_numeric($eye_brow) || $eye_brow<0 || $eye_brow>100 || floor($eye_brow)!=$eye_brow || strpos($eye_brow, '.')>0){
  121. $this->error("美型--眉毛请设置0-100之间的整数");
  122. }
  123. $big_eye=$options['big_eye'];
  124. if(!is_numeric($big_eye) || $big_eye<0 || $big_eye>100 || floor($big_eye)!=$big_eye || strpos($big_eye, '.')>0){
  125. $this->error("美型--大眼请设置0-100之间的整数");
  126. }
  127. $eye_length=$options['eye_length'];
  128. if(!is_numeric($eye_length) || $eye_length<0 || $eye_length>100 || floor($eye_length)!=$eye_length || strpos($eye_length, '.')>0){
  129. $this->error("美型--眼距请设置0-100之间的整数");
  130. }
  131. $eye_corner=$options['eye_corner'];
  132. if(!is_numeric($eye_corner) || $eye_corner<0 || $eye_corner>100 || floor($eye_corner)!=$eye_corner || strpos($eye_corner, '.')>0){
  133. $this->error("美型--眼角请设置0-100之间的整数");
  134. }
  135. $eye_alat=$options['eye_alat'];
  136. if(!is_numeric($eye_alat) || $eye_alat<0 || $eye_alat>100 || floor($eye_alat)!=$eye_alat || strpos($eye_alat, '.')>0){
  137. $this->error("美型--开眼角请设置0-100之间的整数");
  138. }
  139. $face_lift=$options['face_lift'];
  140. if(!is_numeric($face_lift) || $face_lift<0 || $face_lift>100 || floor($face_lift)!=$face_lift || strpos($face_lift, '.')>0){
  141. $this->error("美型--瘦脸请设置0-100之间的整数");
  142. }
  143. $face_shave=$options['face_shave'];
  144. if(!is_numeric($face_shave) || $face_shave<0 || $face_shave>100 || floor($face_shave)!=$face_shave || strpos($face_shave, '.')>0){
  145. $this->error("美型--削脸请设置0-100之间的整数");
  146. }
  147. $mouse_lift=$options['mouse_lift'];
  148. if(!is_numeric($mouse_lift) || $mouse_lift<0 || $mouse_lift>100 || floor($mouse_lift)!=$mouse_lift || strpos($mouse_lift, '.')>0){
  149. $this->error("美型--嘴型请设置0-100之间的整数");
  150. }
  151. $nose_lift=$options['nose_lift'];
  152. if(!is_numeric($nose_lift) || $nose_lift<0 || $nose_lift>100 || floor($nose_lift)!=$nose_lift || strpos($nose_lift, '.')>0){
  153. $this->error("美型--瘦鼻请设置0-100之间的整数");
  154. }
  155. $chin_lift=$options['chin_lift'];
  156. if(!is_numeric($chin_lift) || $chin_lift<0 || $chin_lift>100 || floor($chin_lift)!=$chin_lift || strpos($chin_lift, '.')>0){
  157. $this->error("美型--下巴请设置0-100之间的整数");
  158. }
  159. $forehead_lift=$options['forehead_lift'];
  160. if(!is_numeric($forehead_lift) || $forehead_lift<0 || $forehead_lift>100 || floor($forehead_lift)!=$forehead_lift || strpos($forehead_lift, '.')>0){
  161. $this->error("美型--额头请设置0-100之间的整数");
  162. }
  163. $lengthen_noseLift=$options['lengthen_noseLift'];
  164. if(!is_numeric($lengthen_noseLift) || $lengthen_noseLift<0 || $lengthen_noseLift>100 || floor($lengthen_noseLift)!=$lengthen_noseLift || strpos($lengthen_noseLift, '.')>0){
  165. $this->error("美型--长鼻请设置0-100之间的整数");
  166. }
  167. cmf_set_option('site_info', $options);
  168. $action="修改网站配置";
  169. if($options['company_name'] !=$oldconfig['company_name']){
  170. $action.='公司名称由 '.$oldconfig['company_name'].'改为'.$options['company_name'].' ;';
  171. }
  172. if($options['company_desc'] !=$oldconfig['company_desc']){
  173. $action.='公司简介 ;';
  174. }
  175. if($options['app_name'] !=$oldconfig['app_name']){
  176. $action.='APP名称由 '.$oldconfig['app_name'].'改为'.$options['app_name'].' ;';
  177. }
  178. if($options['sitename'] !=$oldconfig['sitename']){
  179. $action.='网站标题由 '.$oldconfig['sitename'].'改为'.$options['sitename'].' ;';
  180. }
  181. if($options['site'] !=$oldconfig['site']){
  182. $action.='网站域名由 '.$oldconfig['site'].'改为'.$options['site'].' ;';
  183. }
  184. if($options['name_coin'] !=$oldconfig['name_coin']){
  185. $action.='钻石名称由 '.$oldconfig['name_coin'].'改为'.$options['name_coin'].' ;';
  186. }
  187. if($options['name_votes'] !=$oldconfig['name_votes']){
  188. $action.='金币名称由 '.$oldconfig['name_votes'].'改为'.$options['name_votes'].' ;';
  189. }
  190. if($options['copyright'] !=$oldconfig['copyright']){
  191. $action.='版权信息由 '.$oldconfig['copyright'].'改为'.$options['copyright'].' ;';
  192. }
  193. if($options['qq'] !=$oldconfig['qq']){
  194. $action.='客服QQ由 '.$oldconfig['qq'].'改为'.$options['qq'].' ;';
  195. }
  196. if($options['mobile'] !=$oldconfig['mobile']){
  197. $action.='客服电话由 '.$oldconfig['mobile'].'改为'.$options['mobile'].' ;';
  198. }
  199. if($options['watermark'] !=$oldconfig['watermark']){
  200. $action.='水印图片由 '.$oldconfig['watermark'].'改为'.$options['watermark'].' ;';
  201. }
  202. if($options['qr_url'] !=$oldconfig['qr_url']){
  203. $action.='安卓下载二维码由 '.$oldconfig['qr_url'].'改为'.$options['qr_url'].' ;';
  204. }
  205. if($options['qr_url_ios'] !=$oldconfig['qr_url_ios']){
  206. $action.='iOS下载二维码由 '.$oldconfig['qr_url_ios'].'改为'.$options['qr_url_ios'].' ;';
  207. }
  208. if($options['apk_ver'] !=$oldconfig['apk_ver']){
  209. $action.='APK版本号由 '.$oldconfig['apk_ver'].'改为'.$options['apk_ver'].' ;';
  210. }
  211. if($options['apk_url'] !=$oldconfig['apk_url']){
  212. $action.='APK下载链接由 '.$oldconfig['apk_url'].'改为'.$options['apk_url'].' ;';
  213. }
  214. if($options['apk_des'] !=$oldconfig['apk_des']){
  215. $action.='APK更新说明由 '.$oldconfig['apk_des'].'改为'.$options['apk_des'].' ;';
  216. }
  217. if($options['ipa_ver'] !=$oldconfig['ipa_ver']){
  218. $action.='IPA版本号由 '.$oldconfig['ipa_ver'].'改为'.$options['ipa_ver'].' ;';
  219. }
  220. if($options['ios_shelves'] !=$oldconfig['ios_shelves']){
  221. $action.='IPA上架版本号由 '.$oldconfig['ios_shelves'].'改为'.$options['ios_shelves'].' ;';
  222. }
  223. if($options['ipa_url'] !=$oldconfig['ipa_url']){
  224. $action.='IPA下载链接由 '.$oldconfig['ipa_url'].'改为'.$options['ipa_url'].' ;';
  225. }
  226. if($options['ipa_des'] !=$oldconfig['ipa_des']){
  227. $action.='IPA更新说明由 '.$oldconfig['ipa_des'].'改为'.$options['ipa_des'].' ;';
  228. }
  229. if($options['app_android'] !=$oldconfig['app_android']){
  230. $action.='AndroidAPP下载链接由 '.$oldconfig['app_android'].'改为'.$options['app_android'].' ;';
  231. }
  232. if($options['app_ios'] !=$oldconfig['app_ios']){
  233. $action.='IOSAPP下载链接由 '.$oldconfig['app_ios'].'改为'.$options['app_ios'].' ;';
  234. }
  235. if($options['video_share_title'] !=$oldconfig['video_share_title']){
  236. $action.='短视频分享标题由 '.$oldconfig['video_share_title'].'改为'.$options['video_share_title'].' ;';
  237. }
  238. if($options['video_share_des'] !=$oldconfig['video_share_des']){
  239. $action.='短视频分享话术由 '.$oldconfig['video_share_des'].'改为'.$options['video_share_des'].' ;';
  240. }
  241. if($options['agent_share_title'] !=$oldconfig['agent_share_title']){
  242. $action.='邀请好友分享标题由 '.$oldconfig['agent_share_title'].'改为'.$options['agent_share_title'].' ;';
  243. }
  244. if($options['agent_share_des'] !=$oldconfig['agent_share_des']){
  245. $action.='邀请好友分享话术由 '.$oldconfig['agent_share_des'].'改为'.$options['agent_share_des'].' ;';
  246. }
  247. if($options['wx_siteurl'] !=$oldconfig['wx_siteurl']){
  248. $action.='微信推广域名由 '.$oldconfig['wx_siteurl'].'改为'.$options['wx_siteurl'].' ;';
  249. }
  250. if($options['share_title'] !=$oldconfig['share_title']){
  251. $action.='直播分享标题由 '.$oldconfig['share_title'].'改为'.$options['share_title'].' ;';
  252. }
  253. if($options['share_des'] !=$oldconfig['share_des']){
  254. $action.='直播分享话术由 '.$oldconfig['share_des'].'改为'.$options['share_des'].' ;';
  255. }
  256. if($options['sprout_key'] !=$oldconfig['sprout_key']){
  257. $action.='萌颜授权码Android由 '.$oldconfig['sprout_key'].'改为'.$options['sprout_key'].' ;';
  258. }
  259. if($options['sprout_key_ios'] !=$oldconfig['sprout_key_ios']){
  260. $action.='萌颜授权码iOS由 '.$oldconfig['sprout_key_ios'].'改为'.$options['sprout_key_ios'].' ;';
  261. }
  262. if($options['brightness'] !=$oldconfig['brightness']){
  263. $action.='美颜--亮度由 '.$oldconfig['brightness'].'改为'.$options['brightness'].' ;';
  264. }
  265. if($options['skin_whiting'] !=$oldconfig['skin_whiting']){
  266. $action.='美颜--美白由 '.$oldconfig['skin_whiting'].'改为'.$options['skin_whiting'].' ;';
  267. }
  268. if($options['skin_smooth'] !=$oldconfig['skin_smooth']){
  269. $action.='美颜--磨皮由 '.$oldconfig['skin_smooth'].'改为'.$options['skin_smooth'].' ;';
  270. }
  271. if($options['skin_tenderness'] !=$oldconfig['skin_tenderness']){
  272. $action.='美颜--红润由 '.$oldconfig['skin_tenderness'].'改为'.$options['skin_tenderness'].' ;';
  273. }
  274. if($options['eye_brow'] !=$oldconfig['eye_brow']){
  275. $action.='美颜--眉毛由 '.$oldconfig['eye_brow'].'改为'.$options['eye_brow'].' ;';
  276. }
  277. if($options['big_eye'] !=$oldconfig['big_eye']){
  278. $action.='美颜--大眼由 '.$oldconfig['big_eye'].'改为'.$options['big_eye'].' ;';
  279. }
  280. if($options['eye_length'] !=$oldconfig['eye_length']){
  281. $action.='美颜--眼距由 '.$oldconfig['eye_length'].'改为'.$options['eye_length'].' ;';
  282. }
  283. if($options['eye_corner'] !=$oldconfig['eye_corner']){
  284. $action.='美颜--眼角由 '.$oldconfig['eye_corner'].'改为'.$options['eye_corner'].' ;';
  285. }
  286. if($options['eye_alat'] !=$oldconfig['eye_alat']){
  287. $action.='美颜--开眼角由 '.$oldconfig['eye_alat'].'改为'.$options['eye_alat'].' ;';
  288. }
  289. if($options['face_lift'] !=$oldconfig['face_lift']){
  290. $action.='美颜--瘦脸由 '.$oldconfig['face_lift'].'改为'.$options['face_lift'].' ;';
  291. }
  292. if($options['face_shave'] !=$oldconfig['face_shave']){
  293. $action.='美颜--削脸由 '.$oldconfig['face_shave'].'改为'.$options['face_shave'].' ;';
  294. }
  295. if($options['mouse_lift'] !=$oldconfig['mouse_lift']){
  296. $action.='美颜--嘴型由 '.$oldconfig['mouse_lift'].'改为'.$options['mouse_lift'].' ;';
  297. }
  298. if($options['nose_lift'] !=$oldconfig['nose_lift']){
  299. $action.='美颜--瘦鼻由 '.$oldconfig['nose_lift'].'改为'.$options['nose_lift'].' ;';
  300. }
  301. if($options['chin_lift'] !=$oldconfig['chin_lift']){
  302. $action.='美颜--下巴由 '.$oldconfig['chin_lift'].'改为'.$options['chin_lift'].' ;';
  303. }
  304. if($options['forehead_lift'] !=$oldconfig['forehead_lift']){
  305. $action.='美颜--额头由 '.$oldconfig['forehead_lift'].'改为'.$options['forehead_lift'].' ;';
  306. }
  307. if($options['lengthen_noseLift'] !=$oldconfig['lengthen_noseLift']){
  308. $action.='美颜--长鼻由 '.$oldconfig['lengthen_noseLift'].'改为'.$options['lengthen_noseLift'].' ;';
  309. }
  310. if($options['login_alert_title'] !=$oldconfig['login_alert_title']){
  311. $action.='弹框标题由 '.$oldconfig['login_alert_title'].'改为'.$options['login_alert_title'].' ;';
  312. }
  313. if($options['login_alert_content'] !=$oldconfig['login_alert_content']){
  314. $action.='弹框内容 ;';
  315. }
  316. if($options['login_clause_title'] !=$oldconfig['login_clause_title']){
  317. $action.='APP登录界面底部协议标题由 '.$oldconfig['login_clause_title'].'改为'.$options['login_clause_title'].' ;';
  318. }
  319. if($options['login_private_title'] !=$oldconfig['login_private_title']){
  320. $action.='隐私政策名称由 '.$oldconfig['login_private_title'].'改为'.$options['login_private_title'].' ;';
  321. }
  322. if($options['login_private_url'] !=$oldconfig['login_private_url']){
  323. $action.='隐私政策跳转链接由 '.$oldconfig['login_private_url'].'改为'.$options['login_private_url'].' ;';
  324. }
  325. if($options['login_service_title'] !=$oldconfig['login_service_title']){
  326. $action.='服务协议名称由 '.$oldconfig['login_service_title'].'改为'.$options['login_service_title'].' ;';
  327. }
  328. if($options['login_service_url'] !=$oldconfig['login_service_url']){
  329. $action.='服务协议跳转链接由 '.$oldconfig['login_service_url'].'改为'.$options['login_service_url'].' ;';
  330. }
  331. if($action!='修改网站配置'){
  332. setAdminLog($action);
  333. }
  334. $cmfSettings = $this->request->param('cmf_settings/a');
  335. /*$bannedUsernames = preg_replace("/[^0-9A-Za-z_\\x{4e00}-\\x{9fa5}-]/u", ",", $cmfSettings['banned_usernames']);
  336. $cmfSettings['banned_usernames'] = $bannedUsernames;*/
  337. cmf_set_option('cmf_settings', $cmfSettings);
  338. $cdnSettings = $this->request->param('cdn_settings/a');
  339. cmf_set_option('cdn_settings', $cdnSettings);
  340. $adminSettings = $this->request->param('admin_settings/a');
  341. $routeModel = new RouteModel();
  342. if (!empty($adminSettings['admin_password'])) {
  343. $routeModel->setRoute($adminSettings['admin_password'] . '$', 'admin/Index/index', [], 2, 5000);
  344. } else {
  345. $routeModel->deleteRoute('admin/Index/index', []);
  346. }
  347. $routeModel->getRoutes(true);
  348. if (!empty($adminSettings['admin_theme'])) {
  349. $result = cmf_set_dynamic_config([
  350. 'template' => [
  351. 'cmf_admin_default_theme' => $adminSettings['admin_theme']
  352. ]
  353. ]);
  354. if ($result === false) {
  355. $this->error('配置写入失败!');
  356. }
  357. }
  358. cmf_set_option('admin_settings', $adminSettings);
  359. $config= Db::name("option")
  360. ->where("option_name='site_info'")
  361. ->value("option_value");
  362. $config=json_decode($config,true);
  363. setcaches("getConfigPub",$config);
  364. $this->success("保存成功!", '');
  365. }
  366. }
  367. /**
  368. * 密码修改
  369. * @adminMenu(
  370. * 'name' => '密码修改',
  371. * 'parent' => 'default',
  372. * 'display'=> false,
  373. * 'hasView'=> true,
  374. * 'order' => 10000,
  375. * 'icon' => '',
  376. * 'remark' => '密码修改',
  377. * 'param' => ''
  378. * )
  379. */
  380. public function password()
  381. {
  382. return $this->fetch();
  383. }
  384. /**
  385. * 密码修改提交
  386. * @adminMenu(
  387. * 'name' => '密码修改提交',
  388. * 'parent' => 'password',
  389. * 'display'=> false,
  390. * 'hasView'=> false,
  391. * 'order' => 10000,
  392. * 'icon' => '',
  393. * 'remark' => '密码修改提交',
  394. * 'param' => ''
  395. * )
  396. */
  397. public function passwordPost()
  398. {
  399. if ($this->request->isPost()) {
  400. $data = $this->request->param();
  401. if (empty($data['old_password'])) {
  402. $this->error("原始密码不能为空!");
  403. }
  404. if (empty($data['password'])) {
  405. $this->error("新密码不能为空!");
  406. }
  407. $userId = cmf_get_current_admin_id();
  408. $admin = UserModel::where("id", $userId)->find();
  409. $oldPassword = $data['old_password'];
  410. $password = $data['password'];
  411. $rePassword = $data['re_password'];
  412. if (cmf_compare_password($oldPassword, $admin['user_pass'])) {
  413. if ($password == $rePassword) {
  414. if (cmf_compare_password($password, $admin['user_pass'])) {
  415. $this->error("新密码不能和原始密码相同!");
  416. } else {
  417. UserModel::where('id', $userId)->update(['user_pass' => cmf_password($password)]);
  418. $this->success("密码修改成功!");
  419. }
  420. } else {
  421. $this->error("密码输入不一致!");
  422. }
  423. } else {
  424. $this->error("原始密码不正确!");
  425. }
  426. }
  427. }
  428. /**
  429. * 上传限制设置界面
  430. * @adminMenu(
  431. * 'name' => '上传设置',
  432. * 'parent' => 'default',
  433. * 'display'=> true,
  434. * 'hasView'=> true,
  435. * 'order' => 10000,
  436. * 'icon' => '',
  437. * 'remark' => '上传设置',
  438. * 'param' => ''
  439. * )
  440. */
  441. public function upload()
  442. {
  443. $uploadSetting = cmf_get_upload_setting();
  444. $this->assign('upload_setting', $uploadSetting);
  445. return $this->fetch();
  446. }
  447. /**
  448. * 上传限制设置界面提交
  449. * @adminMenu(
  450. * 'name' => '上传设置提交',
  451. * 'parent' => 'upload',
  452. * 'display'=> false,
  453. * 'hasView'=> false,
  454. * 'order' => 10000,
  455. * 'icon' => '',
  456. * 'remark' => '上传设置提交',
  457. * 'param' => ''
  458. * )
  459. */
  460. public function uploadPost()
  461. {
  462. if ($this->request->isPost()) {
  463. //TODO 非空验证
  464. $uploadSetting = $this->request->post();
  465. cmf_set_option('upload_setting', $uploadSetting);
  466. $this->success('保存成功!');
  467. }
  468. }
  469. /**
  470. * 清除缓存
  471. * @adminMenu(
  472. * 'name' => '清除缓存',
  473. * 'parent' => 'default',
  474. * 'display'=> false,
  475. * 'hasView'=> true,
  476. * 'order' => 10000,
  477. * 'icon' => '',
  478. * 'remark' => '清除缓存',
  479. * 'param' => ''
  480. * )
  481. */
  482. public function clearCache()
  483. {
  484. $content = hook_one('admin_setting_clear_cache_view');
  485. if (!empty($content)) {
  486. return $content;
  487. }
  488. cmf_clear_cache();
  489. return $this->fetch();
  490. }
  491. /**
  492. * 私密设置
  493. */
  494. public function configpri(){
  495. $siteinfo=cmf_get_option('site_info');
  496. $name_coin=$siteinfo['name_coin'];
  497. $name_votes=$siteinfo['name_votes'];
  498. $this->assign('config', cmf_get_option('configpri'));
  499. $this->assign("name_coin",$name_coin);
  500. $this->assign("name_votes",$name_votes);
  501. return $this->fetch();
  502. }
  503. /**
  504. * 私密设置提交
  505. */
  506. public function configpriPost(){
  507. if ($this->request->isPost()) {
  508. $options = $this->request->param('options');
  509. $oldconfigpri=cmf_get_option('configpri');
  510. $cash_rate=$options['cash_rate'];
  511. if(!is_numeric($cash_rate)){
  512. $this->error("提现配置中的提现比例必须为数字");
  513. }
  514. if($cash_rate<0){
  515. $this->error("提现配置中的提现比例不能为负数");
  516. }
  517. if(floor($cash_rate)!=$cash_rate){
  518. $this->error("提现配置中的提现比例不能为小数");
  519. }
  520. $cash_take=$options['cash_take'];
  521. if(!is_numeric($cash_take)){
  522. $this->error("提现配置中的提现抽成必须为数字");
  523. }
  524. if($cash_take<0){
  525. $this->error("提现配置中的提现抽成不能为负数");
  526. }
  527. if(floor($cash_take)!=$cash_take){
  528. $this->error("提现配置中的提现抽成不能为小数");
  529. }
  530. $cash_min=$options['cash_min'];
  531. if(!is_numeric($cash_min)){
  532. $this->error("提现配置中的提现最低额度必须为数字");
  533. }
  534. if($cash_min<0){
  535. $this->error("提现配置中的提现比例不能为负数");
  536. }
  537. $cash_start=$options['cash_start'];
  538. $cash_end=$options['cash_end'];
  539. if(!is_numeric($cash_start)){
  540. $this->error("提现配置中的每月提现期限开始日期必须为数字");
  541. }
  542. if($cash_start<1){
  543. $this->error("提现配置中的每月提现期限开始日期必须为大于0的整数");
  544. }
  545. if(floor($cash_start)!=$cash_start){
  546. $this->error("提现配置中的每月提现期限开始日期必须为大于0的整数");
  547. }
  548. if(!is_numeric($cash_end)){
  549. $this->error("提现配置中的每月提现期限结束日期必须为数字");
  550. }
  551. if($cash_end<1){
  552. $this->error("提现配置中的每月提现期限结束日期必须为大于0的整数");
  553. }
  554. if(floor($cash_end)!=$cash_end){
  555. $this->error("提现配置中的每月提现期限结束日期必须为大于0的整数");
  556. }
  557. if($cash_end<$cash_start){
  558. $this->error("提现配置中的每月提现期限结束日期必须大于开始日期");
  559. }
  560. $cash_max_times=$options['cash_max_times'];
  561. if(!is_numeric($cash_max_times)){
  562. $this->error("提现配置中的每月提现次数必须为数字");
  563. }
  564. if($cash_max_times<0){
  565. $this->error("提现配置中的每月提现次数必须为大于等于0的整数");
  566. }
  567. if(floor($cash_max_times)!=$cash_max_times){
  568. $this->error("提现配置中的每月提现次数必须为大于等于0的整数");
  569. }
  570. cmf_set_option('configpri', $options);
  571. $config= Db::name("option")
  572. ->where("option_name='configpri'")
  573. ->value("option_value");
  574. $config=json_decode($config,true);
  575. setcaches("getConfigPri",$config);
  576. $action="修改私密配置";
  577. if($options['cache_switch'] !=$oldconfigpri['cache_switch']){
  578. $cache_switch=$options['cache_switch']?'开':'关';
  579. $action.='缓存开关 '.$cache_switch.';';
  580. }
  581. if($options['cache_time'] !=$oldconfigpri['cache_time']){
  582. $action.='缓存时间由 '.$oldconfigpri['cache_time'].'改为'.$options['cache_time'].' ;';
  583. }
  584. if($options['auth_islimit'] !=$oldconfigpri['auth_islimit']){
  585. $auth_islimit=$options['auth_islimit']?'开':'关';
  586. $action.='认证限制 '.$auth_islimit.';';
  587. }
  588. if($options['private_letter_switch'] !=$oldconfigpri['private_letter_switch']){
  589. $private_letter_switch=$options['private_letter_switch']?'开':'关';
  590. $action.='未关注发送消息条数开关 '.$private_letter_switch.';';
  591. }
  592. if($options['private_letter_nums'] !=$oldconfigpri['private_letter_nums']){
  593. $action.='未关注可发送消息条数由 '.$oldconfigpri['private_letter_nums'].'改为'.$options['private_letter_nums'].' ;';
  594. }
  595. if($options['video_audit_switch'] !=$oldconfigpri['video_audit_switch']){
  596. $video_audit_switch=$options['video_audit_switch']?'开':'关';
  597. $action.='视频审核开关 '.$video_audit_switch.';';
  598. }
  599. if($options['login_wx_appid'] !=$oldconfigpri['login_wx_appid']){
  600. $action.='微信公众平台Appid由 '.$oldconfigpri['login_wx_appid'].'改为'.$options['login_wx_appid'].' ;';
  601. }
  602. if($options['login_wx_appsecret'] !=$oldconfigpri['login_wx_appsecret']){
  603. $action.='微信公众平台AppSecret由 '.$oldconfigpri['login_wx_appsecret'].'改为'.$options['login_wx_appsecret'].' ;';
  604. }
  605. if($options['sendcode_switch'] !=$oldconfigpri['sendcode_switch']){
  606. $sendcode_switch=$options['sendcode_switch']?'开':'关';
  607. $action.='短信验证码开关 '.$sendcode_switch.';';
  608. }
  609. if($options['code_switch'] !=$oldconfigpri['code_switch']){
  610. $code_switch=$options['code_switch']==1?'阿里云':'容联云';
  611. $action.='短信接口平台 '.$code_switch.';';
  612. }
  613. if($options['ccp_sid'] !=$oldconfigpri['ccp_sid']){
  614. $action.='容联云ACCOUNT SID由 '.$oldconfigpri['ccp_sid'].'改为'.$options['ccp_sid'].' ;';
  615. }
  616. if($options['ccp_token'] !=$oldconfigpri['ccp_token']){
  617. $action.='容联云ACCOUNT TOKEN由 '.$oldconfigpri['ccp_token'].'改为'.$options['ccp_token'].' ;';
  618. }
  619. if($options['ccp_appid'] !=$oldconfigpri['ccp_appid']){
  620. $action.='容联云应用APPID由 '.$oldconfigpri['ccp_appid'].'改为'.$options['ccp_appid'].' ;';
  621. }
  622. if($options['ccp_tempid'] !=$oldconfigpri['ccp_tempid']){
  623. $action.='容联云短信模板ID由 '.$oldconfigpri['ccp_tempid'].'改为'.$options['ccp_tempid'].' ;';
  624. }
  625. if($options['aly_keyid'] !=$oldconfigpri['aly_keyid']){
  626. $action.='阿里云AccessKey ID由 '.$oldconfigpri['aly_keyid'].'改为'.$options['aly_keyid'].' ;';
  627. }
  628. if($options['aly_secret'] !=$oldconfigpri['aly_secret']){
  629. $action.='阿里云AccessKey Secret由 '.$oldconfigpri['aly_secret'].'改为'.$options['aly_secret'].' ;';
  630. }
  631. if($options['aly_signName'] !=$oldconfigpri['aly_signName']){
  632. $action.='阿里云短信签名由 '.$oldconfigpri['aly_signName'].'改为'.$options['aly_signName'].' ;';
  633. }
  634. if($options['aly_templateCode'] !=$oldconfigpri['aly_templateCode']){
  635. $action.='阿里云短信模板ID由 '.$oldconfigpri['aly_templateCode'].'改为'.$options['aly_templateCode'].' ;';
  636. }
  637. if($options['iplimit_switch'] !=$oldconfigpri['iplimit_switch']){
  638. $iplimit_switch=$options['iplimit_switch']?'开':'关';
  639. $action.='短信验证码IP限制开关 '.$iplimit_switch.';';
  640. }
  641. if($options['iplimit_times'] !=$oldconfigpri['iplimit_times']){
  642. $action.='短信验证码IP限制次数由 '.$oldconfigpri['iplimit_times'].'改为'.$options['iplimit_times'].' ;';
  643. }
  644. if($options['same_device_ip_regnums'] !=$oldconfigpri['same_device_ip_regnums']){
  645. $action.='同设备同ip可注册用户数由 '.$oldconfigpri['same_device_ip_regnums'].'改为'.$options['same_device_ip_regnums'].' ;';
  646. }
  647. if($options['jpush_switch'] !=$oldconfigpri['jpush_switch']){
  648. $jpush_switch=$options['jpush_switch']?'开':'关';
  649. $action.='推送开关 '.$jpush_switch.';';
  650. }
  651. if($options['video_showtype'] !=$oldconfigpri['video_showtype']){
  652. $video_showtype=$options['video_showtype']?'按曝光值':'随机';
  653. $action.='推荐视频显示方式 '.$video_showtype.';';
  654. }
  655. if($options['ad_video_switch'] !=$oldconfigpri['ad_video_switch']){
  656. $ad_video_switch=$options['ad_video_switch']?'开':'关';
  657. $action.='广告视频开关 '.$ad_video_switch.';';
  658. }
  659. if($options['ad_video_loop'] !=$oldconfigpri['ad_video_loop']){
  660. $ad_video_loop=$options['ad_video_loop']?'开':'关';
  661. $action.='广告是否轮循展示 '.$ad_video_loop.';';
  662. }
  663. if($options['video_ad_num'] !=$oldconfigpri['video_ad_num']){
  664. $action.='滑动几个视频出现广告由 '.$oldconfigpri['video_ad_num'].'改为'.$options['video_ad_num'].' ;';
  665. }
  666. if($options['comment_weight'] !=$oldconfigpri['comment_weight']){
  667. $action.='评论权重值由 '.$oldconfigpri['comment_weight'].'改为'.$options['comment_weight'].' ;';
  668. }
  669. if($options['like_weight'] !=$oldconfigpri['like_weight']){
  670. $action.='点赞权重值由 '.$oldconfigpri['like_weight'].'改为'.$options['like_weight'].' ;';
  671. }
  672. if($options['share_weight'] !=$oldconfigpri['share_weight']){
  673. $action.='分享权重值由 '.$oldconfigpri['share_weight'].'改为'.$options['share_weight'].' ;';
  674. }
  675. if($options['show_val'] !=$oldconfigpri['show_val']){
  676. $action.='初始曝光值由 '.$oldconfigpri['show_val'].'改为'.$options['show_val'].' ;';
  677. }
  678. if($options['hour_minus_val'] !=$oldconfigpri['hour_minus_val']){
  679. $action.='每小时扣除曝光值由 '.$oldconfigpri['hour_minus_val'].'改为'.$options['hour_minus_val'].' ;';
  680. }
  681. if($options['um_apikey'] !=$oldconfigpri['um_apikey']){
  682. $action.='友盟OpenApi-apiKey由 '.$oldconfigpri['um_apikey'].'改为'.$options['um_apikey'].' ;';
  683. }
  684. if($options['um_apisecurity'] !=$oldconfigpri['um_apisecurity']){
  685. $action.='友盟OpenApi-apiSecurity由 '.$oldconfigpri['um_apisecurity'].'改为'.$options['um_apisecurity'].' ;';
  686. }
  687. if($options['um_appkey_android'] !=$oldconfigpri['um_appkey_android']){
  688. $action.='友盟Android应用-appkey由 '.$oldconfigpri['um_appkey_android'].'改为'.$options['um_appkey_android'].' ;';
  689. }
  690. if($options['um_appkey_ios'] !=$oldconfigpri['um_appkey_ios']){
  691. $action.='友盟IOS应用-appkey由 '.$oldconfigpri['um_appkey_ios'].'改为'.$options['um_appkey_ios'].' ;';
  692. }
  693. if($options['show_switch'] !=$oldconfigpri['show_switch']){
  694. $show_switch=$options['show_switch']?'开':'关';
  695. $action.='店铺审核 '.$show_switch.';';
  696. }
  697. if($options['agent_switch'] !=$oldconfigpri['agent_switch']){
  698. $agent_switch=$options['agent_switch']?'开':'关';
  699. $action.='邀请开关 '.$agent_switch.';';
  700. }
  701. if($options['agent_must'] !=$oldconfigpri['agent_must']){
  702. $agent_must=$options['agent_must']?'开':'关';
  703. $action.='邀请码必填 '.$agent_must.';';
  704. }
  705. if($options['agent_reward'] !=$oldconfigpri['agent_reward']){
  706. $action.='每邀请一个新人的奖励由 '.$oldconfigpri['agent_reward'].'改为'.$options['agent_reward'].' ;';
  707. }
  708. if($options['agent_v_l'] !=$oldconfigpri['agent_v_l']){
  709. $action.='每天观看的视频时长由 '.$oldconfigpri['agent_v_l'].'改为'.$options['agent_v_l'].' ;';
  710. }
  711. if($options['agent_v_a'] !=$oldconfigpri['agent_v_a']){
  712. $action.='每天观看的规定视频时长的奖励由 '.$oldconfigpri['agent_v_a'].'改为'.$options['agent_v_a'].' ;';
  713. }
  714. if($options['agent_a'] !=$oldconfigpri['agent_a']){
  715. $action.='用户获取观看视频奖励时,上级用户获取的奖励由 '.$oldconfigpri['agent_a'].'改为'.$options['agent_a'].' ;';
  716. }
  717. if($options['aliapp_partner'] !=$oldconfigpri['aliapp_partner']){
  718. $action.='支付宝合作者身份ID由 '.$oldconfigpri['aliapp_partner'].'改为'.$options['aliapp_partner'].' ;';
  719. }
  720. if($options['aliapp_seller_id'] !=$oldconfigpri['aliapp_seller_id']){
  721. $action.='支付宝帐号由 '.$oldconfigpri['aliapp_seller_id'].'改为'.$options['aliapp_seller_id'].' ;';
  722. }
  723. if($options['aliapp_key_android'] !=$oldconfigpri['aliapp_key_android']){
  724. $action.='支付宝安卓密钥修改 ;';
  725. }
  726. if($options['aliapp_key_ios'] !=$oldconfigpri['aliapp_key_ios']){
  727. $action.='支付宝ios密钥修改 ;';
  728. }
  729. if($options['wx_appid'] !=$oldconfigpri['wx_appid']){
  730. $action.='微信开放平台移动应用AppID由 '.$oldconfigpri['wx_appid'].'改为'.$options['wx_appid'].' ;';
  731. }
  732. if($options['wx_appsecret'] !=$oldconfigpri['wx_appsecret']){
  733. $action.='微信开放平台移动应用appsecret由 '.$oldconfigpri['wx_appsecret'].'改为'.$options['wx_appsecret'].' ;';
  734. }
  735. if($options['wx_mchid'] !=$oldconfigpri['wx_mchid']){
  736. $action.='微信商户号mchid由 '.$oldconfigpri['wx_mchid'].'改为'.$options['wx_mchid'].' ;';
  737. }
  738. if($options['wx_key'] !=$oldconfigpri['wx_key']){
  739. $action.='微信密钥key由 '.$oldconfigpri['wx_key'].'改为'.$options['wx_key'].' ;';
  740. }
  741. if($options['aliapp_switch'] !=$oldconfigpri['aliapp_switch']){
  742. $aliapp_switch=$options['aliapp_switch']?'开':'关';
  743. $action.='支付宝支付开关 '.$aliapp_switch.';';
  744. }
  745. if($options['ios_switch'] !=$oldconfigpri['ios_switch']){
  746. $ios_switch=$options['ios_switch']?'开':'关';
  747. $action.='苹果支付开关 '.$ios_switch.';';
  748. }
  749. if($options['ios_switch'] !=$oldconfigpri['ios_switch']){
  750. $ios_switch=$options['ios_switch']?'开':'关';
  751. $action.='苹果支付开关 '.$ios_switch.';';
  752. }
  753. if($options['wx_switch'] !=$oldconfigpri['wx_switch']){
  754. $wx_switch=$options['wx_switch']?'开':'关';
  755. $action.='微信支付开关 '.$wx_switch.';';
  756. }
  757. if($options['vip_aliapp_switch'] !=$oldconfigpri['vip_aliapp_switch']){
  758. $vip_aliapp_switch=$options['vip_aliapp_switch']?'开':'关';
  759. $action.='vip充值 支付宝支付开关 '.$vip_aliapp_switch.';';
  760. }
  761. if($options['vip_wx_switch'] !=$oldconfigpri['vip_wx_switch']){
  762. $vip_wx_switch=$options['vip_wx_switch']?'开':'关';
  763. $action.='vip充值 微信支付开关 '.$vip_wx_switch.';';
  764. }
  765. if($options['vip_coin_switch'] !=$oldconfigpri['vip_coin_switch']){
  766. $vip_coin_switch=$options['vip_coin_switch']?'开':'关';
  767. $action.='vip充值 余额支付开关 '.$vip_coin_switch.';';
  768. }
  769. if($options['cash_rate'] !=$oldconfigpri['cash_rate']){
  770. $action.='提现比例由 '.$oldconfigpri['cash_rate'].'改为'.$options['cash_rate'].' ;';
  771. }
  772. if($options['cash_min'] !=$oldconfigpri['cash_min']){
  773. $action.='提现最低额度 '.$oldconfigpri['cash_min'].'改为'.$options['cash_min'].' ;';
  774. }
  775. if($options['popular_interval'] !=$oldconfigpri['popular_interval']){
  776. $action.='上热门视频添加间隔 '.$oldconfigpri['popular_interval'].'改为'.$options['popular_interval'].' ;';
  777. }
  778. if($options['popular_base'] !=$oldconfigpri['popular_base']){
  779. $action.='热门基数 '.$oldconfigpri['popular_base'].'改为'.$options['popular_base'].' ;';
  780. }
  781. if($options['popular_tips'] !=$oldconfigpri['popular_tips']){
  782. $action.='上热门提示内容 ;';
  783. }
  784. if($options['vip_switch'] !=$oldconfigpri['vip_switch']){
  785. $vip_switch=$options['vip_switch']?'开':'关';
  786. $action.='vip开关 '.$vip_switch.';';
  787. }
  788. if($options['nonvip_upload_nums'] !=$oldconfigpri['nonvip_upload_nums']){
  789. $action.='非VIP用户每天可上传视频数 '.$oldconfigpri['nonvip_upload_nums'].'改为'.$options['nonvip_upload_nums'].' ;';
  790. }
  791. if($options['watch_video_type'] !=$oldconfigpri['watch_video_type']){
  792. $vip_switch=$options['watch_video_type']?'内容限制模式':'次数限制模式';
  793. $action.='短视频观看模式 '.$vip_switch.';';
  794. }
  795. if($options['nonvip_watch_nums'] !=$oldconfigpri['nonvip_watch_nums']){
  796. $action.='免费观看视频数 '.$oldconfigpri['nonvip_watch_nums'].'改为'.$options['nonvip_watch_nums'].' ;';
  797. }
  798. if($options['cloudtype'] !=$oldconfigpri['cloudtype']){
  799. $cloudtype=$options['cloudtype']==1?'七牛云存储':'腾讯云存储';
  800. $action.='云存储 '.$cloudtype.';';
  801. }
  802. if($options['qiniu_zone'] !=$oldconfigpri['qiniu_zone']){
  803. $action.='七牛云存储区域 ;';
  804. }
  805. if($options['qiniu_protocol'] !=$oldconfigpri['qiniu_protocol']){
  806. $action.='七牛存储域名协议 ;';
  807. }
  808. if($options['qiniu_accesskey'] !=$oldconfigpri['qiniu_accesskey']){
  809. $action.='七牛云存储accessKey '.$oldconfigpri['qiniu_accesskey'].'改为'.$options['qiniu_accesskey'].' ;';
  810. }
  811. if($options['qiniu_secretkey'] !=$oldconfigpri['qiniu_secretkey']){
  812. $action.='七牛云存储secretKey '.$oldconfigpri['qiniu_secretkey'].'改为'.$options['qiniu_secretkey'].' ;';
  813. }
  814. if($options['qiniu_bucket'] !=$oldconfigpri['qiniu_bucket']){
  815. $action.='七牛云存储bucket '.$oldconfigpri['qiniu_bucket'].'改为'.$options['qiniu_bucket'].' ;';
  816. }
  817. if($options['qiniu_domain'] !=$oldconfigpri['qiniu_domain']){
  818. $action.='七牛云存储空间域名 '.$oldconfigpri['qiniu_domain'].'改为'.$options['qiniu_domain'].' ;';
  819. }
  820. if($options['tx_private_signature'] !=$oldconfigpri['tx_private_signature']){
  821. $tx_private_signature=$options['tx_private_signature']?'开':'关';
  822. $action.='腾讯云存储是否开启私有读签名验证 '.$tx_private_signature.';';
  823. }
  824. if($options['txcloud_appid'] !=$oldconfigpri['txcloud_appid']){
  825. $action.='腾讯云存储appid '.$oldconfigpri['txcloud_appid'].'改为'.$options['txcloud_appid'].' ;';
  826. }
  827. if($options['txcloud_secret_id'] !=$oldconfigpri['txcloud_secret_id']){
  828. $action.='腾讯云存储secret_id '.$oldconfigpri['txcloud_secret_id'].'改为'.$options['txcloud_secret_id'].' ;';
  829. }
  830. if($options['txcloud_secret_key'] !=$oldconfigpri['txcloud_secret_key']){
  831. $action.='腾讯云存储secret_key '.$oldconfigpri['txcloud_secret_key'].'改为'.$options['txcloud_secret_key'].' ;';
  832. }
  833. if($options['txcloud_region'] !=$oldconfigpri['txcloud_region']){
  834. $action.='腾讯云存储region '.$oldconfigpri['txcloud_region'].'改为'.$options['txcloud_region'].' ;';
  835. }
  836. if($options['txcloud_bucket'] !=$oldconfigpri['txcloud_bucket']){
  837. $action.='腾讯云存储bucket '.$oldconfigpri['txcloud_bucket'].'改为'.$options['txcloud_bucket'].' ;';
  838. }
  839. if($options['tx_domain_url'] !=$oldconfigpri['tx_domain_url']){
  840. $action.='腾讯云存储空间url地址 '.$oldconfigpri['tx_domain_url'].'改为'.$options['tx_domain_url'].' ;';
  841. }
  842. if($options['live_videos'] !=$oldconfigpri['live_videos']){
  843. $action.='进行直播需发布视频达到数量 '.$oldconfigpri['live_videos'].'改为'.$options['live_videos'].' ;';
  844. }
  845. if($options['live_fans'] !=$oldconfigpri['live_fans']){
  846. $action.='进行直播需达到粉丝数量 '.$oldconfigpri['live_fans'].'改为'.$options['live_fans'].' ;';
  847. }
  848. if($options['tx_appid'] !=$oldconfigpri['tx_appid']){
  849. $action.='腾讯云推拉流appid '.$oldconfigpri['tx_appid'].'改为'.$options['tx_appid'].' ;';
  850. }
  851. if($options['tx_bizid'] !=$oldconfigpri['tx_bizid']){
  852. $action.='腾讯云推拉流直播bizid '.$oldconfigpri['tx_bizid'].'改为'.$options['tx_bizid'].' ;';
  853. }
  854. if($options['tx_push_key'] !=$oldconfigpri['tx_push_key']){
  855. $action.='腾讯云推拉流推流防盗链Key '.$oldconfigpri['tx_push_key'].'改为'.$options['tx_push_key'].' ;';
  856. }
  857. if($options['tx_api_key'] !=$oldconfigpri['tx_api_key']){
  858. $action.='腾讯云推拉流直播API鉴权key '.$oldconfigpri['tx_api_key'].'改为'.$options['tx_api_key'].' ;';
  859. }
  860. if($options['tx_push'] !=$oldconfigpri['tx_push']){
  861. $action.='腾讯云推拉流推流域名 '.$oldconfigpri['tx_push'].'改为'.$options['tx_push'].' ;';
  862. }
  863. if($options['tx_pull'] !=$oldconfigpri['tx_pull']){
  864. $action.='腾讯云推拉流播流域名 '.$oldconfigpri['tx_pull'].'改为'.$options['tx_pull'].' ;';
  865. }
  866. if($options['userlist_time'] !=$oldconfigpri['userlist_time']){
  867. $action.='用户列表请求间隔 '.$oldconfigpri['userlist_time'].'改为'.$options['userlist_time'].' ;';
  868. }
  869. if($options['chatserver'] !=$oldconfigpri['chatserver']){
  870. $action.='聊天服务器地址 '.$oldconfigpri['chatserver'].'改为'.$options['chatserver'].' ;';
  871. }
  872. if($options['sensitive_words'] !=$oldconfigpri['sensitive_words']){
  873. $action.='敏感词 ;';
  874. }
  875. if($action!="修改私密配置"){
  876. setAdminLog($action);
  877. }
  878. $this->success("保存成功!", '');
  879. }
  880. }
  881. }