Skip to content
Snippets Groups Projects
Commit c1839b17 authored by mhy's avatar mhy
Browse files

fix: 优化签字功能,优化登录处理

parent b10c169b
Branches
No related tags found
No related merge requests found
export default defineAppConfig({
pages: [
"pages/index/index",
"pages/list/index",
"pages/index/index",
"pages/detail/index",
"pages/manage/index",
],
......
......@@ -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()=>{
......
......@@ -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('用户点击取消')
}
}
})
}
}
})()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment