修复request.jsonp数据不发送的bug;修复router组件刷新时URL的search部分丢失的bug
parent
207dff5c17
commit
775e5d6f66
|
@ -33,7 +33,7 @@ try {
|
||||||
let originAnchor = doc.createElement('a')
|
let originAnchor = doc.createElement('a')
|
||||||
originAnchor.href = location.href
|
originAnchor.href = location.href
|
||||||
|
|
||||||
const noBodyMethods = ['GET', 'HEAD']
|
const noBodyMethods = ['GET', 'HEAD', 'JSONP']
|
||||||
const error = {
|
const error = {
|
||||||
10001: 'argument url is required',
|
10001: 'argument url is required',
|
||||||
10002: 'method "set" required an object or 2 args',
|
10002: 'method "set" required an object or 2 args',
|
||||||
|
|
|
@ -202,8 +202,9 @@ class Router {
|
||||||
this.path = path
|
this.path = path
|
||||||
} else {
|
} else {
|
||||||
let hash = forceCleanHash ? '' : location.hash
|
let hash = forceCleanHash ? '' : location.hash
|
||||||
|
let search = forceCleanHash ? '' : location.search
|
||||||
path = path.replace(/^[/]+?/, '')
|
path = path.replace(/^[/]+?/, '')
|
||||||
window.history.pushState({ path }, null, `/${path + hash}`)
|
window.history.pushState({ path }, null, `/${path + search + hash}`)
|
||||||
this.path = path
|
this.path = path
|
||||||
// pushState不会触发popstate事件,所以要手动触发路由检测
|
// pushState不会触发popstate事件,所以要手动触发路由检测
|
||||||
this.__check__()
|
this.__check__()
|
||||||
|
|
Reference in New Issue