Merge branch 'master' of http://git.hchyun.com/clay/expressweb
This commit is contained in:
commit
27090e845c
|
|
@ -16,11 +16,13 @@ import topTitle from './SugTopTitle'
|
||||||
import sugBody from './SugBody'
|
import sugBody from './SugBody'
|
||||||
import appFooter from '../AppFooter'
|
import appFooter from '../AppFooter'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
// import axios from './api.config'
|
||||||
|
import qs from 'qs'
|
||||||
export default {
|
export default {
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
sugcontshow:false,
|
sugcontshow:false,
|
||||||
contShow:false
|
contShow:false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components:{
|
components:{
|
||||||
|
|
@ -57,7 +59,7 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flag){
|
/*if(flag){
|
||||||
let loading = this.$loading({lock:true,text:'玩命加载中...'});
|
let loading = this.$loading({lock:true,text:'玩命加载中...'});
|
||||||
axios.post(`/admin/submitSuggest`,sugForm).then(response=>{
|
axios.post(`/admin/submitSuggest`,sugForm).then(response=>{
|
||||||
let res = response.data;
|
let res = response.data;
|
||||||
|
|
@ -75,10 +77,59 @@ export default {
|
||||||
console.log(err);
|
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>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue