Browse Source

Add no_cdn option

pull/6/head
Menci 6 years ago
parent
commit
97af9d0bd2
  1. 2
      app.js
  2. 3
      config-example.json

2
app.js

@ -217,7 +217,7 @@ global.syzoj = {
app.use(Session(sessionConfig)); app.use(Session(sessionConfig));
app.use((req, res, next) => { app.use((req, res, next) => {
res.locals.useLocalLibs = !!parseInt(req.headers['syzoj-no-cdn']); res.locals.useLocalLibs = !!parseInt(req.headers['syzoj-no-cdn']) || syzoj.config.no_cdn;
let User = syzoj.model('user'); let User = syzoj.model('user');
if (req.session.user_id) { if (req.session.user_id) {

3
config-example.json

@ -120,5 +120,6 @@
"google_fonts": { "google_fonts": {
"type": "like-google-fonts", "type": "like-google-fonts",
"url": "https://fonts.loli.net" "url": "https://fonts.loli.net"
} },
"no_cdn": false
} }

Loading…
Cancel
Save