feat:样品分析

This commit is contained in:
houjunxiang
2025-10-14 18:16:51 +08:00
parent b5aed8573a
commit 5916b8c833
14 changed files with 574 additions and 671 deletions

View File

@@ -87,32 +87,43 @@ http.interceptors.request.use(
const token = getAccessToken()
if (token) config.header['Authorization'] = token
if (token) config.header['Authorization'] = 'Bearer ' + token
config.header['Accept'] = '*/*'
config.header['tenant-id'] = getTenantId()
const method = config.method?.toUpperCase()
// 防止 GET 请求缓存
if (method === 'GET') {
config.header['Cache-Control'] = 'no-cache'
config.header['Pragma'] = 'no-cache'
}
let params = config.params || {}
let data = config.data || false
if (process.env.NODE_ENV == 'development') console.log('development--params', params)
if (process.env.NODE_ENV == 'development') console.log('development--data', data)
// if (process.env.NODE_ENV == 'development') console.log('development--params', params)
// if (process.env.NODE_ENV == 'development') console.log('development--data', data)
const visitCompanyId = getVisitCompanyId()
// const visitCompanyId = getVisitCompanyId()
const visitCompanyId = '101'
if (visitCompanyId !== undefined && visitCompanyId !== null && visitCompanyId !== '') {
config.header['visit-company-id'] = visitCompanyId
const visitCompanyName = getVisitCompanyName()
// const visitCompanyName = getVisitCompanyName()
const visitCompanyName = '"深圳总公司'
if (visitCompanyName !== undefined && visitCompanyName !== null) {
config.header['visit-company-name'] = encodeURIComponent(visitCompanyName || '')
}
}
const visitDeptId = getVisitDeptId()
// const visitDeptId = getVisitDeptId()
const visitDeptId = '103'
if (visitDeptId !== undefined && visitDeptId !== null && visitDeptId !== '') {
config.header['visit-dept-id'] = visitDeptId
const visitDeptName = getVisitDeptName()
// const visitDeptName = getVisitDeptName()
const visitDeptName = '研发部门'
if (visitDeptName !== undefined && visitDeptName !== null) {
config.header['visit-dept-name'] = encodeURIComponent(visitDeptName || '')
}
}
config.header['__companyDeptRetried'] = '1'
return config
},
error => {
@@ -133,7 +144,6 @@ http.interceptors.response.use(
const userStore = $store('user')
response.config.custom.showLoading && closeLoading()
console.log('response', JSON.parse(JSON.stringify(response.data)))
if (!response.config.custom.isTransformResponse) {
return Promise.resolve(response.data)
}