mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(nuxt): use query for hashing the fetch key (#18411)
This commit is contained in:
parent
b2291189b7
commit
50e23bad35
@ -47,7 +47,7 @@ export function useFetch<
|
|||||||
arg2?: string
|
arg2?: string
|
||||||
) {
|
) {
|
||||||
const [opts = {}, autoKey] = typeof arg1 === 'string' ? [{}, arg1] : [arg1, arg2]
|
const [opts = {}, autoKey] = typeof arg1 === 'string' ? [{}, arg1] : [arg1, arg2]
|
||||||
const _key = opts.key || hash([autoKey, unref(opts.baseURL), typeof request === 'string' ? request : '', unref(opts.params)])
|
const _key = opts.key || hash([autoKey, unref(opts.baseURL), typeof request === 'string' ? request : '', unref(opts.params || opts.query)])
|
||||||
if (!_key || typeof _key !== 'string') {
|
if (!_key || typeof _key !== 'string') {
|
||||||
throw new TypeError('[nuxt] [useFetch] key must be a string: ' + _key)
|
throw new TypeError('[nuxt] [useFetch] key must be a string: ' + _key)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user