fix: anon upload and domain fix for album links (#292)
This commit is contained in:
parent
0d36d03db6
commit
a8b985240d
|
@ -21,7 +21,8 @@ class configGET extends Route {
|
||||||
metaThemeColor: Util.config.metaThemeColor,
|
metaThemeColor: Util.config.metaThemeColor,
|
||||||
metaDescription: Util.config.metaDescription,
|
metaDescription: Util.config.metaDescription,
|
||||||
metaKeywords: Util.config.metaKeywords,
|
metaKeywords: Util.config.metaKeywords,
|
||||||
metaTwitterHandle: Util.metaTwitterHandle
|
metaTwitterHandle: Util.metaTwitterHandle,
|
||||||
|
domain: process.env.domain
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -289,10 +289,10 @@ class Util {
|
||||||
const dbFile = await db.table('files')
|
const dbFile = await db.table('files')
|
||||||
// eslint-disable-next-line func-names
|
// eslint-disable-next-line func-names
|
||||||
.where(function() {
|
.where(function() {
|
||||||
if (user === undefined) {
|
if (user) {
|
||||||
this.whereNull('userId');
|
|
||||||
} else {
|
|
||||||
this.where('userId', user.id);
|
this.where('userId', user.id);
|
||||||
|
} else {
|
||||||
|
this.whereNull('userId');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.where({
|
.where({
|
||||||
|
|
|
@ -29,5 +29,12 @@ export const mutations = {
|
||||||
state.chunkSize = config.chunkSize;
|
state.chunkSize = config.chunkSize;
|
||||||
state.publicMode = config.publicMode;
|
state.publicMode = config.publicMode;
|
||||||
state.userAccounts = config.userAccounts;
|
state.userAccounts = config.userAccounts;
|
||||||
|
state.URL = config.domain;
|
||||||
|
const lastChar = config.domain.substr(-1);
|
||||||
|
if (lastChar === '/') {
|
||||||
|
state.baseURL = `${config.domain}api`;
|
||||||
|
} else {
|
||||||
|
state.baseURL = `${config.domain}/api`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue