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

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

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