fix: opts null
This commit is contained in:
parent
f555a64a2d
commit
3cdff1adc8
@ -24,8 +24,8 @@ request.use(async (ctx, next) => {
|
||||
const token = localStorage.getItem('NOCOBASE_TOKEN');
|
||||
if (token) {
|
||||
headers['Authorization'] = `Bearer ${token}`;
|
||||
headers['X-Hostname'] = process.env.API_HOSTNAME;
|
||||
}
|
||||
headers['X-Hostname'] = window.location.hostname;
|
||||
await next();
|
||||
});
|
||||
|
||||
|
@ -47,6 +47,7 @@ const api = new Server({
|
||||
});
|
||||
|
||||
const plugins = [
|
||||
'@nocobase/plugin-multi-apps',
|
||||
'@nocobase/plugin-ui-router',
|
||||
'@nocobase/plugin-ui-schema',
|
||||
'@nocobase/plugin-collections',
|
||||
|
@ -92,9 +92,9 @@ export default {
|
||||
}
|
||||
},
|
||||
});
|
||||
this.app.on('db.init', async (opts, cli) => {
|
||||
const importDemo = opts.importDemo || this.options.importDemo;
|
||||
const lang = opts.lang || this.options.lang;
|
||||
this.app.on('db.init', async (opts = {}, cli) => {
|
||||
const importDemo = opts?.importDemo || this.options.importDemo;
|
||||
const lang = opts?.lang || this.options.lang;
|
||||
const SystemSetting = app.db.getModel('system_settings');
|
||||
const model = await SystemSetting.findOne();
|
||||
model.appLang = lang || 'en-US';
|
||||
|
Loading…
Reference in New Issue
Block a user