{"action":"closed","issue":{"url":"https://api.github.com/repos/umijs/umi/issues/643","repository_url":"https://api.github.com/repos/umijs/umi","labels_url":"https://api.github.com/repos/umijs/umi/issues/643/labels{/name}","comments_url":"https://api.github.com/repos/umijs/umi/issues/643/comments","events_url":"https://api.github.com/repos/umijs/umi/issues/643/events","html_url":"https://github.com/umijs/umi/issues/643","id":333900629,"node_id":"MDU6SXNzdWUzMzM5MDA2Mjk=","number":643,"title":".umirc.js中配置全局context无效","user":{"login":"NexxLuo","id":18549980,"node_id":"MDQ6VXNlcjE4NTQ5OTgw","avatar_url":"https://avatars3.githubusercontent.com/u/18549980?v=4","gravatar_id":"","url":"https://api.github.com/users/NexxLuo","html_url":"https://github.com/NexxLuo","followers_url":"https://api.github.com/users/NexxLuo/followers","following_url":"https://api.github.com/users/NexxLuo/following{/other_user}","gists_url":"https://api.github.com/users/NexxLuo/gists{/gist_id}","starred_url":"https://api.github.com/users/NexxLuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NexxLuo/subscriptions","organizations_url":"https://api.github.com/users/NexxLuo/orgs","repos_url":"https://api.github.com/users/NexxLuo/repos","events_url":"https://api.github.com/users/NexxLuo/events{/privacy}","received_events_url":"https://api.github.com/users/NexxLuo/received_events","type":"User","site_admin":false},"labels":[{"id":757946808,"node_id":"MDU6TGFiZWw3NTc5NDY4MDg=","url":"https://api.github.com/repos/umijs/umi/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/umijs/umi/milestones/2","html_url":"https://github.com/umijs/umi/milestone/2","labels_url":"https://api.github.com/repos/umijs/umi/milestones/2/labels","id":3441299,"node_id":"MDk6TWlsZXN0b25lMzQ0MTI5OQ==","number":2,"title":"umi@2.0","description":"","creator":{"login":"sorrycc","id":35128,"node_id":"MDQ6VXNlcjM1MTI4","avatar_url":"https://avatars1.githubusercontent.com/u/35128?v=4","gravatar_id":"","url":"https://api.github.com/users/sorrycc","html_url":"https://github.com/sorrycc","followers_url":"https://api.github.com/users/sorrycc/followers","following_url":"https://api.github.com/users/sorrycc/following{/other_user}","gists_url":"https://api.github.com/users/sorrycc/gists{/gist_id}","starred_url":"https://api.github.com/users/sorrycc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sorrycc/subscriptions","organizations_url":"https://api.github.com/users/sorrycc/orgs","repos_url":"https://api.github.com/users/sorrycc/repos","events_url":"https://api.github.com/users/sorrycc/events{/privacy}","received_events_url":"https://api.github.com/users/sorrycc/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":6,"state":"open","created_at":"2018-06-21T08:24:20Z","updated_at":"2018-08-17T10:01:16Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2018-06-20T02:16:45Z","updated_at":"2018-08-17T10:01:16Z","closed_at":"2018-08-17T10:01:16Z","author_association":"NONE","body":"1. umirc.js中配置全局context\r\n![qq 20180620101001](https://user-images.githubusercontent.com/18549980/41633561-1dda01a4-7472-11e8-9f1d-04425b0a9fb5.png)\r\n\r\n2.document.ejs使用context\r\n![qq 20180620101119](https://user-images.githubusercontent.com/18549980/41633616-4f3ba02c-7472-11e8-8e3c-7cb84a27ff36.png)\r\n\r\n3.生成的html中并没有context中设置的值\r\n![qq 20180620101155](https://user-images.githubusercontent.com/18549980/41633642-61dede7e-7472-11e8-8b1f-56c44851f0f2.png)\r\n\r\n4.更改umirc.js 加上pages的context配置 ， html正常显示\r\n![qq 20180620101400](https://user-images.githubusercontent.com/18549980/41633706-b5c97116-7472-11e8-81cb-618aba555e95.png)\r\n \r\n 结论：使用全局context时，必须在pages中对各个路由进行context设置，如若不设置，全局context将不     生效\r\n\r\n"}}
{"actor":{"display_login":"sorrycc"}}