Commit 61e5db60 authored by 翁佳瑞's avatar 翁佳瑞

dev proxy interface

parent 013e9bc2
...@@ -55,5 +55,6 @@ ...@@ -55,5 +55,6 @@
"mobx-react": "^6.2.2", "mobx-react": "^6.2.2",
"moment": "^2.26.0", "moment": "^2.26.0",
"node-sass": "^4.14.1" "node-sass": "^4.14.1"
} },
"proxy": "https://uat-nginx.jianbing.com"
} }
...@@ -22,10 +22,10 @@ const formate = (type: string, data: any) => { ...@@ -22,10 +22,10 @@ const formate = (type: string, data: any) => {
export function api(url: string, options: Options) { export function api(url: string, options: Options) {
let host = window.location.host; let host = window.location.host;
let type = options.type || 'POST'; let type = options.type || 'POST';
let u = host.match(/(127.0.0.1|localhost)/) // let u = host.match(/(127.0.0.1|localhost)/)
? `https://uat-nginx.jianbing.com${url}` // ? `https://uat-nginx.jianbing.com${url}`
: url; // : url;
let u = url
u = type === 'GET' ? `${u}?${formate('get', options.data)}` : u; u = type === 'GET' ? `${u}?${formate('get', options.data)}` : u;
return fetch(u, { return fetch(u, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment