Commit 16e1ffef authored by Maofei94's avatar Maofei94

perf: fix style

parent ea0ef603
Pipeline #21524 passed with stages
in 18 minutes 49 seconds
import { getImageBases } from '@/services/common/api';
import { getImageBases, getSysConfigurate } from '@/services/common/api';
import React, { useEffect, useState } from 'react';
const UploadContext = React.createContext();
......@@ -14,10 +14,12 @@ const PictureWallProvider = props => {
const [imgBed, setImgBed] = useState([]);
const update = () =>
getImageBases('')
getImageBases('icon,androidMenu,menuNew,logo')
.then(res => {
if (res.code === 0) {
setImgBed(res.data);
const { data } = res;
let arr = data.filter(item => item.moduleName !== 'menu') || [];
setImgBed(arr);
}
})
.catch(err => {
......@@ -26,10 +28,29 @@ const PictureWallProvider = props => {
return sleep(3000).then(update);
});
const updateDicName = () => {
getSysConfigurate().then(res => {
if (res.getMe && (res.getMe[0] === 1 || res.getMe[0] === '1')) {
window.DicNameSERVICE = {
CITY_SERVICE: '/Publish/GateWay/OMS',
PUBLISH_SERVICE: '/Publish/GateWay/CityServer',
};
} else {
window.DicNameSERVICE = {
CITY_SERVICE: '/Cityinterface/rest/services',
PUBLISH_SERVICE: '/Publish/OMS',
};
}
});
};
useEffect(() => {
update();
}, []);
useEffect(() => {
updateDicName();
}, []);
return (
<UploadContext.Provider value={{ imgBed, update }}>
{children}
......
import React, { useState } from 'react';
import { Card, List } from 'antd';
const ProductConfig = props => {
const a = 'q';
return (
<div>
<Card>
<List>a</List>
<List>a</List>
<List>a</List>
<List>a</List>
<List>a</List>
</Card>
</div>
);
};
export default ProductConfig;
......@@ -2,3 +2,8 @@ import { post, postForm, get, PUBLISH_SERVICE } from '../index';
export const getImageBases = moduleName =>
get(`${PUBLISH_SERVICE}/FileCenter/GetFileUrls`, { moduleName });
export const getSysConfigurate = params =>
get(
`/CityInterface/rest/services/Common.svc/Tool/GetSysConfigurate?dicName=网关启停`,
);
import { request } from '../utils/request';
// export const CITY_SERVICE = '/Cityinterface/rest/services';
export const PUBLISH_SERVICE = '/Publish/GateWay/OMS';
export const CITY_SERVICE = '/Publish/GateWay/CityServer';
export const CITY_SERVICE = '/Cityinterface/rest/services';
export const PUBLISH_SERVICE = '/Publish/OMS';
// export const PUBLISH_SERVICE = '/Publish/GateWay/OMS';
// export const CITY_SERVICE = '/Publish/GateWay/CityServer';
const get = async (url, params, options = {}) =>
request({
......
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