* 修正enka HttpsProxyAgent错误

* 修正圣遗物分数计算时部分角色的总分上限计算遗漏,可能导致档位爆表的情况
This commit is contained in:
Kokomi 2022-11-28 03:35:57 +08:00
parent 4fb10c8456
commit 286851d531
4 changed files with 21 additions and 4 deletions

View File

@ -3,6 +3,8 @@ import { Data } from '../index.js'
import { ProfileServ } from '../../models/index.js'
import EnkaData from './enka-data.js'
let HttpsProxyAgent = ''
export default new ProfileServ({
id: 'enka',
cfgKey: 'enkaApi',
@ -14,8 +16,16 @@ export default new ProfileServ({
}
let proxy = this.getCfg('proxyAgent')
if (proxy) {
let HttpsProxyAgent = await import('https-proxy-agent')
params.agent = new HttpsProxyAgent(proxy)
if (HttpsProxyAgent === '') {
HttpsProxyAgent = await import('https-proxy-agent').catch((err) => {
logger.error(err)
})
HttpsProxyAgent = HttpsProxyAgent ? HttpsProxyAgent.default : undefined
}
if (HttpsProxyAgent) {
params.agent = new HttpsProxyAgent(proxy)
}
}
return { api, params }
},

View File

@ -101,6 +101,13 @@
<% } %>
</div>
{{if changeProfile}}
<div class="cont">
<div class="cont-footer dmg-desc">
<strong>该面板为非实际数据。当前替换命令:</strong> {{changeProfile}}
</div>
</div>
{{/if}}
<!-- 词条规则 -->
<div class="cont">

View File

@ -56,7 +56,7 @@
<div class="data-info">
{{if data.dataSource}}
<span>{{if data._attrCalc}}[面板计算:开启] ·{{/if}} 数据源:{{ {miao:"喵喵Api",enka:"Enka.Network",input:"手工录入"}[data.dataSource]||data.dataSource }}</span>
<span>{{if data._attrCalc}}[启用计算] ·{{/if}} 数据源:{{ {miao:"喵喵Api",enka:"Enka.Network",change:"面板变换"}[data.dataSource]||data.dataSource }}</span>
{{/if}}
{{if data.updateTime}}
<span class="time">{{data.updateTime}}</span>

View File

@ -85,4 +85,4 @@ export const mainAttr = {
5: 'atk,def,hp,mastery,heal,cpct,cdmg'.split(',')
}
export const subAttr = 'atk,def,hp,mastery,recharge,cpct,cdmg'.split(',')
export const subAttr = 'atk,atkPlus,def,defPlus,hp,hpPlus,mastery,recharge,cpct,cdmg'.split(',')