赞
踩
VUE版本
- import axios from 'axios'
- Vue.prototype.$http= axios
- proxyTable: {
- // http://localhost:44923/pages/NoteInfo.aspx
- '/pages': {
- target: 'http://localhost:44923',
- ws: true,
- changeOrgin: true,
- }
- },
- created()
- {
- var that = this;
-
- // this.$http.get('http://localhost:44923/pages/NoteInfo.aspx?soft=easyicon')
- this.$http.get('/pages/NoteInfo.aspx', {params:{soft:'easyicon'}})
- .then((response)=>{
- // console.log("log信息");
- // console.log(response);
-
- that.tittle = response.data.tittle;
- that.url = response.data.url;
- that.note = that.base64ToString(response.data.note);
- })
- .catch((response)=>{
- console.log(response);
- this.note = "异常信息";
- })
-
- },
通过VUE前端解决方案: 2、添加proxy跨域访问
通过接口后台解决方案: Response.AddHeader("Access-Control-Allow-Origin", "*");
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。