update
This commit is contained in:
parent
dbdbf58339
commit
83e08f386c
Binary file not shown.
|
After Width: | Height: | Size: 518 KiB |
|
|
@ -15,12 +15,13 @@ export class Product extends CoreEntity {
|
|||
const prefix = process.env.PREFIX_VERSION || '/api';
|
||||
const port = process.env.APP_PORT || '4000';
|
||||
|
||||
return (value as []).map((item) => {
|
||||
if (isURL(item, { require_host: true, require_protocol: true })) {
|
||||
return (value as string[]).map((item) => {
|
||||
// Nếu đã là URL đầy đủ thì trả về nguyên xi
|
||||
if (/^https?:\/\//i.test(item)) {
|
||||
return item;
|
||||
}
|
||||
|
||||
const path = `medias/products/${(title as string).toLowerCase().replaceAll(' ', '-')}/${item}`;
|
||||
const path = `medias/products/${title.toLowerCase().replaceAll(' ', '-')}/${item}`;
|
||||
|
||||
if (env === 'dev') {
|
||||
return `http://localhost:${port}${prefix}/${path}`;
|
||||
|
|
|
|||
Loading…
Reference in New Issue