Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好,请问一下我想配一下代理需要怎么设置 #6

Open
ZYQ007 opened this issue Jan 4, 2023 · 1 comment
Open

你好,请问一下我想配一下代理需要怎么设置 #6

ZYQ007 opened this issue Jan 4, 2023 · 1 comment

Comments

@ZYQ007
Copy link

ZYQ007 commented Jan 4, 2023

我在package.json 中 设置了 "proxy": "http://...",其他地方没有改动, 其中baseURL,我设置成服务器地址或使用localhost地址都会跨域

@ZYQ007 ZYQ007 closed this as completed Jan 4, 2023
@ZYQ007 ZYQ007 reopened this Jan 4, 2023
@ccj-007
Copy link
Owner

ccj-007 commented Jan 7, 2023

componentDidMount() {
   proxy({
	onRequest: (config, handler) => {
		// config.url = this.state.baseURL + config.url; 
	},
   });
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants