部署bug修复

This commit is contained in:
bb_pan 2025-02-14 18:01:24 +08:00
parent 31b55c8150
commit b63d996716
9 changed files with 52 additions and 14 deletions

View File

@ -240,7 +240,10 @@ const resetPhone = async () => {
}
onMounted(() => {
getUserListData()
// token
if (store.token) {
getUserListData()
}
circleUrl.value = store.userInfo.avatar
})
</script>

View File

@ -45,6 +45,7 @@ service.interceptors.request.use(
if (config.data) {
let data = typeof config.data === 'object' ? JSON.stringify(config.data) : config.data
config.data = encryptWithSM4(data + '|' + hashWithSM3AndSalt(data))
// config.data = data
}
return config
},
@ -67,6 +68,8 @@ service.interceptors.response.use(
return data
} else if (data.code == '403') {
ElMessage.error('请重新登录')
// 清除token
localStorage.removeItem('tokenNew')
// 根据环境变量 VITE_API_URL 判断是否是本地开发环境
if (import.meta.env.VITE_API_URL == '/proxyApi') {
router.push('/login')
@ -79,6 +82,7 @@ service.interceptors.response.use(
}
} else if (data.code == '401') {
ElMessage.error('请重新登录')
localStorage.removeItem('tokenNew')
if (import.meta.env.VITE_API_URL == '/proxyApi') {
router.push('/login')
} else {

View File

@ -139,7 +139,9 @@ const getHotSearchListData = async () => {
console.log(res, '热词')
}
getHotSearchListData()
if (tokenNew) {
getHotSearchListData()
}
//
const searchKeywordBtn = () => {

View File

@ -723,7 +723,12 @@ const handleViewWord = async (index: any) => {
console.log('查询参数', queryParams)
const res: any = await getBookCarAgreementApi(queryParams)
wordUrl.value = res.data.url
if (import.meta.env.VITE_API_URL == '/proxyApi') {
wordUrl.value = res.data.url
} else {
wordUrl.value = 'http://sgwpdm.ah.sgcc.com.cn/iws/ahbns/' + res.data.url
}
console.log('🚀 ~ handleViewWord ~ wordUrl.value:', wordUrl.value)
dialogFormVisibleSettleWord.value = true
settleWordTitle.value = '租赁服务合同'

View File

@ -22,6 +22,7 @@ const { getCompanyList, getGoodsClassList } = userClass()
const router: any = useRouter()
const userStore = useStore()
const store: any = mainStore()
const tokenNew = localStorage.getItem('tokenNew')
// const leftNavList: any = ref([])
const companyList: any = ref([])
@ -57,6 +58,7 @@ const getCompanyListData = async () => {
// console.log('res', res)
}
// console.log('🚀 ~ tokenNew:', tokenNew)
getCompanyListData()
//
@ -166,7 +168,7 @@ const onClickSwiper = (item: any) => {
getSwiperListData()
onMounted(async () => {
if (!store.token) {
if (!tokenNew) {
const origin = window.location.href
console.log(origin.split('ticket=')[1], 'origin')

View File

@ -555,7 +555,11 @@ const handleViewWord = async (index: any) => {
console.log('查询参数', queryParams)
const res: any = await getBookCarAgreementApi(queryParams)
wordUrl.value = res.data.url
if (import.meta.env.VITE_API_URL == '/proxyApi') {
wordUrl.value = res.data.url
} else {
wordUrl.value = 'http://sgwpdm.ah.sgcc.com.cn/iws/ahbns/' + res.data.url
}
dialogFormVisibleSettleWord.value = true
settleWordTitle.value = '租赁服务合同'

View File

@ -539,12 +539,12 @@ const onFileChange = (fileList: any) => {
testUrl = e.url // -
} else {
console.log('走入宏源测试环境----------', )
testUrl = origin + '/ahbns/' + e.url // -
testUrl = 'http://sgwpdm.ah.sgcc.com.cn/iws/ahbns/' + e.url // -
console.log('输出testUrl----------', testUrl)
}
return {
fileName: e.name,
fileUrl: isProd ? 'http://sgwpdm.ah.sgcc.com.cn/iws/ahbns/' + e.url : testUrl,
fileUrl: testUrl,
}
})
console.log('22222222查看file路径', fileListTemp)

View File

@ -70,7 +70,9 @@ const statusList: any = [
]
const orderText = (status: any) => {
return statusList.filter((e: any) => e.id == status)[0].name
// return statusList.filter((e: any) => e.id == status)[0].name
const statusItem = statusList.find((e: any) => e.id == status)
return statusItem ? statusItem.name : ''
}
const orderType = (status: any) => {
if (status == 1 || status == 2 || status == 3 || status == 5) return 'primary'
@ -347,7 +349,12 @@ const handleViewWord = async (index: Number, row: any) => {
const res: any = await getContractDetailApi({ orderId })
// cardList.value = res.rows
//
wordUrl.value = res.data.url
if (import.meta.env.VITE_API_URL == '/proxyApi') {
wordUrl.value = res.data.url
} else {
wordUrl.value = 'http://sgwpdm.ah.sgcc.com.cn/iws/ahbns/' + res.data.url
}
console.log('🚀 ~ handleViewWord ~ wordUrl.value:', wordUrl.value)
dialogFormVisibleSettleWord.value = true
dialogFormVisibleSettleWord.value = true
setTimeout(() => {
@ -367,7 +374,13 @@ const handleViewWord = async (index: Number, row: any) => {
// Word
const downloadContract = () => {
window.location.href = wordUrl.value
console.log('🚀 ~ downloadContract ~ wordUrl.value:', wordUrl.value)
window.open(wordUrl.value)
// if (import.meta.env.VITE_API_URL == '/proxyApi') {
// window.open(wordUrl.value)
// } else {
// window.open('http://sgwpdm.ah.sgcc.com.cn/iws/ahbns/' + wordUrl.value)
// }
}
const confirmFail = async (index: number) => {

View File

@ -669,7 +669,11 @@ const handleViewWord = async (index: Number, row: any) => {
const res: any = await getContractDetailApi({ orderId })
// cardList.value = res.rows
//
wordUrl.value = res.data.url
if (import.meta.env.VITE_API_URL == '/proxyApi') {
wordUrl.value = res.data.url
} else {
wordUrl.value = 'http://sgwpdm.ah.sgcc.com.cn/iws/ahbns/' + res.data.url
}
dialogFormVisibleSettleWord.value = true
setTimeout(() => {
const myDocxPreviewer = jsPreviewDocx.init(document.getElementById('mmm'))
@ -694,7 +698,8 @@ const contract = ref({
// Word
const downloadContract = () => {
window.location.href = wordUrl.value
console.log('🚀 ~ downloadContract ~ wordUrl.value:', wordUrl.value)
window.open(wordUrl.value)
}
const wordUrl = ref('')