图片上传到服务器后,服务器返回图片在服务器中的地址,使其能在页面显示;
使用token验证后,图图片上传成功,返回imgUrl地址也拿到,但图片就是不能显示,页面显示破损图片,
然后我在imgUrl后再上token,如:http://lcalhosy:3000/images.1...,
但还是无法显示。
求解下这个要怎么解决?
express服务器,token解析如下代码:
/解析token,获取用户信息
app.use(function(req,res,next){
const token = req.headers['authorization'] || req.query.token
if(token===undefined){
return next()
}else{
jwt.verToken(token).then(data=>{
req.data = data
return next()
}).catch(error=>{
return next()
})
}
})