Commit 2cad8ecc authored by 前端-许佳敏's avatar 前端-许佳敏

更新全局配置获取方式

parent 596dcd9c
{
"global": {
"logo": "",
"countryList": [
{
"name": "简体中文-ZH",
"key": "cn",
"icon": ""
},
{
"name": "English-EN",
"key": "en",
"icon": ""
},
{
"name": "日本語-JP",
"key": "jp",
"icon": ""
},
{
"name": "한국어-KO",
"key": "ko",
"icon": ""
}
]
}
}
\ No newline at end of file
{"global":{"logo":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png","countryList":[{"name":"简体中文-ZH","key":"cn","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"},{"name":"English-EN","key":"en","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"},{"name":"日本語-JP","key":"jp","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"},{"name":"한국어-KO","key":"ko","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"}]}}
......@@ -3,27 +3,27 @@ const mockData = {
code: 1000,
data: {
global: {
logo: '',
logo: 'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png',
countryList: [
{
name: '简体中文-ZH',
key: 'cn',
icon: ''
icon: 'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png'
},
{
name: 'English-EN',
key: 'en',
icon: ''
icon: 'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png'
},
{
name: '日本語-JP',
key: 'jp',
icon: ''
icon: 'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png'
},
{
name: '한국어-KO',
key: 'ko',
icon: ''
icon: 'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png'
}
]
}
......
......@@ -3,6 +3,7 @@ import styles from './styles/UserLayouts.less'
import UserHeader from './components/UserHeader';
import BaseFooter from './components/BaseFooter';
import { Row } from 'antd';
import { GlobalConfig } from '@/global/config';
/**
* 登录、注册等用户界面布局
......@@ -11,7 +12,7 @@ import { Row } from 'antd';
const UserLayouts:React.FC = (props) => {
return (
<div className={styles.lingxiBusinessUserLayout}>
<UserHeader/>
<UserHeader logo={GlobalConfig.global.logo}/>
<div className={styles.lingxiBusinessUserBg}>
{ props.children }
<BaseFooter/>
......
......@@ -6,34 +6,14 @@ import japenImg from '../../../mockStatic/japen.png'
import korenImg from '../../../mockStatic/koren.png'
import us from '../../../mockStatic/us.png'
import { CaretDownOutlined } from '@ant-design/icons'
import { GlobalConfig } from '@/global/config'
interface countryItem {
name: string,
key: string,
icon: string
}
const countryList: countryItem[] = [
{
name: '简体中文-ZH',
key: 'cn',
icon: ChinaImg
},
{
name: 'English-EN',
key: 'en',
icon: us
},
{
name: '日本語-JP',
key: 'jp',
icon: japenImg
},
{
name: '한국어-KO',
key: 'ko',
icon: korenImg
}
]
const HeaderDropdown: React.FC = () => {
// 此处暂时无接口, 对接接口后需用枚举类型做补充
const [select, setSelect] = useState<countryItem>({
......@@ -45,7 +25,7 @@ const HeaderDropdown: React.FC = () => {
const menuHeaderDropdown = (
<Menu selectedKeys={[]}>
{
countryList.map(v => <Menu.Item key={v.key} onClick={() => setSelect(v)}>
GlobalConfig.global.countryList.map(v => <Menu.Item key={v.key} onClick={() => setSelect(v)}>
<Space>
{select.key === v.key ? <img src={gou} style={{width: 20, height: 20}}/> : <div style={{width: 20, height: 20}}></div> }
<img src={v.icon} style={{width: 24, height: 17}}/>
......
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