修复普通用户首页错误的问题
This commit is contained in:
parent
1ee60dfe06
commit
a5853f82f8
@ -287,7 +287,7 @@ func (r assetRepository) ExistById(c context.Context, id string) (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r assetRepository) FindMyAssets(c context.Context, pageIndex, pageSize int, name, protocol, tags string, assetIds []string, order, field string) (o []model.AssetForPage, total int64, err error) {
|
func (r assetRepository) FindMyAssets(c context.Context, pageIndex, pageSize int, name, protocol, tags string, assetIds []string, order, field string) (o []model.AssetForPage, total int64, err error) {
|
||||||
db := r.GetDB(c).Table("assets").Select("assets.id,assets.name,assets.protocol,assets.active,assets.active_message,assets.tags,assets.description,assets.last_access_time,").
|
db := r.GetDB(c).Table("assets").Select("assets.id,assets.name,assets.protocol,assets.active,assets.active_message,assets.tags,assets.description,assets.last_access_time").
|
||||||
Where("id in ?", assetIds)
|
Where("id in ?", assetIds)
|
||||||
dbCounter := r.GetDB(c).Table("assets").Where("id in ?", assetIds)
|
dbCounter := r.GetDB(c).Table("assets").Where("id in ?", assetIds)
|
||||||
|
|
||||||
|
@ -34,11 +34,13 @@ var DefaultMenu = []*model.Menu{
|
|||||||
model.NewMenu("asset-add", "新建", "asset",
|
model.NewMenu("asset-add", "新建", "asset",
|
||||||
model.NewPermission("POST", "/assets"),
|
model.NewPermission("POST", "/assets"),
|
||||||
model.NewPermission("GET", "/access-gateways"),
|
model.NewPermission("GET", "/access-gateways"),
|
||||||
|
model.NewPermission("GET", "/credentials"),
|
||||||
),
|
),
|
||||||
model.NewMenu("asset-edit", "编辑", "asset",
|
model.NewMenu("asset-edit", "编辑", "asset",
|
||||||
model.NewPermission("GET", "/assets/:id"),
|
model.NewPermission("GET", "/assets/:id"),
|
||||||
model.NewPermission("PUT", "/assets/:id"),
|
model.NewPermission("PUT", "/assets/:id"),
|
||||||
model.NewPermission("GET", "/access-gateways"),
|
model.NewPermission("GET", "/access-gateways"),
|
||||||
|
model.NewPermission("GET", "/credentials"),
|
||||||
),
|
),
|
||||||
model.NewMenu("asset-del", "删除", "asset",
|
model.NewMenu("asset-del", "删除", "asset",
|
||||||
model.NewPermission("DELETE", "/assets/:id"),
|
model.NewPermission("DELETE", "/assets/:id"),
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {Button, Layout, Result} from "antd";
|
import {Button, Layout, Result, Space} from "antd";
|
||||||
import {Link} from "react-router-dom";
|
import {Link} from "react-router-dom";
|
||||||
|
|
||||||
const {Content} = Layout;
|
const {Content} = Layout;
|
||||||
@ -12,7 +12,13 @@ const NoMatch = () => {
|
|||||||
status="404"
|
status="404"
|
||||||
title="404"
|
title="404"
|
||||||
subTitle="抱歉,您似乎到达了预期之外的页面。"
|
subTitle="抱歉,您似乎到达了预期之外的页面。"
|
||||||
extra={<Button type="primary"><Link to={'/'}>回到首页</Link></Button>}
|
extra={
|
||||||
|
<Space>
|
||||||
|
<Button type="primary" onClick={() => {navigate(-1);}}>返回上一页</Button>
|
||||||
|
<Button type="primary"><Link to={'/my-asset'}>我的资产</Link></Button>
|
||||||
|
<Button type="primary"><Link to={'/'}>后台首页</Link></Button>
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</Content>
|
</Content>
|
||||||
</div>
|
</div>
|
||||||
|
@ -17,11 +17,9 @@ const NoPermission = () => {
|
|||||||
subTitle="抱歉,您似乎没有此页面的权限。"
|
subTitle="抱歉,您似乎没有此页面的权限。"
|
||||||
extra={
|
extra={
|
||||||
<Space>
|
<Space>
|
||||||
<Button type="primary" onClick={() => {
|
<Button type="primary" onClick={() => {navigate(-1);}}>返回上一页</Button>
|
||||||
navigate(-1);
|
<Button type="primary"><Link to={'/my-asset'}>我的资产</Link></Button>
|
||||||
}
|
<Button type="primary"><Link to={'/'}>后台首页</Link></Button>
|
||||||
}>返回上一页</Button>
|
|
||||||
<Button type="primary"><Link to={'/'}>回到首页</Link></Button>
|
|
||||||
</Space>
|
</Space>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
@ -153,8 +153,8 @@ const MyAsset = () => {
|
|||||||
<a
|
<a
|
||||||
key="access"
|
key="access"
|
||||||
href={url}
|
href={url}
|
||||||
// rel="noreferrer"
|
rel="noreferrer"
|
||||||
// target='_blank'
|
target='_blank'
|
||||||
>
|
>
|
||||||
接入
|
接入
|
||||||
</a>,
|
</a>,
|
||||||
|
Loading…
Reference in New Issue
Block a user