123
This commit is contained in:
parent
5366ae7636
commit
2c3f251e3f
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue