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