跨域处理
This commit is contained in:
parent
8450f0add1
commit
8f131614f2
@ -0,0 +1,7 @@
|
||||
import axios from "./axios";
|
||||
|
||||
export default{
|
||||
index:(params={})=>{
|
||||
return axios.get('/tenement/pc/api/home',params)
|
||||
}
|
||||
}
|
@ -5,7 +5,8 @@ import router from '../router/index'
|
||||
// let protocol = window.location.protocol; //协议
|
||||
// let host = window.location.host; //主机
|
||||
// axios.defaults.baseURL = protocol + "//" + host;
|
||||
axios.defaults.baseURL = 'https://app.gter.net'
|
||||
// axios.defaults.baseURL = 'https://app.gter.net'
|
||||
axios.defaults.baseURL = '/index'
|
||||
// axios.defaults.emulateJSON = true
|
||||
// axios.defaults.withCredentials = true
|
||||
|
||||
|
@ -166,12 +166,14 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive } from "vue";
|
||||
import listItem from "../components/apartmentList/apartmentList.vue";
|
||||
import pageTopBar from '../components/pageTopBar/pageTopBar.vue';
|
||||
import indexWaterfallBox from "../components/indexWaterfallBox/indexWaterfallBox.vue";
|
||||
import seachModule from "../components/seachModule/seachModule.vue";
|
||||
import indexRegularBox from '../components/indexRegularBox/indexRegularBox.vue';
|
||||
import headerNavigation from '../components/public/head.vue'
|
||||
import api from "../utils/api";
|
||||
|
||||
//
|
||||
let informationData = [
|
||||
@ -194,6 +196,12 @@ let ListSelectBtn = [
|
||||
text: '已认证'
|
||||
},
|
||||
]
|
||||
|
||||
let indexData= reactive({data:[]})
|
||||
api.index().then(res=>{
|
||||
console.log(res)
|
||||
})
|
||||
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
|
@ -35,6 +35,18 @@ module.exports = defineConfig({
|
||||
.use('sass-loader')
|
||||
.loader('sass-loader')
|
||||
.end()
|
||||
},
|
||||
devServer: {
|
||||
proxy: {
|
||||
'/index': {
|
||||
target: 'https://app.gter.net',//请求的接口的前缀
|
||||
changeOrigin:true,
|
||||
rewrite: (path) => path.replace(/^\/index/, ''),
|
||||
pathRewrite:{
|
||||
'^/index':''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user