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',
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Input',
|
||||
required: true,
|
||||
},
|
||||
path: {
|
||||
title: '{{t("Path")}}',
|
||||
|
@ -51,6 +51,7 @@ const collection = {
|
||||
title: '{{t("Storage base URL")}}',
|
||||
type: 'string',
|
||||
'x-component': 'Input',
|
||||
required: true,
|
||||
} as ISchema,
|
||||
},
|
||||
{
|
||||
|
@ -68,7 +68,12 @@ async function middleware(app: Application) {
|
||||
|
||||
app.use(async function (ctx, next) {
|
||||
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;
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user