Skip to content

Commit 58b5c86

Browse files
authored
add no quotas status
1 parent 0aed9b9 commit 58b5c86

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

provider.ts

+10
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,16 @@ export default class LuoguProvider extends BasicFetcher implements IBasicProvide
211211
async checkStatus(onCheckFunc) {
212212
if (!onCheckFunc || !this.quota || this.quota.updateAt < Date.now() - Time.day) {
213213
const { body } = await this.get('/judge/quotaAvailable');
214+
if (!body.quotas.length) {
215+
logger.error('未找到正在生效的套餐');
216+
return onCheckFunc ? '你的账户未开通评测服务或评测套餐已过期' : {
217+
orgName: null,
218+
availablePoints: -1,
219+
createTime: 0,
220+
expireTime: 0,
221+
updateAt: Date.now(),
222+
};
223+
}
214224
this.quota = {
215225
orgName: body.quotas[0].org.name,
216226
availablePoints: body.quotas[0].availablePoints ?? -1,

0 commit comments

Comments
 (0)