diff --git a/src/serve/api/ajax.js b/src/serve/api/ajax.js index e5b4723..a39bca0 100644 --- a/src/serve/api/ajax.js +++ b/src/serve/api/ajax.js @@ -20,14 +20,14 @@ export default function ajax(url = '', params = {}, type = 'GET') { if (paramsStr) { paramsStr = paramsStr.substr(0, paramsStr.lastIndexOf('&')); // 2.5 拼接完整路径 - if (url.indexOf('47.98.157.152') === -1) { - url += '?' + paramsStr + '&geek166=' + randomCode(20); + if (url.indexOf('127.0.0.1') === -1) { + url += '?' + paramsStr + '&Geek-James=' + randomCode(20); } else { url += '?' + paramsStr; } } else { - if (url.indexOf('47.98.157.152') === -1) { - url += '?geek166=' + randomCode(20) + if (url.indexOf('127.0.0.1') === -1) { + url += '?Geek-James=' + randomCode(20) } } // 2.6 发起get请求 diff --git a/src/serve/api/index.js b/src/serve/api/index.js index ad325b4..de01939 100644 --- a/src/serve/api/index.js +++ b/src/serve/api/index.js @@ -1,7 +1,7 @@ import ajax from './ajax' // 1. 定义基础路径 -const BASE_URL = 'http://ddbuy.7-orange.cn:7300/mock/5def6a2d448e330a1116366e/api/' +const BASE_URL = 'http://api.7-orange.cn:7300/mock/5def6a2d448e330a1116366e/api/' /*****Home 模块*******/ export const getHomeData = () => ajax(BASE_URL + 'homeApi'); diff --git a/vue.config.js b/vue.config.js index b52b89b..831d0a5 100644 --- a/vue.config.js +++ b/vue.config.js @@ -16,7 +16,7 @@ module.exports = { proxy: { // 配置跨域处理 可以设置多个 '/api': { - target: 'http://ddbuy.7-orange.cn:7300/mock/5def6a2d448e330a1116366e/api/', + target: 'http://api.7-orange.cn:7300/mock/5def6a2d448e330a1116366e/api/', ws: true, changeOrigin: true }