mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
feat: 首页启动设置
This commit is contained in:
parent
320f183b49
commit
0928ba71f2
@ -41,7 +41,7 @@ class SystemController extends AbstractController
|
|||||||
User::auth('admin');
|
User::auth('admin');
|
||||||
$all = Request::input();
|
$all = Request::input();
|
||||||
foreach ($all AS $key => $value) {
|
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]);
|
unset($all[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -62,6 +62,7 @@ class SystemController extends AbstractController
|
|||||||
$setting['password_policy'] = $setting['password_policy'] ?: 'simple';
|
$setting['password_policy'] = $setting['password_policy'] ?: 'simple';
|
||||||
$setting['project_invite'] = $setting['project_invite'] ?: 'open';
|
$setting['project_invite'] = $setting['project_invite'] ?: 'open';
|
||||||
$setting['chat_nickname'] = $setting['chat_nickname'] ?: 'optional';
|
$setting['chat_nickname'] = $setting['chat_nickname'] ?: 'optional';
|
||||||
|
$setting['start_home'] = $setting['start_home'] ?: 'close';
|
||||||
//
|
//
|
||||||
return Base::retSuccess('success', $setting ?: json_decode('{}'));
|
return Base::retSuccess('success', $setting ?: json_decode('{}'));
|
||||||
}
|
}
|
||||||
@ -417,4 +418,26 @@ class SystemController extends AbstractController
|
|||||||
//
|
//
|
||||||
return $data;
|
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')
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -183,9 +183,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer-opyright">
|
<div class="footer-opyright" v-html="this.homeFooter"></div>
|
||||||
{{ $L("桂公网安备 31011002000058号 桂ICP备12020087号-3") }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -196,7 +194,8 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
screenWidth: document.body.clientWidth,
|
screenWidth: document.body.clientWidth,
|
||||||
|
needStartHome: false,
|
||||||
|
homeFooter: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -210,11 +209,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// if (this.$store.state.userId > 0) {
|
this.getNeedStartHome();
|
||||||
// this.goForward({path: '/manage/dashboard'}, true);
|
|
||||||
// } else {
|
|
||||||
// this.goForward({path: '/login'}, true);
|
|
||||||
// }
|
|
||||||
const that = this;
|
const that = this;
|
||||||
window.onresize=()=>{
|
window.onresize=()=>{
|
||||||
window.screenWidth=document.body.clientWidth
|
window.screenWidth=document.body.clientWidth
|
||||||
@ -244,6 +239,24 @@ export default {
|
|||||||
false
|
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() {
|
deactivated() {
|
||||||
// this.$destroy()
|
// this.$destroy()
|
||||||
|
|||||||
@ -45,6 +45,18 @@
|
|||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
<div v-if="formDatum.chat_nickname == 'required'" class="form-tip">{{$L('必填:发送聊天内容前必须设置昵称。')}}</div>
|
<div v-if="formDatum.chat_nickname == 'required'" class="form-tip">{{$L('必填:发送聊天内容前必须设置昵称。')}}</div>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
<FormItem :label="$L('是否启动首页')" prop="startHome">
|
||||||
|
<RadioGroup v-model="formDatum.start_home">
|
||||||
|
<Radio label="open">{{$L('开启')}}</Radio>
|
||||||
|
<Radio label="close">{{$L('关闭')}}</Radio>
|
||||||
|
</RadioGroup>
|
||||||
|
<template v-if="formDatum.start_home == 'open'">
|
||||||
|
<div class="form-tip">{{ $L('首页底部:首页底部网站备案号等信息') }}</div>
|
||||||
|
<Input v-model="formDatum.home_footer" style="width:100%;margin-top:6px">
|
||||||
|
<span slot="prepend">{{ $L('首页底部') }}</span>
|
||||||
|
</Input>
|
||||||
|
</template>
|
||||||
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
<div class="setting-footer">
|
<div class="setting-footer">
|
||||||
<Button :loading="loadIng > 0" type="primary" @click="submitForm">{{$L('提交')}}</Button>
|
<Button :loading="loadIng > 0" type="primary" @click="submitForm">{{$L('提交')}}</Button>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user