From 0928ba71f29da855305dc4ebf3d39f1b6b27cf62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A6=E8=8D=A3=E8=B6=85?= <302645122@qq.com> Date: Thu, 24 Feb 2022 17:11:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A6=96=E9=A1=B5=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/SystemController.php | 25 ++++++++- resources/assets/js/pages/index.vue | 55 ++++++++++++------- .../assets/js/pages/manage/setting/system.vue | 12 ++++ 3 files changed, 70 insertions(+), 22 deletions(-) diff --git a/app/Http/Controllers/Api/SystemController.php b/app/Http/Controllers/Api/SystemController.php index 3e998b853..7c394bab4 100755 --- a/app/Http/Controllers/Api/SystemController.php +++ b/app/Http/Controllers/Api/SystemController.php @@ -41,7 +41,7 @@ class SystemController extends AbstractController User::auth('admin'); $all = Request::input(); foreach ($all AS $key => $value) { - if (!in_array($key, ['reg', 'reg_invite', 'login_code', 'password_policy', 'project_invite', 'chat_nickname'])) { + if (!in_array($key, ['reg', 'reg_invite', 'login_code', 'password_policy', 'project_invite', 'chat_nickname','start_home','home_footer'])) { unset($all[$key]); } } @@ -62,6 +62,7 @@ class SystemController extends AbstractController $setting['password_policy'] = $setting['password_policy'] ?: 'simple'; $setting['project_invite'] = $setting['project_invite'] ?: 'open'; $setting['chat_nickname'] = $setting['chat_nickname'] ?: 'optional'; + $setting['start_home'] = $setting['start_home'] ?: 'close'; // return Base::retSuccess('success', $setting ?: json_decode('{}')); } @@ -417,4 +418,26 @@ class SystemController extends AbstractController // return $data; } + + + /** + * @api {get} api/system/get/starthome 12. 获取是都开启首页信息 + * + * @apiDescription 用于判断首页跳转页面 + * @apiVersion 1.0.0 + * @apiGroup system + * @apiName get__starthome + * + * @apiSuccess {Number} ret 返回状态码(1正确、0错误) + * @apiSuccess {String} msg 返回信息(错误描述) + * @apiSuccess {Object} data 返回数据 + */ + public function get__starthome() + { + + return Base::retSuccess('success', [ + 'need_start' => Base::settingFind('system', 'start_home') == 'open', + 'home_footer' => Base::settingFind('system', 'home_footer') + ]); + } } diff --git a/resources/assets/js/pages/index.vue b/resources/assets/js/pages/index.vue index bdfc93f6c..264d8f63b 100644 --- a/resources/assets/js/pages/index.vue +++ b/resources/assets/js/pages/index.vue @@ -65,7 +65,7 @@
- +
@@ -108,10 +108,10 @@ $L("汇集文档、电子表格、思维笔记等多种在线工具,汇聚企业知识资源于一处,支持多人实时协同编辑,让团队协作更便捷。") }}
- - + + - +
@@ -119,8 +119,8 @@
- -
+ +
@@ -162,12 +162,12 @@ $L("通过灵活的任务日历,轻松安排每一天的日程,把任务拆解到每天,让工作目标更清晰,时间分配更合理。") }}
- - + +
- + - + - + @@ -196,7 +194,8 @@ export default { data() { return { screenWidth: document.body.clientWidth, - + needStartHome: false, + homeFooter: '', }; }, watch: { @@ -210,17 +209,13 @@ export default { }, }, mounted() { - // if (this.$store.state.userId > 0) { - // this.goForward({path: '/manage/dashboard'}, true); - // } else { - // this.goForward({path: '/login'}, true); - // } + this.getNeedStartHome(); const that = this; window.onresize=()=>{ window.screenWidth=document.body.clientWidth that.screenWidth=window.screenWidth } - + }, methods: { @@ -232,7 +227,7 @@ export default { false ); }, - + register() { this.goForward( { @@ -244,6 +239,24 @@ export default { false ); }, + getNeedStartHome() { + this.$store + .dispatch("call", { + url: "system/get/starthome", + }) + .then(({data}) => { + this.needStartHome = !!data.need_start; + this.homeFooter = data.home_footer; + if (this.$store.state.userId > 0) { + this.goForward({path: '/manage/dashboard'}, true); + } else if (this.needStartHome === false) { + this.goForward({path: '/login'}, true); + } + }) + .catch(() => { + this.needStartHome = false; + }); + }, }, deactivated() { // this.$destroy() diff --git a/resources/assets/js/pages/manage/setting/system.vue b/resources/assets/js/pages/manage/setting/system.vue index 9db08a145..ab12ba454 100644 --- a/resources/assets/js/pages/manage/setting/system.vue +++ b/resources/assets/js/pages/manage/setting/system.vue @@ -45,6 +45,18 @@
{{$L('必填:发送聊天内容前必须设置昵称。')}}
+ + + {{$L('开启')}} + {{$L('关闭')}} + + +