diff --git a/server/Application/Api/Controller/AdminSettingController.class.php b/server/Application/Api/Controller/AdminSettingController.class.php index d21bd51f0..b236ac4a0 100644 --- a/server/Application/Api/Controller/AdminSettingController.class.php +++ b/server/Application/Api/Controller/AdminSettingController.class.php @@ -13,10 +13,12 @@ public function saveConfig(){ $home_page = intval(I("home_page")) ; $home_item = intval(I("home_item")) ; $oss_setting = I("oss_setting") ; + $beian = I("beian") ; D("Options")->set("history_version_count" ,$history_version_count) ; D("Options")->set("register_open" ,$register_open) ; D("Options")->set("home_page" ,$home_page) ; D("Options")->set("home_item" ,$home_item) ; + D("Options")->set("beian" ,$beian) ; if ($oss_open) { $this->checkComposerPHPVersion(); @@ -38,6 +40,7 @@ public function loadConfig(){ $oss_setting = D("Options")->get("oss_setting" ) ; $home_page = D("Options")->get("home_page" ) ; $home_item = D("Options")->get("home_item" ) ; + $beian = D("Options")->get("beian" ) ; $ldap_form = json_decode($ldap_form,1); $oss_setting = json_decode($oss_setting,1); @@ -51,6 +54,7 @@ public function loadConfig(){ "history_version_count"=>$history_version_count , "home_page"=>$home_page , "home_item"=>$home_item , + "beian"=>$beian , "oss_setting"=>$oss_setting , ); $this->sendResult($array); diff --git a/server/Application/Api/Controller/CommonController.class.php b/server/Application/Api/Controller/CommonController.class.php index 354606734..17d193566 100644 --- a/server/Application/Api/Controller/CommonController.class.php +++ b/server/Application/Api/Controller/CommonController.class.php @@ -82,9 +82,11 @@ public function showCaptcha(){ public function homePageSetting(){ $home_page = D("Options")->get("home_page" ) ; $home_item = D("Options")->get("home_item" ) ; + $beian = D("Options")->get("beian" ) ; $array = array( "home_page"=>$home_page , "home_item"=>$home_item , + "beian"=>$beian , ); $this->sendResult($array); } diff --git a/server/Application/Api/Model/OptionsModel.class.php b/server/Application/Api/Model/OptionsModel.class.php index 8a146bdf4..9e8ef2ac8 100644 --- a/server/Application/Api/Model/OptionsModel.class.php +++ b/server/Application/Api/Model/OptionsModel.class.php @@ -15,8 +15,11 @@ public function get($option_name){ // public function set($option_name,$option_value){ - $sql = " replace into options (option_name , option_value ) values ('$option_name' , '$option_value')"; - return $this->execute($sql);; + $return = M('options')->add(array( + "option_name"=>$option_name , + "option_value"=>$option_value , + ),NULL,true); + return $return; } } \ No newline at end of file diff --git a/web_src/src/components/Index.vue b/web_src/src/components/Index.vue index ce8d1be53..8b41b06d7 100644 --- a/web_src/src/components/Index.vue +++ b/web_src/src/components/Index.vue @@ -190,7 +190,7 @@ }} @@ -204,7 +204,8 @@ export default { height: '', link: '', link_text: '', - lang: '' + lang: '', + beian: '' } }, methods: { @@ -221,6 +222,7 @@ export default { var url = DocConfig.server + '/api/common/homePageSetting' this.axios.post(url, this.form).then(response => { if (response.data.error_code === 0) { + this.beian = response.data.data.beian if (response.data.data.home_page == 2) { // 跳转到登录页面 this.$router.replace({ diff --git a/web_src/src/components/admin/setting/Index.vue b/web_src/src/components/admin/setting/Index.vue index c7896893c..509dd626e 100644 --- a/web_src/src/components/admin/setting/Index.vue +++ b/web_src/src/components/admin/setting/Index.vue @@ -28,6 +28,19 @@ > + + + + + + + + {{ $t('save') }} - {{ $t('cancel') }} + {{ $t('cancel') }} @@ -163,7 +176,8 @@ export default { secretId: '', secretKey: '' }, - history_version_count: 20 + history_version_count: 20, + beian: '' }, itemList: [] } @@ -208,6 +222,9 @@ export default { this.form.oss_setting.secretKey = this.form.oss_setting.secretKey ? this.form.oss_setting.secretKey : '' + this.form.beian = response.data.data.beian + ? response.data.data.beian + : '' } else { this.$alert(response.data.error_message) } diff --git a/web_src/src/main.js b/web_src/src/main.js index 0a64711ac..70e43ba2c 100644 --- a/web_src/src/main.js +++ b/web_src/src/main.js @@ -39,6 +39,8 @@ Vue.locale('en', allEnLocale) Vue.prototype.axios = axios Vue.prototype.request = request +Vue.prototype.$lang = DocConfig.lang // 把语言放进里面,这样组件中可以this.$lang来读取 + /* eslint-disable no-new */ new Vue({