Node.js/nuxt/plugin参数
来自康健生活
context
const context = { 16:08:01
isStatic: false,
isDev: true,
isHMR: false,
app: <ref *1> {
head: {
title: 'askgo',
meta: [Array],
link: [Array],
style: [],
script: []
},
store: Store {
_committing: false,
_actions: [Object: null prototype],
_actionSubscribers: [],
_mutations: [Object: null prototype],
_wrappedGetters: [Object: null prototype] {},
_modules: [ModuleCollection],
_modulesNamespaceMap: [Object: null prototype],
_subscribers: [],
_watcherVM: [Vue],
_makeLocalGettersCache: [Object: null prototype] {},
dispatch: [Function: boundDispatch],
commit: [Function: boundCommit],
strict: true,
getters: {},
_vm: [Vue],
'$router': [VueRouter],
registerModule: [Function (anonymous)],
app: [Circular *1],
'$config': {},
'$cookies': [Object],
'$axios': [Function]
},
router: VueRouter {
app: null,
apps: [],
options: [Object],
beforeHooks: [],
resolveHooks: [],
afterHooks: [],
matcher: [Object],
fallback: true,
mode: 'abstract',
history: [AbstractHistory]
},
nuxt: {
defaultTransition: [Object],
transitions: [Array],
setTransitions: [Function: setTransitions],
err: null,
dateErr: null,
error: [Function: error]
},
render: [Function: render],
data: [Function: data],
beforeCreate: [Function: beforeCreate],
created: [Function: created],
mounted: [AsyncFunction: mounted],
watch: {
'nuxt.err': 'errorChanged'
},
computed: {
isOffline: [Function: isOffline],
isFetching: [Function: isFetching]
},
methods: {
refreshOnlineStatus: [Function: refreshOnlineStatus],
refresh: [AsyncFunction: refresh],
errorChanged: [Function: errorChanged],
setLayout: [Function: setLayout],
loadLayout: [Function: loadLayout]
},
components: {
NuxtLoading: [Object]
},
context: [Circular *2],
'$config': {},
'$cookies': {
parseJSON: true,
set: [Function: set],
setAll: [Function: setAll],
get: [Function: get],
getAll: [Function: getAll],
remove: [Function: remove],
removeAll: [Function: removeAll],
nodeCookie: [Object]
},
'$axios': [Function: wrap] {
request: [Function: wrap],
getUri: [Function: wrap],
delete: [Function: wrap],
get: [Function: wrap],
head: [Function: wrap],
options: [Function: wrap],
post: [Function: wrap],
put: [Function: wrap],
patch: [Function: wrap],
defaults: [Object],
interceptors: [Object],
CancelToken: [Function],
isCancel: [Function: isCancel],
setBaseURL: [Function: bound setBaseURL],
setHeader: [Function: bound setHeader],
setToken: [Function: bound setToken],
onRequest: [Function: bound onRequest],
onResponse: [Function: bound onResponse],
onRequestError: [Function: bound onRequestError],
onResponseError: [Function: bound onResponseError],
onError: [Function: bound onError],
create: [Function: bound create],
'$request': [Function: bound ],
'$delete': [Function: bound ],
'$get': [Function: bound ],
'$head': [Function: bound ],
'$options': [Function: bound ],
'$post': [Function: bound ],
'$put': [Function: bound ],
'$patch': [Function: bound ]
}
},
store: <ref *5> Store {
_committing: false,
_actions: [Object: null prototype] {
nuxtServerInit: [Array],
'user/setToken': [Array],
'user/deleteToken': [Array]
},
_actionSubscribers: [],
_mutations: [Object: null prototype] {
'user/updateToken': [Array],
'user/deleteToken': [Array],
'user/getToken': [Array]
},
_wrappedGetters: [Object: null prototype] {},
_modules: ModuleCollection {
root: [Module]
},
_modulesNamespaceMap: [Object: null prototype] {
'user/': [Module]
},
_subscribers: [],
_watcherVM: <ref *3> Vue {
_uid: 5754,
_isVue: true,
'$options': [Object],
_renderProxy: [Circular *3],
_self: [Circular *3],
'$parent': undefined,
'$root': [Circular *3],
'$children': [],
'$refs': {},
_watcher: null,
_inactive: null,
_directInactive: false,
_isMounted: false,
_isDestroyed: false,
_isBeingDestroyed: false,
_events: [Object: null prototype],
_hasHookEvent: true,
_vnode: null,
_staticTrees: null,
'$vnode': undefined,
'$slots': {},
'$scopedSlots': {},
_c: [Function (anonymous)],
'$createElement': [Function (anonymous)],
'$attrs': [Getter/Setter],
'$listeners': [Getter/Setter],
_routerRoot: [Circular *3],
_watchers: [],
_data: {}
},
_makeLocalGettersCache: [Object: null prototype] {},
dispatch: [Function: boundDispatch],
commit: [Function: boundCommit],
strict: true,
getters: {},
_vm: <ref *4> Vue {
_uid: 5755,
_isVue: true,
'$options': [Object],
_renderProxy: [Circular *4],
_self: [Circular *4],
'$parent': undefined,
'$root': [Circular *4],
'$children': [],
'$refs': {},
_watcher: null,
_inactive: null,
_directInactive: false,
_isMounted: false,
_isDestroyed: false,
_isBeingDestroyed: false,
_events: [Object: null prototype],
_hasHookEvent: true,
_vnode: null,
_staticTrees: null,
'$vnode': undefined,
'$slots': {},
'$scopedSlots': {},
_c: [Function (anonymous)],
'$createElement': [Function (anonymous)],
'$attrs': [Getter/Setter],
'$listeners': [Getter/Setter],
_routerRoot: [Circular *4],
_watchers: [Array],
_data: [Object],
_computedWatchers: [Object: null prototype] {}
},
'$router': VueRouter {
app: null,
apps: [],
options: [Object],
beforeHooks: [],
resolveHooks: [],
afterHooks: [],
matcher: [Object],
fallback: true,
mode: 'abstract',
history: [AbstractHistory]
},
registerModule: [Function (anonymous)],
app: <ref *1> {
head: [Object],
store: [Circular *5],
router: [VueRouter],
nuxt: [Object],
render: [Function: render],
data: [Function: data],
beforeCreate: [Function: beforeCreate],
created: [Function: created],
mounted: [AsyncFunction: mounted],
watch: [Object],
computed: [Object],
methods: [Object],
components: [Object],
context: [Circular *2],
'$config': {},
'$cookies': [Object],
'$axios': [Function]
},
'$config': {},
'$cookies': {
parseJSON: true,
set: [Function: set],
setAll: [Function: setAll],
get: [Function: get],
getAll: [Function: getAll],
remove: [Function: remove],
removeAll: [Function: removeAll],
nodeCookie: [Object]
},
'$axios': [Function: wrap] {
request: [Function: wrap],
getUri: [Function: wrap],
delete: [Function: wrap],
get: [Function: wrap],
head: [Function: wrap],
options: [Function: wrap],
post: [Function: wrap],
put: [Function: wrap],
patch: [Function: wrap],
defaults: [Object],
interceptors: [Object],
CancelToken: [Function],
isCancel: [Function: isCancel],
setBaseURL: [Function: bound setBaseURL],
setHeader: [Function: bound setHeader],
setToken: [Function: bound setToken],
onRequest: [Function: bound onRequest],
onResponse: [Function: bound onResponse],
onRequestError: [Function: bound onRequestError],
onResponseError: [Function: bound onResponseError],
onError: [Function: bound onError],
create: [Function: bound create],
'$request': [Function: bound ],
'$delete': [Function: bound ],
'$get': [Function: bound ],
'$head': [Function: bound ],
'$options': [Function: bound ],
'$post': [Function: bound ],
'$put': [Function: bound ],
'$patch': [Function: bound ]
}
},
payload: undefined,
error: [Function: bound error],
base: '/',
env: {
host: {
proxyTable: [Object],
staticHost: '/_nuxt/',
cloudStaticHost: 'http://static.askgo.cn'
},
target: 'development'
},
// 服务端
req: IncomingMessage {
_readableState: ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList {
head: null,
tail: null,
length: 0
},
length: 0,
pipes: [],
flowing: null,
ended: true,
endEmitted: false,
reading: false,
sync: true,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
errorEmitted: false,
emitClose: true,
autoDestroy: false,
destroyed: false,
errored: false,
closed: false,
closeEmitted: false,
defaultEncoding: 'utf8',
awaitDrainWriters: null,
multiAwaitDrain: false,
readingMore: true,
decoder: null,
encoding: null,
[Symbol(kPaused)]: null
},
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
socket: Socket {
connecting: false,
_hadError: false,
_parent: null,
_host: null,
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 8,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: [Server],
_server: [Server],
parser: [HTTPParser],
on: [Function: socketListenerWrap],
addListener: [Function: socketListenerWrap],
prependListener: [Function: socketListenerWrap],
_paused: false,
_peername: [Object],
_httpMessage: [ServerResponse],
timeout: 0,
[Symbol(async_id_symbol)]: 1083605,
[Symbol(kHandle)]: [TCP],
[Symbol(kSetNoDelay)]: false,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: Timeout {
_idleTimeout: -1,
_idlePrev: null,
_idleNext: null,
_idleStart: 3422848,
_onTimeout: null,
_timerArgs: undefined,
_repeat: null,
_destroyed: true,
[Symbol(refed)]: false,
[Symbol(asyncId)]: 1083622,
[Symbol(triggerId)]: 1083619
},
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0
},
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
headers: {
host: 'www.localhost:3000',
connection: 'keep-alive',
'cache-control': 'max-age=0',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36',
accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'sec-fetch-site': 'same-origin',
'sec-fetch-mode': 'navigate',
'sec-fetch-dest': 'document',
referer: 'http://www.localhost:3000/',
'accept-encoding': 'gzip, deflate, br',
'accept-language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
cookie: 'Hm_lvt_883208f81c64cde5a981eee0d6da1be2=1596420512,1596697808'
},
rawHeaders: [
'Host',
'www.localhost:3000',
'Connection',
'keep-alive',
'Cache-Control',
'max-age=0',
'Upgrade-Insecure-Requests',
'1',
'User-Agent',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36',
'Accept',
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'Sec-Fetch-Site',
'same-origin',
'Sec-Fetch-Mode',
'navigate',
'Sec-Fetch-Dest',
'document',
'Referer',
'http://www.localhost:3000/',
'Accept-Encoding',
'gzip, deflate, br',
'Accept-Language',
'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
'Cookie',
'Hm_lvt_883208f81c64cde5a981eee0d6da1be2=1596420512,1596697808'
],
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: '/',
method: 'GET',
statusCode: null,
statusMessage: null,
client: Socket {
connecting: false,
_hadError: false,
_parent: null,
_host: null,
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 8,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: [Server],
_server: [Server],
parser: [HTTPParser],
on: [Function: socketListenerWrap],
addListener: [Function: socketListenerWrap],
prependListener: [Function: socketListenerWrap],
_paused: false,
_peername: [Object],
_httpMessage: [ServerResponse],
timeout: 0,
[Symbol(async_id_symbol)]: 1083605,
[Symbol(kHandle)]: [TCP],
[Symbol(kSetNoDelay)]: false,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: Timeout {
_idleTimeout: -1,
_idlePrev: null,
_idleNext: null,
_idleStart: 3422848,
_onTimeout: null,
_timerArgs: undefined,
_repeat: null,
_destroyed: true,
[Symbol(refed)]: false,
[Symbol(asyncId)]: 1083622,
[Symbol(triggerId)]: 1083619
},
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0
},
_consuming: false,
_dumped: false,
originalUrl: '/',
_parsedUrl: Url {
protocol: null,
slashes: null,
auth: null,
host: null,
port: null,
hostname: null,
hash: null,
search: null,
query: null,
pathname: '/',
path: '/',
href: '/',
_raw: '/'
},
_parsedOriginalUrl: Url {
protocol: null,
slashes: null,
auth: null,
host: null,
port: null,
hostname: null,
hash: null,
search: null,
query: null,
pathname: '/',
path: '/',
href: '/',
_raw: '/'
},
[Symbol(kCapture)]: false
},
res: <ref *6> ServerResponse {
_events: [Object: null prototype] {
finish: [Function: bound resOnFinish]
},
_eventsCount: 1,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: false,
chunkedEncoding: false,
shouldKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: true,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: false,
_headerSent: false,
socket: Socket {
connecting: false,
_hadError: false,
_parent: null,
_host: null,
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 8,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: [Server],
_server: [Server],
parser: [HTTPParser],
on: [Function: socketListenerWrap],
addListener: [Function: socketListenerWrap],
prependListener: [Function: socketListenerWrap],
_paused: false,
_peername: [Object],
_httpMessage: [Circular *6],
timeout: 0,
[Symbol(async_id_symbol)]: 1083605,
[Symbol(kHandle)]: [TCP],
[Symbol(kSetNoDelay)]: false,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: Timeout {
_idleTimeout: -1,
_idlePrev: null,
_idleNext: null,
_idleStart: 3422848,
_onTimeout: null,
_timerArgs: undefined,
_repeat: null,
_destroyed: true,
[Symbol(refed)]: false,
[Symbol(asyncId)]: 1083622,
[Symbol(triggerId)]: 1083619
},
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0
},
_header: null,
_onPendingData: [Function: bound updateOutgoingData],
_sent100: false,
_expect_continue: false,
timing: ServerTiming {
_times: [Map],
headers: []
},
writeHead: [Function: writeHead],
locals: {},
statusCode: 200,
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: null
},
ssrContext: {
req: IncomingMessage {
_readableState: [ReadableState],
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
socket: [Socket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
headers: [Object],
rawHeaders: [Array],
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: '/',
method: 'GET',
statusCode: null,
statusMessage: null,
client: [Socket],
_consuming: false,
_dumped: false,
originalUrl: '/',
_parsedUrl: [Url],
_parsedOriginalUrl: [Url],
[Symbol(kCapture)]: false
},
res: <ref *6> ServerResponse {
_events: [Object: null prototype],
_eventsCount: 1,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: false,
chunkedEncoding: false,
shouldKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: true,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: false,
_headerSent: false,
socket: [Socket],
_header: null,
_onPendingData: [Function: bound updateOutgoingData],
_sent100: false,
_expect_continue: false,
timing: [ServerTiming],
writeHead: [Function: writeHead],
locals: {},
statusCode: 200,
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: null
},
url: '/',
target: 'server',
spa: undefined,
modern: false,
runtimeConfig: {
private: {},
public: {}
},
_registeredComponents: Set(0) {},
styles: [Getter],
_renderStyles: [Function: renderStyles],
_styles: {
'd747ab1e:0': [Object],
'6003b226:0': [Object],
'46535c94:0': [Object],
'7f914dc6:0': [Object]
},
redirected: false,
next: [Function (anonymous)],
beforeRenderFns: [],
nuxt: {
layout: 'default',
data: [],
fetch: [],
error: null,
state: null,
serverRendered: true,
routePath: '',
config: {}
}
},
redirect: [Function (anonymous)],
beforeNuxtRender: [Function (anonymous)],
// 服务端
route: {
name: null,
meta: [],
path: '/',
hash: '',
query: {},
params: {},
fullPath: '/',
matched: []
},
next: [Function (anonymous)],
_redirected: false,
_errored: false,
params: {},
query: {},
'$config': {},
'$cookies': {
parseJSON: true,
set: [Function: set],
setAll: [Function: setAll],
get: [Function: get],
getAll: [Function: getAll],
remove: [Function: remove],
removeAll: [Function: removeAll],
nodeCookie: {
parse: [Function: o],
serialize: [Function: n]
}
},
'$axios': [Function: wrap] {
request: [Function: wrap],
getUri: [Function: wrap],
delete: [Function: wrap],
get: [Function: wrap],
head: [Function: wrap],
options: [Function: wrap],
post: [Function: wrap],
put: [Function: wrap],
patch: [Function: wrap],
defaults: {
headers: [Object],
baseURL: 'http://localhost:3000/',
transformRequest: [Array],
transformResponse: [Array],
timeout: 0,
adapter: [Function: httpAdapter],
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: [Function: validateStatus]
},
interceptors: {
request: [InterceptorManager],
response: [InterceptorManager]
},
CancelToken: [Function: CancelToken] {
source: [Function: source]
},
isCancel: [Function: isCancel],
setBaseURL: [Function: bound setBaseURL],
setHeader: [Function: bound setHeader],
setToken: [Function: bound setToken],
onRequest: [Function: bound onRequest],
onResponse: [Function: bound onResponse],
onRequestError: [Function: bound onRequestError],
onResponseError: [Function: bound onResponseError],
onError: [Function: bound onError],
create: [Function: bound create],
'$request': [Function: bound ],
'$delete': [Function: bound ],
'$get': [Function: bound ],
'$head': [Function: bound ],
'$options': [Function: bound ],
'$post': [Function: bound ],
'$put': [Function: bound ],
'$patch': [Function: bound ]
}
}
No categories