Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

如何发送ajax请求 #37

Closed
happysmile12321-cocplug opened this issue Jan 16, 2021 · 1 comment
Closed

如何发送ajax请求 #37

happysmile12321-cocplug opened this issue Jan 16, 2021 · 1 comment

Comments

@happysmile12321-cocplug

比如
import request from '@/utils/request'

export function fetchUserData() {
return request.get('https://api.github.com/users/woai3c')
}

// test ajax to baidu
export function testAjaxToBaidu() {
return request.get('http://www.baidu.com')
}
这个test发的请求失败

@woai3c
Copy link
Owner

woai3c commented Jan 16, 2021

有些网站是禁止第三方 API 请求的。

@woai3c woai3c closed this as completed Jan 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants