Commit 01166bec authored by 涂伟's avatar 涂伟

fix: '集成登录图片上传逻辑优化'

parent 6c87c4d6
...@@ -71,6 +71,7 @@ const AddModal = props => { ...@@ -71,6 +71,7 @@ const AddModal = props => {
const [pick, setPick] = useState(''); // 复选框数据填入项 const [pick, setPick] = useState(''); // 复选框数据填入项
const [keepIds, setKeepIds] = useState(null); const [keepIds, setKeepIds] = useState(null);
const [account, setAccount] = useState(0); const [account, setAccount] = useState(0);
const [isFromLocal, setIsFromLocal] = useState(false);
const key = CryptoJS.enc.Utf8.parse('1p2a3n4d5a6o7m8s9a10n1e2t3c4o5re'); // 十六位十六进制数作为密钥 const key = CryptoJS.enc.Utf8.parse('1p2a3n4d5a6o7m8s9a10n1e2t3c4o5re'); // 十六位十六进制数作为密钥
const iv = CryptoJS.enc.Utf8.parse('1234567890000000'); const iv = CryptoJS.enc.Utf8.parse('1234567890000000');
...@@ -385,10 +386,12 @@ const AddModal = props => { ...@@ -385,10 +386,12 @@ const AddModal = props => {
message.error('请选择图标!'); message.error('请选择图标!');
return; return;
} }
if (obj.iconUrl.includes('CityTemp') && obj.iconUrl.includes('图库')) { if (!isFromLocal) {
obj.iconUrl = obj.iconUrl; if (obj.iconUrl.includes('CityTemp') && obj.iconUrl.includes('图库')) {
} else { obj.iconUrl = obj.iconUrl;
obj.iconUrl = 'CityTemp\\图库\\' + obj.iconUrl; } else {
obj.iconUrl = 'CityTemp\\图库\\' + obj.iconUrl;
}
} }
if (type === 'add') { if (type === 'add') {
AddIntegratedLogin({ AddIntegratedLogin({
...@@ -540,6 +543,7 @@ const AddModal = props => { ...@@ -540,6 +543,7 @@ const AddModal = props => {
// }; // };
// }); // });
if (info.file.response.code === 0) { if (info.file.response.code === 0) {
setIsFromLocal(false)
console.log('触发咯'); console.log('触发咯');
if ( if (
info.file.response.data.includes('CityTemp') && info.file.response.data.includes('CityTemp') &&
...@@ -612,6 +616,7 @@ const AddModal = props => { ...@@ -612,6 +616,7 @@ const AddModal = props => {
// setImageUrl(window.location.origin + `/${props.path}`); // setImageUrl(window.location.origin + `/${props.path}`);
// setIm(props.path); // setIm(props.path);
// setKeepImgeUrl(props.path); // setKeepImgeUrl(props.path);
setIsFromLocal(true);
form.setFieldsValue({ iconUrl: `${props.path}` }); form.setFieldsValue({ iconUrl: `${props.path}` });
} }
}; };
......
...@@ -21,7 +21,6 @@ const PreviewModal = props => { ...@@ -21,7 +21,6 @@ const PreviewModal = props => {
useEffect(() => { useEffect(() => {
console.log(imageUrl); console.log(imageUrl);
console.log(keepImgeUrl); console.log(keepImgeUrl);
debugger
console.log(type); console.log(type);
console.log(process.env, 'process.env.PROXY'); console.log(process.env, 'process.env.PROXY');
setPickItem(''); setPickItem('');
......
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