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 1aedb758
authored
Nov 22, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
更新菜单动态代码
1 parent
907e6df3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
12 deletions
html/merchant/edit.html
html/merchant/index.html
js/request.js
html/merchant/edit.html
View file @
1aedb75
This diff is collapsed.
Click to expand it.
html/merchant/index.html
View file @
1aedb75
...
...
@@ -742,6 +742,8 @@
content
:
contentHtml
,
btn
:
[
'确定'
,
'关闭'
],
success
:
function
(
layero
,
index
){
// 在每次打开文件选择器之前重置 _uploadMerchantUrl
_uploadMerchantUrl
=
null
;
$
(
layero
).
find
(
'#selectFileBtn'
).
on
(
'click'
,
function
(){
$
(
layero
).
find
(
'#fileInput'
).
click
();
});
...
...
@@ -764,23 +766,24 @@
method
:
'glsx.accounts.biz.common.pictureUpload'
,
file
:
fileUrl
}
console
.
log
(
params
)
const
result
=
request
(
params
,
function
(
res
){
if
(
res
.
data
){
_uploadMerchantUrl
=
res
.
data
console
.
log
(
_uploadMerchantUrl
)
}
else
{
layer
.
msg
(
'上传文件失败'
);
}
},
''
,
[
'file'
],
true
)
}
}
}
else
{
// 如果没有选择文件,清空之前的 URL
// _uploadMerchantUrl = null;
}
});
},
yes
:
function
(
index
,
layero
){
var
fileInput
=
$
(
layero
).
find
(
'#fileInput'
)[
0
];
if
(
fileInput
.
files
.
length
===
0
)
{
if
(
!
fileInput
.
files
.
length
&&
!
_uploadMerchantUrl
)
{
layer
.
msg
(
'请选择文件'
);
return
;
}
...
...
@@ -790,8 +793,6 @@
// 显示loading效果
var
loadingIndex
=
layer
.
load
(
1
,
{
shade
:
0.5
});
console
.
log
(
_uploadMerchantUrl
)
var
params
=
{
method
:
'merchants.api.merchant.import'
,
url
:
_uploadMerchantUrl
...
...
@@ -809,9 +810,6 @@
layer
.
msg
(
'处理失败,可点击 下载失败模版 查看失败原因'
);
$
(
layero
).
find
(
'#loadingText'
).
hide
();
updateTemplateLink
(
res
.
data
,
'下载失败模版'
,
true
);
//var failureTemplateUrl = res.data
//$('#templateLink').attr('href', failureTemplateUrl)
//.text('下载失败模版').css('color','red');
}
}
}
...
...
@@ -829,13 +827,12 @@
}
});
});
function
updateTemplateLink
(
url
,
text
,
isError
)
{
$
(
'#templateLink'
).
attr
(
'href'
,
url
).
text
(
text
);
if
(
isError
)
{
$
(
'#templateLink'
).
css
(
'color'
,
'red'
);
}
else
{
$
(
'#templateLink'
).
css
(
'color'
,
''
);
// Reset to default color
$
(
'#templateLink'
).
css
(
'color'
,
''
);
}
}
...
...
js/request.js
View file @
1aedb75
...
...
@@ -72,7 +72,6 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
delete
settings
.
beforeSend
delete
data
.
appKey
}
console
.
log
(
isOtherUrl
)
data
.
sign
=
sign
(
data
,
common
.
secret
,
noSignAttr
,
isOtherUrl
)
settings
.
url
=
isOtherUrl
?
common
.
fileUploadURL
+
'?method='
+
params
.
method
:
common
.
baseURL
settings
.
data
=
data
...
...
@@ -132,7 +131,6 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
secretArr
.
push
(
val
+
params
[
val
])
}
var
str
=
secretArr
.
join
(
''
)
// console.log(str)
return
isMd5
?
md5
(
secret
+
str
+
secret
).
toUpperCase
()
:
SHA1
(
secret
+
str
+
secret
).
toUpperCase
()
}
...
...
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