mirror of
https://github.com/hi2shark/nazhua.git
synced 2026-01-12 15:20:43 +08:00
✨ 增强 load-nezha-config.js 以兼容不同的 nezha 前台主题
This commit is contained in:
parent
4542fc042a
commit
e4324b3916
@ -10,7 +10,13 @@ const unescaped = (str) => {
|
||||
return str2;
|
||||
};
|
||||
export default async () => fetch(config.nazhua.nezhaPath).then((res) => res.text()).then((res) => {
|
||||
const resMatch = res?.match?.(configReg(config.nazhua.nezhaV0ConfigType));
|
||||
let resMatch = res?.match?.(configReg(config.nazhua.nezhaV0ConfigType));
|
||||
// 尝试兼容不同的nezha前台主题
|
||||
if (!resMatch) {
|
||||
resMatch = res?.match?.(configReg(
|
||||
config.nazhua.nezhaV1ConfigType === 'servers' ? 'initData' : 'servers',
|
||||
));
|
||||
}
|
||||
const configStr = resMatch?.[1];
|
||||
if (!configStr) {
|
||||
return null;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user