@@ -24,8 +24,12 @@ const settingService = {
|
|||||||
const setting = await c.env.kv.get(KvConst.SETTING, { type: 'json' });
|
const setting = await c.env.kv.get(KvConst.SETTING, { type: 'json' });
|
||||||
let domainList = c.env.domain;
|
let domainList = c.env.domain;
|
||||||
if (typeof domainList === 'string') {
|
if (typeof domainList === 'string') {
|
||||||
|
try {
|
||||||
|
domainList = JSON.parse(domainList)
|
||||||
|
} catch (error) {
|
||||||
throw new BizError(t('notJsonDomain'));
|
throw new BizError(t('notJsonDomain'));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
domainList = domainList.map(item => '@' + item);
|
domainList = domainList.map(item => '@' + item);
|
||||||
setting.domainList = domainList;
|
setting.domainList = domainList;
|
||||||
return setting;
|
return setting;
|
||||||
|
|||||||
Reference in New Issue
Block a user