Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
Xindu Approve Pass Applet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xindu
Xindu Approve Pass Applet
Commits
c1839b17
Commit
c1839b17
authored
6 months ago
by
mhy
Browse files
Options
Downloads
Patches
Plain Diff
fix: 优化签字功能,优化登录处理
parent
b10c169b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/app.config.ts
+1
-1
1 addition, 1 deletion
src/app.config.ts
src/pages/manage/index.tsx
+10
-8
10 additions, 8 deletions
src/pages/manage/index.tsx
src/services/core/request.ts
+41
-0
41 additions, 0 deletions
src/services/core/request.ts
with
52 additions
and
9 deletions
src/app.config.ts
+
1
−
1
View file @
c1839b17
export
default
defineAppConfig
({
pages
:
[
"
pages/index/index
"
,
"
pages/list/index
"
,
"
pages/index/index
"
,
"
pages/detail/index
"
,
"
pages/manage/index
"
,
],
...
...
This diff is collapsed.
Click to expand it.
src/pages/manage/index.tsx
+
10
−
8
View file @
c1839b17
...
...
@@ -66,10 +66,10 @@ const Manage = () => {
attachmentList
:
fileList
.
join
(
"
;
"
),
approvePass
:
"
0
"
,
operationName
:
tagName
,
approveSignPhoto
:
signUrl
,
approveSignPhoto
:
signUrl
||
defaultSign
,
nextSignature
:
keepUsing
?
'
1
'
:
'
0
'
};
if
(
actionObj
.
signFlag
===
'
1
'
&&!
signUrl
){
if
(
actionObj
.
signFlag
===
'
1
'
&&!
signUrl
&&
!
defaultSign
){
setSignOpen
(
true
)
return
}
...
...
@@ -95,7 +95,6 @@ const Manage = () => {
approveComment
:
inputStr
,
attachmentList
:
fileList
.
join
(
"
;
"
),
operationName
:
tagName
,
// approveSignPhoto:signUrl
}
as
any
;
if
(
nodeType
===
3
||
nodeType
===
5
)
{
formData
=
{
...
...
@@ -124,7 +123,7 @@ const Manage = () => {
}
const
submit
=
()
=>
{
if
(
actionObj
.
signFlag
===
'
1
'
&&!
signUrl
){
if
(
actionObj
.
signFlag
===
'
1
'
&&!
signUrl
&&
!
defaultSign
){
setSignOpen
(
true
)
return
}
...
...
@@ -132,7 +131,7 @@ const Manage = () => {
thingId
:
actionObj
.
thingId
,
reportContents
:
params
,
});
services
.
login
.
completeExamine
({...
formData
,
approveSignPhoto
:
signUrl
,
nextSignature
:
keepUsing
?
'
1
'
:
'
0
'
}).
then
((
res
:
any
)
=>
{
services
.
login
.
completeExamine
({...
formData
,
approveSignPhoto
:
signUrl
||
defaultSign
,
nextSignature
:
keepUsing
?
'
1
'
:
'
0
'
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
200
)
{
Toast
.
success
(
"
处置成功
"
);
Taro
.
reLaunch
({
...
...
@@ -206,11 +205,11 @@ const Manage = () => {
reportContents
:
params
,
});
if
(
actionObj
.
signFlag
===
'
1
'
&&!
signUrl
){
if
(
actionObj
.
signFlag
===
'
1
'
&&!
signUrl
&&
!
defaultSign
){
setSignOpen
(
true
)
return
}
services
.
login
.
completeExamine
({...
formData
,
fixUser
:
userId
,
approveSignPhoto
:
signUrl
,
nextSignature
:
keepUsing
?
'
1
'
:
'
0
'
}).
then
((
res
:
any
)
=>
{
services
.
login
.
completeExamine
({...
formData
,
fixUser
:
userId
,
approveSignPhoto
:
signUrl
||
defaultSign
,
nextSignature
:
keepUsing
?
'
1
'
:
'
0
'
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
200
)
{
setShowSelectUser
(
false
)
Toast
.
success
(
"
处置成功
"
);
...
...
@@ -415,7 +414,10 @@ const Manage = () => {
</
View
>
<
View
className
=
"ridioBox"
>
<
Radio
checked
=
{
keepUsing
}
onClick
=
{
()
=>
setKeepUsing
(
!
keepUsing
)
}
>
下次同意继续使用此签名
</
Radio
>
<
View
className
=
"clearSign"
onClick
=
{
()
=>
signRef
.
current
?.
resetDraw
()
}
>
清除签名
</
View
>
<
View
className
=
"clearSign"
onClick
=
{
()
=>
{
setSignUrl
(
''
)
signRef
.
current
?.
resetDraw
()
}
}
>
清除签名
</
View
>
</
View
>
</
View
>
<
Button
className
=
"overBtn"
onClick
=
{
async
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/services/core/request.ts
+
41
−
0
View file @
c1839b17
...
...
@@ -41,6 +41,7 @@ const HttpRequestInterceptor = () => {};
/** 响应拦截器 */
const
HttpResponseInterceptor
=
()
=>
{};
const
whiteErrList
=
[
"
用户名或密码错误
"
,
'
密码错误次数过多
'
]
/** 简单封装 */
export
default
function
request
<
T
>
(
url
:
string
,
...
...
@@ -81,7 +82,47 @@ export default function request<T>(
setTimeout
(
function
()
{
Taro
.
hideLoading
();
},
500
);
//token无效
if
([
401
,
424
].
includes
(
err
.
statusCode
as
number
))
{
const
msg
=
err
.
data
?.
msg
||
''
const
flag
=
whiteErrList
.
some
((
v
)
=>
msg
.
includes
(
v
))
if
(
flag
){
Taro
.
showModal
({
title
:
'
提示
'
,
content
:
msg
,
showCancel
:
false
})
return
}
pastDueWarn
()
}
},
});
});
}
const
pastDueWarn
=
(()
=>
{
let
num
=
0
return
()
=>
{
if
(
num
===
0
)
{
num
=
1
Taro
.
showModal
({
title
:
'
提示
'
,
content
:
'
用户身份认证过期了,请重新登录
'
,
confirmText
:
'
确认
'
,
showCancel
:
false
,
success
:
function
(
res
)
{
num
=
0
if
(
res
.
confirm
)
{
Taro
.
clearStorageSync
();
Taro
.
reLaunch
({
url
:
'
/pages/index/index
'
,
});
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'
用户点击取消
'
)
}
}
})
}
}
})()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment