fix: extraInsurances TS类型断言 + trust proxy设置,部署到on.hr8ai.top
This commit is contained in:
@@ -8,6 +8,8 @@ import { apiLimiter } from './middleware/rateLimit'
|
||||
|
||||
const app = express()
|
||||
|
||||
app.set('trust proxy', 1)
|
||||
|
||||
app.use(helmet())
|
||||
app.use(compression({
|
||||
filter: (req, res) => {
|
||||
|
||||
@@ -429,7 +429,7 @@ router.post('/calculate', async (req: AuthRequest, res: Response, next: NextFunc
|
||||
// 附加险种
|
||||
const extraItems: any[] = []
|
||||
if (config.extraInsurances && Array.isArray(config.extraInsurances)) {
|
||||
for (const ins of config.extraInsurances) {
|
||||
for (const ins of config.extraInsurances as any[]) {
|
||||
const insBase = ins.baseType === 'medical' ? medicalBase : ins.baseType === 'fixed' ? 1 : actualBase
|
||||
if (ins.baseType === 'fixed' && ins.fixedAmount) {
|
||||
const orgAmt = ins.fixedAmount
|
||||
@@ -832,7 +832,7 @@ function calcSocialDetail(base: number, config: any) {
|
||||
]
|
||||
// 附加险种
|
||||
if (config.extraInsurances && Array.isArray(config.extraInsurances)) {
|
||||
for (const ins of config.extraInsurances) {
|
||||
for (const ins of config.extraInsurances as any[]) {
|
||||
const insBase = ins.baseType === 'medical' ? medicalBase : ins.baseType === 'fixed' ? 1 : actualBase
|
||||
if (ins.baseType === 'fixed' && ins.fixedAmount) {
|
||||
items.push({ name: ins.name, orgRate: 0, empRate: 0, orgAmount: ins.fixedAmount, empAmount: ins.empFixedAmount || 0 })
|
||||
|
||||
@@ -46,7 +46,7 @@ export function calcSocialInsurance(base: number, config: any) {
|
||||
// 附加险种(大病险/长护险等)
|
||||
const extraItems: any[] = []
|
||||
if (config.extraInsurances && Array.isArray(config.extraInsurances)) {
|
||||
for (const ins of config.extraInsurances) {
|
||||
for (const ins of config.extraInsurances as any[]) {
|
||||
const insBase = ins.baseType === 'medical' ? medicalBase : ins.baseType === 'fixed' ? 1 : actualBase
|
||||
if (ins.baseType === 'fixed' && ins.fixedAmount) {
|
||||
const orgAmt = ins.fixedAmount
|
||||
|
||||
Reference in New Issue
Block a user