会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 133059个问题
Python 全系列/第八阶段:轻量级Web开发利器-Flask框架/Flask数据库 20687楼
JAVA 全系列/第七阶段:生产环境部署与协同开发/Docker 20689楼

<template>
  <div class="hello">
    <div>
      <span>{{shangpin.title}}</span><br><span>{{shangpin.content}}</span>
    </div>
  </div>
</template>

<script>
import axios from 'axios'
// import qs from 'querystring'
import qs from 'querystring'
export default {
  name: 'HelloWorld',
  data(){
    return{
     shangpin:{
       title:'',
       content:''
     },
     flag:false
    }
  },
  props: {
    msg: String
  },
  mounted(){
    var that=this
    // axios.get('http://iwenwiki.com/api/blueberrypai/getChengpinDetails.php').then(function(res){
    //   // console.log(res);
    //   if(res.status==200){
    //     // console.log(res.data.chengpinDetails[0].content);
    //     that.shangpin.title=res.data.chengpinDetails[0].title
    //       that.shangpin.content=res.data.chengpinDetails[0].content;
       
       
    //   }
    // }).catch(function(err){
    //   console.log(err);
    // })

    // axios.get('http://iwenwiki.com:3000/search?keywords',{
    //   params:{
    //     keywords:'你瞒我瞒'
    //   }
    // }).then(res=>{
    //   console.log(res);
    // }).catch(err=>{
    //   console.log(err);
    // })

    // post请求
    //querystring.stringify 将对象变为字符串
    //querystring.parse() 将字符串变为对象
    // axios.post('http://iwenwiki.com/api/blueberrypai/login.php',qs.stringify({
    //   user_id:'iwen@qq.com',
    //   password:'iwen123',
    //   verification_code:'crfvw'
    // })).then(res=>{console.log(res);}).catch(err=>{console.log(err);})
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>

老师为啥我导入那个querystring 模块 后台就起不来呢?

image.png

image.png


WEB前端全系列/第十九阶段:Vue2知识体系(旧)/网络请求 20692楼
JAVA 全系列/第一阶段:JAVA 快速入门/JAVA入门和背景知识 20697楼
Python 全系列/第五阶段:数据库编程/mysql的使用 20698楼
Python 全系列/第二十四阶段:人工智能基础_深度学习理论和实战(旧)/Keras框架 20699楼
JAVA 全系列/第二阶段:JAVA 基础深化和提高/手写服务器项目(旧) 20700楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637