rename ipfsGateway
to ipfsLens
This commit is contained in:
parent
3c162e869f
commit
51e2ff7f2f
@ -58,7 +58,7 @@ module.exports = {
|
|||||||
pin: false, // 用户第一次上传的,可能并不是最后想要的,不必须永存。
|
pin: false, // 用户第一次上传的,可能并不是最后想要的,不必须永存。
|
||||||
})
|
})
|
||||||
_file.cid = cid?.toString() // + path.extname(file.filename)
|
_file.cid = cid?.toString() // + path.extname(file.filename)
|
||||||
_file.ipfsUrl = `${global.wo?.envar?.ipfsGateway?.replace?.(/\/$/, '')}/${_file.cid}` // 1) 前端自己选用 cid 或 ipfsUrl。2) 在本地测试成功,但是发现第一次上传的文件,作为 ipfs url 图片在前端显示比较慢,不如作为传统服务器的快。第二次上传同样文件的ipfs前端显示就快了。
|
_file.ipfsUrl = `${global.wo?.envar?.ipfsLens?.replace?.(/\/$/, '')}/${_file.cid}` // 1) 前端自己选用 cid 或 ipfsUrl。2) 在本地测试成功,但是发现第一次上传的文件,作为 ipfs url 图片在前端显示比较慢,不如作为传统服务器的快。第二次上传同样文件的ipfs前端显示就快了。
|
||||||
// rename the file to the cid
|
// rename the file to the cid
|
||||||
const newFileName = `${new Date().toJSON().replace(/[-:T]|\.\d\d\dZ$/g, '')}-${_file.cid}${path.extname(_file.filename)}`
|
const newFileName = `${new Date().toJSON().replace(/[-:T]|\.\d\d\dZ$/g, '')}-${_file.cid}${path.extname(_file.filename)}`
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user