Commit 77e129ab authored by 前端-许佳敏's avatar 前端-许佳敏

chore: 修改平台后台全局配置引入

parent 2d424e9f
......@@ -59,7 +59,7 @@ const serviceConfig = {
method: 'get'
}
},
site: {
global: {
siteInfo: {
url: '/manage/paas/site/details',
params: {
......
......@@ -14,7 +14,7 @@ export const REQUEST_HEADER = 'http://'
/**
* 顶域
*/
export const TOP_DOMAIN = process.env.NODE_ENV !== 'development' ? getTopDomainByHost(GlobalConfig.site.siteInfo.siteUrl, true) : 'lingxidev.com'
export const TOP_DOMAIN = process.env.NODE_ENV !== 'development' ? getTopDomainByHost(GlobalConfig.global.siteInfo.siteUrl, true) : 'lingxidev.com'
// export const TOP_DOMAIN = getTopDomainByHost(GlobalConfig.global.siteInfo.siteUrl)
/**
......
......@@ -17,11 +17,11 @@ const logoEle: React.FC<{}> = () => {
<p>
{
showSmall ?
<img src={GlobalConfig.site.siteInfo.logo} alt="瓴犀"/>
<img src={GlobalConfig.global.siteInfo.logo} alt="瓴犀"/>
:
<>
<img src={GlobalConfig.site.siteInfo.logo} alt="瓴犀"/>
<span>{GlobalConfig.site.siteInfo.name}</span>
<img src={GlobalConfig.global.siteInfo.logo} alt="瓴犀"/>
<span>{GlobalConfig.global.siteInfo.name}</span>
</>
}
</p>
......
......@@ -131,7 +131,7 @@ const Add = () => {
FormPath.setIn(state, 'props.x-component-props', {environment: initialValue.environment});
});
async function setMall() {
const data = await fetchMallData({environment: initialValue.environment.toString(), siteId: GlobalConfig.site.siteInfo.id} as any);
const data = await fetchMallData({environment: initialValue.environment.toString(), siteId: GlobalConfig.global.siteInfo.id} as any);
actions.setFieldState("shopId", state => {
state.props.enum = data;
});
......@@ -200,7 +200,7 @@ const Add = () => {
FormPath.setIn(state, 'props.x-props.hasFeedback', true);
});
linkage.loading('shopId');
fetchMallData({environment: value.toString(), siteId: GlobalConfig.site.siteInfo.id} as any)
fetchMallData({environment: value.toString(), siteId: GlobalConfig.global.siteInfo.id} as any)
.then((data) => {
formAction.setFieldValue("shopId", "");
formAction.setFieldValue('template', {});
......
......@@ -32,7 +32,7 @@ const ShopLayout: React.FC<shopListProps> = (props: any) => {
const [mallList, setMallList] = useState<ShopItem[]>([]);
useEffect(() => {
postManageWebShopWebAll({siteId: GlobalConfig.site.siteInfo.id, type: 1}, { ctlType: 'none' }).then(res => {
postManageWebShopWebAll({siteId: GlobalConfig.global.siteInfo.id, type: 1}, { ctlType: 'none' }).then(res => {
if (res.code !== 1000) {
return
}
......
......@@ -101,7 +101,7 @@ export const createEffects = (context, actions) => {
// 初始化 适用商城数据
onFieldMount$('suitableMallTypes').subscribe(() => {
postManageWebShopWebAll({
siteId: GlobalConfig.site.siteInfo.id,
siteId: GlobalConfig.global.siteInfo.id,
type: 1, // 企业商城
}, {
ctlType: 'none',
......
import { GlobalConfig } from '@/global/config';
import { INFO_CENTER_URL } from '@/constants'
const siteUrl = GlobalConfig.site.siteInfo.siteUrl;
const siteUrl = GlobalConfig.global.siteInfo.siteUrl;
/**
* 请求头
......
......@@ -280,7 +280,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
// 获取平台首页装修信息
if (!isEmpty(designConfig)) {
// 站点信息
const siteInfo = GlobalConfig.site.siteInfo;
const siteInfo = GlobalConfig.global.siteInfo;
// 平台首页显示站点logo
// headerConfig[headerConfig.key].props.logoUrl = siteInfo.logo
......
import { GlobalConfig } from '@/global/config';
import { SRM_CENTER_URL, LOGISTICS_CENTER_URL, MANUFACTURE_CENTER_URL, INFO_CENTER_URL } from "@/constants"
const siteUrl = GlobalConfig.site.siteInfo.siteUrl;
const siteUrl = GlobalConfig.global.siteInfo.siteUrl;
/**
* 请求头
......
import { GlobalConfig } from '@/global/config';
const siteUrl = GlobalConfig.site.siteInfo.siteUrl;
const siteUrl = GlobalConfig.global.siteInfo.siteUrl;
/**
* 请求头
......
......@@ -277,7 +277,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
// 获取平台首页装修信息
if (!isEmpty(designConfig)) {
// 站点信息
const siteInfo = GlobalConfig.site.siteInfo;
const siteInfo = GlobalConfig.global.siteInfo;
// 平台首页显示站点logo
// headerConfig[headerConfig.key].props.logoUrl = siteInfo.logo
......
......@@ -19,14 +19,14 @@ export const getTopDomainByHost = (url: string, isPort = false): string => {
* 获取顶域
*/
export const getTopDomain = (env: string = 'production', defaultTopDomain: string = 'lingxidev.com', isPort: boolean = false) => {
return env !== 'development' ? getTopDomainByHost(GlobalConfig.site.siteInfo.siteUrl, isPort) : defaultTopDomain
return env !== 'development' ? getTopDomainByHost(GlobalConfig.global.siteInfo.siteUrl, isPort) : defaultTopDomain
}
/**
* 获取平台首页子域名
*/
const getPlatformSubDomain = (defaultSubDomian: string) => {
const siteUrl = GlobalConfig.site.siteInfo.siteUrl
const siteUrl = GlobalConfig.global.siteInfo.siteUrl
return siteUrl.split('.')[0] || defaultSubDomian
}
......
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