管理员身份按钮文案改为管理XX

This commit is contained in:
谢思 2023-09-21 09:55:53 +08:00
parent 7cb34610a4
commit 09f695fb2d
3 changed files with 7 additions and 13 deletions

View File

@ -29,10 +29,10 @@ function Main(props){
const menu = (
<Menu>
<Menu.Item>
<a onClick={()=>{addNew("richEditor")}}>富文本编辑器</a>
<a onClick={()=>{history.push(`/zone/${deptId}/news/add?type=richEditor`)}}>富文本编辑器</a>
</Menu.Item>
<Menu.Item>
<a onClick={()=>{addNew("mdEditor")}}>MD编辑器</a>
<a onClick={()=>{history.push(`/zone/${deptId}/news/add?type=mdEditor`)}}>MD编辑器</a>
</Menu.Item>
</Menu>
);
@ -56,14 +56,6 @@ function Main(props){
}
}, [newCateId])
function addNew(type){
if(role && role.role === "Manager"){
window.open(role.docManageUrl);
}else{
history.push(`/zone/${deptId}/news/add?type=${type}`)
}
}
function getMainList(){
getNewsAllList(id).then(result=>{
if(result){
@ -134,9 +126,9 @@ function Main(props){
{role.role === "Member" && <Button type="primary" ghost className='mr20'>
<Link to={`/zone/${deptId}/news/self`}>我的文章</Link>
</Button>}
<Dropdown overlay={menu}>
{role.role === "Member" ? <Dropdown overlay={menu}>
<Button icon='plus' type="primary" ghost>新建</Button>
</Dropdown>
</Dropdown> : <Button type="primary" ghost href={role.docManageUrl} target={'_blank'}>管理资讯</Button>}
</div>}
</div>
{

View File

@ -95,7 +95,7 @@ function Source(props){
{role.role === "Member" && <Button size='large' type="primary" ghost className='mr20'>
<Link to={`/zone/${deptId}/source/self`}>我的资源</Link>
</Button>}
<Button size='large' icon='plus' type="primary" ghost onClick={addSource}>新建</Button>
<Button size='large' icon={role.role === "Member" && 'plus'} type="primary" ghost onClick={addSource}>{role.role === "Member" ? '新建' : '管理资源'}</Button>
</div>}
</div>
</div>

View File

@ -1,5 +1,6 @@
import axios from 'axios';
import { message , notification } from 'antd';
// import cookie from 'react-cookies';
function beforeFetch(actionUrl){
if (window.location.href.indexOf('localhost') < 0) {
@ -7,6 +8,7 @@ function beforeFetch(actionUrl){
}
const service = axios.create({
// headers:{Authorization: cookie.load("autologin_trustie")},
baseURL: actionUrl,
timeout: 1800000, // 请求超时时间
});