取消拼接token 前缀,由后端处理

This commit is contained in:
dqjdda
2019-11-28 20:12:23 +08:00
parent 11d1a803ee
commit a4299d944b
9 changed files with 9 additions and 9 deletions

View File

@@ -15,7 +15,7 @@ const service = axios.create({
service.interceptors.request.use( service.interceptors.request.use(
config => { config => {
if (getToken()) { if (getToken()) {
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
} }
config.headers['Content-Type'] = 'application/json' config.headers['Content-Type'] = 'application/json'
return config return config

View File

@@ -15,7 +15,7 @@ export default {
data() { data() {
return { return {
headers: { headers: {
'Authorization': 'Bearer ' + getToken() 'Authorization': getToken()
}, },
editorContent: editorContent:
`<h3 style="text-align: center;">欢迎使用 wangEditor 富文本编辑器!</h3> `<h3 style="text-align: center;">欢迎使用 wangEditor 富文本编辑器!</h3>

View File

@@ -42,7 +42,7 @@ export default {
url: this.imagesUploadApi, url: this.imagesUploadApi,
method: 'post', method: 'post',
data: formdata, data: formdata,
headers: { 'Content-Type': 'multipart/form-data', 'Authorization': 'Bearer ' + getToken() } headers: { 'Content-Type': 'multipart/form-data', 'Authorization': getToken() }
}).then((data) => { }).then((data) => {
this.data = data.data this.data = data.data
this.$refs.md.$img2Url(pos, this.data.data[0]) this.$refs.md.$img2Url(pos, this.data.data[0])

View File

@@ -38,7 +38,7 @@ export default {
apps: [], apps: [],
servers: [], servers: [],
headers: { headers: {
Authorization: 'Bearer ' + getToken() Authorization: getToken()
}, },
deployInfo: {}, deployInfo: {},
form: { form: {

View File

@@ -99,7 +99,7 @@ export default {
Avatar: Avatar, Avatar: Avatar,
ico: 'el-icon-refresh', ico: 'el-icon-refresh',
headers: { headers: {
'Authorization': 'Bearer ' + getToken() 'Authorization': getToken()
} }
} }
}, },

View File

@@ -30,7 +30,7 @@ export default {
data() { data() {
return { return {
headers: { headers: {
'Authorization': 'Bearer ' + getToken() 'Authorization': getToken()
}, },
loading: false, form: { subject: '', tos: [], content: '' }, loading: false, form: { subject: '', tos: [], content: '' },
tos: [{ tos: [{

View File

@@ -134,7 +134,7 @@ export default {
title: '图片', title: '图片',
crudMethod: { ...crudPic }, crudMethod: { ...crudPic },
headers: { headers: {
'Authorization': 'Bearer ' + getToken() 'Authorization': getToken()
}, },
dialogImageUrl: '', dialogImageUrl: '',
dialogVisible: false, dialogVisible: false,

View File

@@ -168,7 +168,7 @@ export default {
title: '文件', title: '文件',
crudMethod: { ...crudFile }, crudMethod: { ...crudFile },
delAllLoading: false, delAllLoading: false,
headers: { 'Authorization': 'Bearer ' + getToken() }, headers: { 'Authorization': getToken() },
form: { id: null, name: null } form: { id: null, name: null }
} }
}, },

View File

@@ -129,7 +129,7 @@ export default {
title: '文件', title: '文件',
crudMethod: { ...crudQiNiu }, crudMethod: { ...crudQiNiu },
icon: 'el-icon-refresh', icon: 'el-icon-refresh',
url: '', headers: { 'Authorization': 'Bearer ' + getToken() }, dialog: false, url: '', headers: { 'Authorization': getToken() }, dialog: false,
dialogImageUrl: '', dialogVisible: false, fileList: [], files: [], newWin: null dialogImageUrl: '', dialogVisible: false, fileList: [], files: [], newWin: null
} }
}, },