Commit a1f272a9 authored by 涂伟's avatar 涂伟

fix: '集成登录网站配置图片上传逻辑优化'

parent 3614667c
Pipeline #74166 passed with stages
...@@ -62,6 +62,7 @@ const Master = props => { ...@@ -62,6 +62,7 @@ const Master = props => {
const [radio, setRadio] = useState(); const [radio, setRadio] = useState();
const [flag, setFlag] = useState(0); const [flag, setFlag] = useState(0);
const [keepSettings, setKeepSettings] = useState([]); const [keepSettings, setKeepSettings] = useState([]);
const [isFromLocal, setIsFromLocal] = useState(false);
useEffect(() => { useEffect(() => {
if (visible) { if (visible) {
...@@ -164,6 +165,13 @@ const Master = props => { ...@@ -164,6 +165,13 @@ const Master = props => {
message.error('请选择登录Logo!'); message.error('请选择登录Logo!');
return; return;
} }
if (!isFromLocal) {
if (obj.logo.includes('CityTemp') && obj.logo.includes('图库')) {
obj.logo = obj.logo;
} else {
obj.logo = 'CityTemp\\图库\\' + obj.logo;
}
}
AddIntegratedloginSetting({ AddIntegratedloginSetting({
logo: obj.logo, logo: obj.logo,
primaryColor: obj.primaryColor, primaryColor: obj.primaryColor,
...@@ -235,6 +243,7 @@ const Master = props => { ...@@ -235,6 +243,7 @@ const Master = props => {
} }
if (info.file.response.code === 0) { if (info.file.response.code === 0) {
setIsFromLocal(false);
setImageUrl(getImg(info.file.response.data)); setImageUrl(getImg(info.file.response.data));
setLoading(false); setLoading(false);
} else { } else {
...@@ -286,6 +295,7 @@ const Master = props => { ...@@ -286,6 +295,7 @@ const Master = props => {
setIm(props.path); setIm(props.path);
setKeepImgeUrl(props.path); setKeepImgeUrl(props.path);
form.setFieldsValue({ logo: `${props.path}` }); form.setFieldsValue({ logo: `${props.path}` });
setIsFromLocal(true);
} }
}; };
......
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