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,
|
||||
metaDescription: Util.config.metaDescription,
|
||||
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')
|
||||
// eslint-disable-next-line func-names
|
||||
.where(function() {
|
||||
if (user === undefined) {
|
||||
this.whereNull('userId');
|
||||
} else {
|
||||
if (user) {
|
||||
this.where('userId', user.id);
|
||||
} else {
|
||||
this.whereNull('userId');
|
||||
}
|
||||
})
|
||||
.where({
|
||||
|
|
|
@ -29,5 +29,12 @@ export const mutations = {
|
|||
state.chunkSize = config.chunkSize;
|
||||
state.publicMode = config.publicMode;
|
||||
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