|
@@ -147,10 +147,10 @@ export default {
|
|
},
|
|
},
|
|
uploadImg(imgData) {
|
|
uploadImg(imgData) {
|
|
const config = {
|
|
const config = {
|
|
- // headers: {
|
|
|
|
- // 'Content-Type': 'multipart/form-data'
|
|
|
|
- // },
|
|
|
|
- // withCredentials: true
|
|
|
|
|
|
+ headers: {
|
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
|
+ },
|
|
|
|
+ withCredentials: true
|
|
} // 添加请求头
|
|
} // 添加请求头
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
axios.post(
|
|
axios.post(
|
|
@@ -158,7 +158,8 @@ export default {
|
|
{
|
|
{
|
|
imgData,
|
|
imgData,
|
|
'innerPublic': true
|
|
'innerPublic': true
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ config
|
|
).then(res => {
|
|
).then(res => {
|
|
console.log(res)
|
|
console.log(res)
|
|
// newStr = newStr.replace(imgData, res.url)
|
|
// newStr = newStr.replace(imgData, res.url)
|