This commit is contained in:
bb_pan 2025-06-21 18:34:05 +08:00
parent c15915a17e
commit 9b05cc53d7
3 changed files with 52 additions and 41 deletions

View File

@ -206,7 +206,8 @@ const onCameraSuccess = (file) => {
id: opts.id, id: opts.id,
leaseSignUrl: signUrl, leaseSignUrl: signUrl,
leaseSignType: signType.value, leaseSignType: signType.value,
taskType: opts.taskType || '' taskType: opts.taskType || '',
publishTask: opts.publishTask || '',
} }
console.log('🚀 ~ success: ~ params:', params) console.log('🚀 ~ success: ~ params:', params)
updateLeaseApplyInfoSign(params).then((res) => { updateLeaseApplyInfoSign(params).then((res) => {
@ -251,7 +252,8 @@ const uploadImg2 = async (base64Data) => {
id: opts.id, id: opts.id,
leaseSignUrl: signUrl, leaseSignUrl: signUrl,
leaseSignType: signType.value, leaseSignType: signType.value,
taskType: opts.taskType || '' taskType: opts.taskType || '',
publishTask: opts.publishTask || '',
} }
console.log('🚀 ~ success: ~ params:', params) console.log('🚀 ~ success: ~ params:', params)
const res = await updateLeaseApplyInfoSign(params) const res = await updateLeaseApplyInfoSign(params)

View File

@ -147,6 +147,7 @@ const onSignature = (e, item) => {
leaseSignType: item.leaseSignType, leaseSignType: item.leaseSignType,
isLease: true, isLease: true,
taskType: item.taskType, taskType: item.taskType,
publishTask: item.publishTask,
} }
uni.navigateTo({ uni.navigateTo({
url: `/pages/my/signature?params=${JSON.stringify(params)}`, url: `/pages/my/signature?params=${JSON.stringify(params)}`,

View File

@ -8,9 +8,9 @@ import { useMemberStore } from '@/stores'
const ENV = process.env.NODE_ENV const ENV = process.env.NODE_ENV
// export const baseURL = ENV === 'development' ? 'http://192.168.0.244:18580' : 'http://192.168.0.244:18580'//测试 // export const baseURL = ENV === 'development' ? 'http://192.168.0.244:18580' : 'http://192.168.0.244:18580'//测试
// export const baseURL = ENV === 'development' ? 'http://sgwpdm.ah.sgcc.com.cn/iws/jiju-api/' : 'http://sgwpdm.ah.sgcc.com.cn/iws/jiju-api/'//生产 // export const baseURL = ENV === 'development' ? 'http://sgwpdm.ah.sgcc.com.cn/iws/jiju-api/' : 'http://sgwpdm.ah.sgcc.com.cn/iws/jiju-api/'//生产
export const baseURL = ENV === 'development' ? '/api' : '/iws/jiju-api'; // 宏源服务 // export const baseURL = ENV === 'development' ? '/api' : '/iws/jiju-api'; // 宏源服务
// export const baseURL = ENV === 'development' ? 'http://192.168.0.234:18080' : '***' // export const baseURL = ENV === 'development' ? 'http://192.168.0.234:18080' : '***'
// export const baseURL = ENV === 'development' ? 'http://192.168.0.96:18080' : 'http://192.168.1.244:18080'//马 export const baseURL = ENV === 'development' ? 'http://192.168.1.117:18080' : 'http://192.168.1.117:18080'//马
// export const baseURL = ENV === 'development' ? '/api' : '***' // export const baseURL = ENV === 'development' ? '/api' : '***'
// **********OCR识别为NVUE文件页面请求URL需要同步配置********** // **********OCR识别为NVUE文件页面请求URL需要同步配置**********
@ -58,57 +58,65 @@ export const http = (options) => {
uni.request({ uni.request({
...options, ...options,
success(res) { success(res) {
// console.log('res', res) try {
// 1. 判断是否请求成功 // 1. 判断是否请求成功
if (res.statusCode >= 200 && res.statusCode < 300) { if (res.statusCode >= 200 && res.statusCode < 300) {
if (res.data.code >= 200 && res.data.code < 300) { if (res.data && res.data.code >= 200 && res.data.code < 300) {
resolve(res.data) resolve(res.data)
} else if (res.data.code === 401) { } else if (res.data && res.data.code === 401) {
// 2. 401 表示token过期 去往登录页重新登录
uni.showToast({
icon: 'none',
title: `${res.data.msg}`,
})
const memberStore = useMemberStore()
memberStore.clearUserInfo()
memberStore.clearToken()
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
if (!currentPage.route.includes('login')) {
uni.reLaunch({
url: '/pages/login/index',
})
}
reject(res)
} else if (res.data && res.data.code === 500) {
uni.showToast({
icon: 'none',
title: `${res.data.msg}`,
})
reject(res)
} else {
uni.showToast({
icon: 'none',
title: `${res.data && res.data.msg ? res.data.msg : '请求失败'}`,
})
reject(res)
}
} else if (res.statusCode === 401) {
// 2. 401 表示token过期 去往登录页重新登录 // 2. 401 表示token过期 去往登录页重新登录
uni.showToast({
icon: 'none',
title: `${res.data.msg}`,
})
const memberStore = useMemberStore() const memberStore = useMemberStore()
memberStore.clearUserInfo() memberStore.clearUserInfo()
memberStore.clearToken() memberStore.clearToken()
const pages = getCurrentPages() uni.navigateTo({
const currentPage = pages[pages.length - 1] url: '/pages/login/index',
if (!currentPage.route.includes('login')) { })
uni.reLaunch({
url: '/pages/login/index',
})
}
reject(res) reject(res)
} else if (res.data.code === 500) {
uni.showToast({
icon: 'none',
title: `${res.data.msg}`,
})
} else { } else {
// 3. 其他错误
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: `${res.data.msg}` || '请求失败', title: '请求错误',
}) })
reject(res)
} }
} else if (res.statusCode === 401) { } catch (err) {
// 2. 401 表示token过期 去往登录页重新登录
const memberStore = useMemberStore()
memberStore.clearUserInfo()
memberStore.clearToken()
uni.navigateTo({
url: '/pages/login/index',
})
reject(res)
} else {
// 3. 其他错误
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '请求错误', title: '请求失败',
}) })
reject(res) reject(err)
} }
// console.log(res)
}, },
fail(err) { fail(err) {
uni.showToast({ uni.showToast({