fix(plugin-fm): fix local storage config and skip empty base url (#1294)
This commit is contained in:
parent
7e64c763b2
commit
0d732d214c
@ -11,6 +11,7 @@ const schema = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'Input',
|
'x-component': 'Input',
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
path: {
|
path: {
|
||||||
title: '{{t("Path")}}',
|
title: '{{t("Path")}}',
|
||||||
|
@ -51,6 +51,7 @@ const collection = {
|
|||||||
title: '{{t("Storage base URL")}}',
|
title: '{{t("Storage base URL")}}',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
'x-component': 'Input',
|
'x-component': 'Input',
|
||||||
|
required: true,
|
||||||
} as ISchema,
|
} as ISchema,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -68,7 +68,12 @@ async function middleware(app: Application) {
|
|||||||
|
|
||||||
app.use(async function (ctx, next) {
|
app.use(async function (ctx, next) {
|
||||||
for (const storage of storages.values()) {
|
for (const storage of storages.values()) {
|
||||||
const baseUrl = storage.get('baseUrl');
|
const baseUrl = storage.get('baseUrl').trim();
|
||||||
|
if (!baseUrl) {
|
||||||
|
console.error('"baseUrl" is not configured');
|
||||||
|
// return ctx.throw(500);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
let url;
|
let url;
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user