master
xingyy 1 month ago
parent e7e493b2c1
commit 5f3277eb24

@ -13,14 +13,10 @@ const request = new Request({
config.headers['Content-Type'] = config.method === 'get' ? config.headers['Content-Type'] = config.method === 'get' ?
'application/x-www-form-urlencoded' : 'application/x-www-form-urlencoded' :
'application/json' 'application/json'
config.headers['Authorization'] = token
config.headers['tokenC'] = JSON.parse(localStorage.getItem('voteToken') || '{}')?.authorization;
if (config.isFormData) { if (config.isFormData) {
config.headers['Content-Type'] = 'multipart/form-data'; config.headers['Content-Type'] = 'multipart/form-data';
config.headers['Authorization'] = token
config.headers['tokenC'] ='1234567'
} else {
config.headers['Authorization'] = token
console.log('JSON.parse(localStorage.getItem(\'voteToken\'))?.authorization',JSON.parse(localStorage.getItem('voteToken'))?.authorization)
config.headers['tokenC'] =JSON.parse(localStorage.getItem('voteToken'))?.authorization
} }
return config; return config;
}, },

Loading…
Cancel
Save