mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
ctx => app.context
This commit is contained in:
parent
aefa9f8c31
commit
5384ee1a5c
@ -125,7 +125,7 @@ export async function setContext(app, context) {
|
|||||||
if (context.res) app.context.res = context.res
|
if (context.res) app.context.res = context.res
|
||||||
app.context.redirect = function (status, path, query) {
|
app.context.redirect = function (status, path, query) {
|
||||||
if (!status) return
|
if (!status) return
|
||||||
ctx._redirected = true // Used in middleware
|
app.context._redirected = true // Used in middleware
|
||||||
// if only 1 or 2 arguments: redirect('/') or redirect('/', { foo: 'bar' })
|
// if only 1 or 2 arguments: redirect('/') or redirect('/', { foo: 'bar' })
|
||||||
if (typeof status === 'string' && (typeof path === 'undefined' || typeof path === 'object')) {
|
if (typeof status === 'string' && (typeof path === 'undefined' || typeof path === 'object')) {
|
||||||
query = path || {}
|
query = path || {}
|
||||||
|
Loading…
Reference in New Issue
Block a user