Commit 39a7c8fa by wangshuo

跨域

parent d493c440
......@@ -82,7 +82,14 @@ class ToGroup extends Component {
console.log(resultList);
let res = resultList[0],
userInfo = resultList[1];
if(res.data.errno !== 0) {
Toast.info(res.data.msg, 2);
return;
}
if(userInfo.data.code !== 200) {
Toast.info(res.data.msg, 2);
return;
}
this.setState({
data: res.data.data.course_info,
pdd_price: res.data.data.pdd_price,
......
import axios from "axios";
import qs from 'qs'
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
const instance = axios.create({
transformRequest: [
(data) => qs.stringify(data)
],
headers: {
HTTP_PLAT_FORM: 5,
HTTP_PLAT: 5
HTTP_PLAT: 5,
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment