Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
account
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1e6b1f79
authored
Nov 30, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
解决导入文件名一致不发送请求问题
1 parent
91c1466a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
html/merchant/index.html
html/merchant/index.html
View file @
1e6b1f7
...
@@ -745,7 +745,9 @@
...
@@ -745,7 +745,9 @@
// 在每次打开文件选择器之前重置 _uploadMerchantUrl
// 在每次打开文件选择器之前重置 _uploadMerchantUrl
_uploadMerchantUrl
=
null
;
_uploadMerchantUrl
=
null
;
$
(
layero
).
find
(
'#selectFileBtn'
).
on
(
'click'
,
function
(){
$
(
layero
).
find
(
'#selectFileBtn'
).
on
(
'click'
,
function
(){
$
(
layero
).
find
(
'#fileInput'
).
click
();
var
fileInput
=
$
(
layero
).
find
(
'#fileInput'
);
fileInput
.
val
(
''
);
// 重置文件输入元素
fileInput
.
click
();
});
});
$
(
layero
).
find
(
'#fileInput'
).
on
(
'change'
,
function
(){
$
(
layero
).
find
(
'#fileInput'
).
on
(
'change'
,
function
(){
...
@@ -761,23 +763,23 @@
...
@@ -761,23 +763,23 @@
reader
.
onload
=
(
event
)
=>
{
reader
.
onload
=
(
event
)
=>
{
const
base64
=
event
.
target
.
result
.
split
(
','
)[
1
];
const
base64
=
event
.
target
.
result
.
split
(
','
)[
1
];
const
fileType
=
file
.
name
.
split
(
'.'
).
pop
();
const
fileType
=
file
.
name
.
split
(
'.'
).
pop
();
const
fileUrl
=
fileType
+
'@'
+
base64
const
fileUrl
=
fileType
+
'@'
+
base64
;
const
params
=
{
const
params
=
{
method
:
'glsx.accounts.biz.common.pictureUpload'
,
method
:
'glsx.accounts.biz.common.pictureUpload'
,
file
:
fileUrl
file
:
fileUrl
}
};
const
result
=
request
(
params
,
function
(
res
){
request
(
params
,
function
(
res
){
if
(
res
.
data
){
if
(
res
.
data
){
_uploadMerchantUrl
=
res
.
data
_uploadMerchantUrl
=
res
.
data
;
}
else
{
}
else
{
layer
.
msg
(
'上传文件失败'
);
layer
.
msg
(
'上传文件失败'
);
}
}
},
''
,
[
'file'
],
true
)
},
''
,
[
'file'
],
true
);
}
}
}
}
}
else
{
}
else
{
//
如果没有选择文件,清空
之前的 URL
//
用户打开了文件选择器但没有选择文件(点击了取消),保留
之前的 URL
// _uploadMerchantUrl = null;
// 不需要执行任何操作
}
}
});
});
},
},
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment