Commit e6c45255 authored by Allen Bai's avatar Allen Bai

feat: 调整request方法

parent da61dbb5
......@@ -11,8 +11,8 @@ function request(option) {
}
option.data = formData.join('&')
if (option.method === 'GET') {
option.url += location.search.length === 0 ? ''.concat('?', option.data) : ''.concat('&', option.data)
if (option.method === 'GET' && option.data) {
option.url += option.url.indexOf('?') < 0 ? ''.concat('?', option.data) : ''.concat('&', option.data)
}
var xhr = new XMLHttpRequest()
......
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