|
@@ -4,12 +4,8 @@ import { getToken } from '@/store/useCookieStore'
|
|
|
|
|
|
export default defineNuxtPlugin(nuxtApp => {
|
|
|
let Url = {
|
|
|
- //正式环境
|
|
|
- // webUrl: 'https://flzxw.bjzxtw.org.cn', //接口地址
|
|
|
- // CwebUrl: 'nw.china-village.com.cn' //页面地址
|
|
|
- //pre环境
|
|
|
- webUrl: 'http://apipre1.bjzxtw.org.cn:29501', //pre接口地址
|
|
|
- CwebUrl: 'pre.china-village.com.cn' //页面地址
|
|
|
+ webUrl: nuxtApp.$webUrl, //pre接口地址
|
|
|
+ CwebUrl: nuxtApp.$CwebUrl //页面地址
|
|
|
}
|
|
|
|
|
|
const service = axios.create({
|
|
@@ -25,7 +21,7 @@ export default defineNuxtPlugin(nuxtApp => {
|
|
|
if (token) {
|
|
|
config.headers.token = token;
|
|
|
}
|
|
|
- config.headers.userurl = Url.CwebUrl;
|
|
|
+ config.headers.userurl = nuxtApp.$CwebUrl;
|
|
|
return config;
|
|
|
}, error => {
|
|
|
console.log(error)
|