mirror of
https://github.com/hi2shark/nazhua.git
synced 2026-01-16 09:10:42 +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;
|
return str2;
|
||||||
};
|
};
|
||||||
export default async () => fetch(config.nazhua.nezhaPath).then((res) => res.text()).then((res) => {
|
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];
|
const configStr = resMatch?.[1];
|
||||||
if (!configStr) {
|
if (!configStr) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user