fix: 回滚代码后功能完善

This commit is contained in:
韦荣超 2022-02-25 10:54:20 +08:00
parent 1117b57101
commit a074cb9664
6 changed files with 50 additions and 2 deletions

View File

@ -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', 'auto_archived', 'archived_day'])) {
if (!in_array($key, ['reg', 'reg_invite', 'login_code', 'password_policy', 'project_invite', 'chat_nickname', 'auto_archived', 'archived_day', 'start_home', 'home_footer'])) {
unset($all[$key]);
}
}
@ -72,6 +72,7 @@ class SystemController extends AbstractController
$setting['chat_nickname'] = $setting['chat_nickname'] ?: 'optional';
$setting['auto_archived'] = $setting['auto_archived'] ?: 'close';
$setting['archived_day'] = floatval($setting['archived_day']) ?: 7;
$setting['start_home'] = $setting['start_home'] ?: 'close';
//
return Base::retSuccess('success', $setting ?: json_decode('{}'));
}
@ -478,4 +479,25 @@ class SystemController extends AbstractController
//
return $data;
}
/**
* @api {get} api/system/get/starthome 13. 启动首页设置信息
*
* @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')
]);
}
}

View File

@ -112,6 +112,7 @@ class WebSocketDialog extends AbstractModel
// 对方信息
$dialog->dialog_user = null;
$dialog->group_info = null;
$dialog->top_at = WebSocketDialogUser::whereDialogId($dialog->id)->whereUserid($userid)->value('top_at');
switch ($dialog->type) {
case "user":
$dialog_user = $builder->where('userid', '!=', $userid)->first();

View File

@ -672,7 +672,7 @@ export default {
return {
"active": this.curPath == '/manage/' + path,
"open-menu": openMenu === true,
"top": item.top_at,
"top": item.top_at && this.curPath != '/manage/' + path,
"operate": item.id == this.topOperateItem.id && this.topOperateVisible
};
},

View File

@ -13,6 +13,7 @@
</template>
<h2>{{dialogData.name}}</h2>
<em v-if="peopleNum > 0">({{peopleNum}})</em>
<label v-if="dialogData.top_at" class="top-text">{{$L('置顶')}}</label>
</div>
<template v-if="dialogData.type === 'group'">
<div v-if="dialogData.group_type === 'project'" class="sub-title pointer" @click="openProject">

View File

@ -59,6 +59,18 @@
<div slot="content">{{$L('任务完成 % 天后自动归档。', formDatum.archived_day)}}</div>
</ETooltip>
</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>
<div class="setting-footer">
<Button :loading="loadIng > 0" type="primary" @click="submitForm">{{$L('提交')}}</Button>

View File

@ -82,6 +82,18 @@
font-weight: 500;
padding-left: 6px;
}
.top-text{
width: 40px;
height: 24px;
border-radius:4px;
margin-left: 10px;
background-color: #8BCF70;
color:#FFFFFF;
text-align: center;
margin-top: 4px;
padding-top: 1px
}
}
.sub-title {