Commit 7f8348a1 authored by 邓超's avatar 邓超

fix: 修改路由支持直接访问条件

parent 877d802c
Pipeline #51424 passed with stages
in 8 minutes 35 seconds
...@@ -65,7 +65,7 @@ const BasicLayout = props => { ...@@ -65,7 +65,7 @@ const BasicLayout = props => {
return ( return (
<> <>
{sessionStorage.getItem('sandbox') == 'true' ? ( {sessionStorage.getItem('_omsticket') == 'd438aaf9578f405299ae740c4eb75aae' ? (
<>{renderRoutes(props.route.routes)}</> <>{renderRoutes(props.route.routes)}</>
) : ( ) : (
<ProLayout <ProLayout
......
...@@ -93,7 +93,6 @@ const Map = props => { ...@@ -93,7 +93,6 @@ const Map = props => {
const [flag, setFlag] = useState(0); const [flag, setFlag] = useState(0);
const mapRef = useRef(); const mapRef = useRef();
const mapInfo = useRef(null); const mapInfo = useRef(null);
const test = [];
useEffect(() => { useEffect(() => {
GetWebSiteConfig({ client: 'sandbox' }).then(res => { GetWebSiteConfig({ client: 'sandbox' }).then(res => {
console.log(res.data[0].mapsettings, 'res.data[0].mapsettings'); console.log(res.data[0].mapsettings, 'res.data[0].mapsettings');
......
import RenderAuthorize from '@/components/Authorized/index.jsx'; import RenderAuthorize from '@/components/Authorized/index.jsx';
import { isDev } from './tools.ts'; import { isDev } from './tools.ts';
// const isDev = false; // const isDev = false;
...@@ -45,16 +44,16 @@ export default Authorized; ...@@ -45,16 +44,16 @@ export default Authorized;
// use localStorage to store the authority info, which might be sent from server in actual project. // use localStorage to store the authority info, which might be sent from server in actual project.
export function getAuthority(str) { export function getAuthority(str) {
const isSandBox = getQueryVariable('sandbox'); const isSandBox = getQueryVariable('sandbox');
const sandbox = sessionStorage.getItem('sandbox'); const sandbox = sessionStorage.getItem('_omsticket');
if (!isDev) { if (!isDev) {
// return [...auth]; // return [...auth];
// 支持可以指直接访问 // 支持可以指直接访问
if (isSandBox == 'true') { // if (isSandBox == 'true') {
sessionStorage.setItem('sandbox', isSandBox); // sessionStorage.setItem('_omsticket', 'd438aaf9578f405299ae740c4eb75aae');
return ['LOGIN', 'admin']; // return ['LOGIN', 'admin'];
} // }
if (sandbox == 'true') { if (sandbox == 'd438aaf9578f405299ae740c4eb75aae') {
return ['LOGIN', 'admin']; return ['LOGIN', 'admin'];
} }
return [...auth]; return [...auth];
......
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