Commit b7dc3329 authored by suhuiguang's avatar suhuiguang

1.全景监控按钮增加权限控制

parent 876891a9
......@@ -44,6 +44,8 @@ export const secExtUrl = {
permissionsMenusUrl: completePrefix(securityBaseURI, `privilege/${secExVerson}/permission/tree/role?roleSeq={roleSeq}`),
loginOutUrl: completePrefix(baseURI,'privilege/v1/auth/token'), // 注销 delete
// 获取指定菜单下授权的按钮权限 get
buttonAuthUrl: completePrefix(securityBaseURI, `privilege/${secExVerson}/permission/map/user/button?menuAgent={menuAgent}&path={path}&roleSeq={roleSeq}`)
//avoidLoginUrl: completePrefix(baseURI,'api/login/avoid/{loginId}/{accessToken}/{expireTime}?appType={appType}')
};
......
......@@ -4,7 +4,7 @@ import {
} from 'amos-security/lib/services';
import formatUrl from 'amos-processor/lib/utils/urlFormat';
import { Store } from 'amos-tool';
import { Store, encodeUrl } from 'amos-tool';
import { secExtUrl } from './../consts/urlConsts';
import { commonGet, commonPost, commonDelete } from './../utils/request';
import { FasSerUrl, getOutterURL } from './../consts/urlConsts';
......@@ -130,3 +130,14 @@ export const userModelURIAction = () => {
let url = formatUrl(getOutterURL('userModelURI'), { token });
return url;
};
/**
* 获取登陆者的全景监控安全权限
* @param {String} path
*/
export const buttonAuthAction = (path) => {
const roleSeq = lsTool.read('selectedRole');
const menuAgent = 'WEB';
const url = formatUrl(secExtUrl.buttonAuthUrl, { path: encodeUrl(path), roleSeq, menuAgent });
return commonGet(url);
};
......@@ -3,9 +3,10 @@ import getSketchCompnents from './sketch';
export default class Convertor3d extends Component {
render() {
const { ...rest } = this.props;
const Sketch = getSketchCompnents('convertorView3DRoot') ;
return (
<Sketch />
<Sketch {...rest} />
);
}
}
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import * as endConf from 'amos-processor/lib/config/endconf';
import Convertor3d from '../3dview/convertor3d';
import Ue4RootView from './../ue4';
import { buttonAuthAction } from './../../services/securityService';
const AmosConfig = endConf.AmosConfig;
const { is3dUe4 = false } = AmosConfig.sysConf;
......@@ -9,10 +11,37 @@ const { is3dUe4 = false } = AmosConfig.sysConf;
/**
* 全景监控
*/
export default class PanoramicMonitor extends Component {
class PanoramicMonitor extends Component {
constructor(props){
super(props);
this.state = {
isPermissionControl: true,
bizPerActionBars: []
};
}
componentDidMount(){
const { pathname } = this.props.location;
this.getPermissionButton(pathname);
}
getPermissionButton = (pathname)=>{
buttonAuthAction(pathname).then(data =>{
this.setState({ bizPerActionBars: data });
});
}
render() {
const { isPermissionControl, bizPerActionBars } = this.state;
return (
is3dUe4 ? <Ue4RootView /> : <Convertor3d />
is3dUe4 ? <Ue4RootView /> : <Convertor3d isPermissionControl={isPermissionControl} bizPerActionBars={bizPerActionBars} />
);
}
}
PanoramicMonitor.propTypes = {
location: PropTypes.object
};
export default PanoramicMonitor;
......@@ -102,11 +102,13 @@ import PropTypes from 'prop-types';
import { browserHistory } from 'amos-react-router';
import { Select, Form, Button } from 'amos-framework';
import { Store } from 'amos-tool';
import { getCurrentUser, regionSelectAction} from './../../services/securityService';
import * as endConf from 'amos-processor/lib/config/endconf';
import _amosTool from 'amos-tool';
import SysConsts from 'amos-processor/lib/config/consts';
import { setRegion } from 'UTILS/cacheUtils';
import { getCurrentUser, regionSelectAction } from './../../services/securityService';
const lsTool = Store.lsTool;
const ls = _amosTool.Store.lsTool;
const AmosConfig = endConf.AmosConfig;
......@@ -148,8 +150,8 @@ class RegionSelect extends Component {
browserHistory.push('/main/3dview');
//2.通过配置,确定是否打开业务屏
if (isAutoOpen){
let url='?token='+ls.read(token);
window.open('/biz/assessment/'+url);
const url = `?token=+${ls.read(token)}`;
window.open('/biz/assessment/' + url);
}
}
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment