This commit is contained in:
memo 2021-03-20 15:49:54 +08:00
parent 5366ae7636
commit 2c3f251e3f
1 changed files with 54 additions and 3 deletions

View File

@ -16,11 +16,13 @@ import topTitle from './SugTopTitle'
import sugBody from './SugBody'
import appFooter from '../AppFooter'
import axios from 'axios'
// import axios from './api.config'
import qs from 'qs'
export default {
data(){
return{
sugcontshow:false,
contShow:false
contShow:false,
}
},
components:{
@ -57,7 +59,7 @@ export default {
});
}
if(flag){
/*if(flag){
let loading = this.$loading({lock:true,text:'玩命加载中...'});
axios.post(`/admin/submitSuggest`,sugForm).then(response=>{
let res = response.data;
@ -75,10 +77,59 @@ export default {
console.log(err);
})
}*/
if (flag){
let data
data = {
name:sugForm.userName,
phone:sugForm.phoneNum,
content:sugForm.suggestText,
}
console.log(data)
// const baseUrl = 'http://localhost:8083/api/'
const baseUrl = 'http://api.tomey.live/api/'
axios({
method: 'post',
url: baseUrl + 'addcomplaint',
headers: {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'
},
data: qs.stringify(data, { arrayFormat: 'brackets' })
}).then(res => {
console.log(res)
console.log("0000")
if (res.data.code==1){
this.$notify({
title: '提交成功',
duration: 2000,
message:res.msg,
type: 'success'
})
}else {
this.$notify({
title: '提交失败',
duration: 2000,
// message:'admin',
type: 'error'
})
}
})
} else {
this.$notify({
title: '提交失败',
// message: data.msg,
duration: 2000,
type: 'error'
})
}
}
}
}
}
</script>