提交 4f1b9170 authored 作者: huaxinzhu's avatar huaxinzhu

token拼接去 ‘bearer’

上级 675c3e72
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
uploadImgUrl: process.env.VUE_APP_BASE_API + "/system/upload/upImg", // 上传的图片服务器地址 uploadImgUrl: process.env.VUE_APP_BASE_API + "/system/upload/upImg", // 上传的图片服务器地址
uploadFileUrl: process.env.VUE_APP_BASE_API + "/system/upload/upFile", // 上传的附件服务器地址 uploadFileUrl: process.env.VUE_APP_BASE_API + "/system/upload/upFile", // 上传的附件服务器地址
headers: { headers: {
Authorization: 'Bearer ' + getToken() Authorization: getToken()
} }
}; };
}, },
...@@ -189,7 +189,7 @@ export default { ...@@ -189,7 +189,7 @@ export default {
} }
} }
}; };
</script> </script>
<style> <style>
.editor { .editor {
...@@ -271,4 +271,4 @@ export default { ...@@ -271,4 +271,4 @@ export default {
content: "等宽字体"; content: "等宽字体";
} }
</style> </style>
\ No newline at end of file
...@@ -37,7 +37,7 @@ service.interceptors.request.use(config => { ...@@ -37,7 +37,7 @@ service.interceptors.request.use(config => {
// 是否需要设置 token // 是否需要设置 token
const isToken = (config.headers || {}).isToken === false const isToken = (config.headers || {}).isToken === false
if (getToken() && !isToken) { if (getToken() && !isToken) {
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
} }
//config.headers['Authorization'] = 'Bearer ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbk5hbWUiOiIxNTcxMTEzOTg5NSIsInVpZCI6NTI4MjgsImNoYW5uZWxJZCI6MCwiZXhwIjoxNjE5ODMzMzk3LCJpc3MiOiJnaW4tYmxvZyJ9.rh-WXSaFqgqY611Tm5dhba532OYEZvm06vUmgZknoy4' //config.headers['Authorization'] = 'Bearer ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbk5hbWUiOiIxNTcxMTEzOTg5NSIsInVpZCI6NTI4MjgsImNoYW5uZWxJZCI6MCwiZXhwIjoxNjE5ODMzMzk3LCJpc3MiOiJnaW4tYmxvZyJ9.rh-WXSaFqgqY611Tm5dhba532OYEZvm06vUmgZknoy4'
return config return config
......
...@@ -13,7 +13,7 @@ export function downLoadZip(str, filename) { ...@@ -13,7 +13,7 @@ export function downLoadZip(str, filename) {
method: 'get', method: 'get',
url: url, url: url,
responseType: 'blob', responseType: 'blob',
headers: { 'Authorization': 'Bearer ' + getToken() } headers: { 'Authorization': getToken() }
}).then(res => { }).then(res => {
if(filename){ if(filename){
res.headers['content-disposition'] = 'attachment; filename='+filename; res.headers['content-disposition'] = 'attachment; filename='+filename;
......
...@@ -389,7 +389,7 @@ export default { ...@@ -389,7 +389,7 @@ export default {
// 是否更新已经存在的用户数据 // 是否更新已经存在的用户数据
updateSupport: 0, updateSupport: 0,
// 设置上传的请求头部 // 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() }, headers: { Authorization: getToken() },
// 上传的地址 // 上传的地址
url: process.env.VUE_APP_BASE_API + "/system/user/importData" url: process.env.VUE_APP_BASE_API + "/system/user/importData"
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论