{"action":"created","issue":{"url":"https://api.github.com/repos/jawil/GayHub/issues/37","repository_url":"https://api.github.com/repos/jawil/GayHub","labels_url":"https://api.github.com/repos/jawil/GayHub/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/jawil/GayHub/issues/37/comments","events_url":"https://api.github.com/repos/jawil/GayHub/issues/37/events","html_url":"https://github.com/jawil/GayHub/issues/37","id":264183696,"number":37,"title":"不能加载私有仓库的文件树","user":{"login":"Rocket1184","id":13914967,"avatar_url":"https://avatars3.githubusercontent.com/u/13914967?v=4","gravatar_id":"","url":"https://api.github.com/users/Rocket1184","html_url":"https://github.com/Rocket1184","followers_url":"https://api.github.com/users/Rocket1184/followers","following_url":"https://api.github.com/users/Rocket1184/following{/other_user}","gists_url":"https://api.github.com/users/Rocket1184/gists{/gist_id}","starred_url":"https://api.github.com/users/Rocket1184/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rocket1184/subscriptions","organizations_url":"https://api.github.com/users/Rocket1184/orgs","repos_url":"https://api.github.com/users/Rocket1184/repos","events_url":"https://api.github.com/users/Rocket1184/events{/privacy}","received_events_url":"https://api.github.com/users/Rocket1184/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-10-10T10:54:11Z","updated_at":"2017-10-12T14:54:55Z","closed_at":null,"author_association":"NONE","body":"因为私有仓库需要 access token 才能访问的到，所以会出现错误。\r\n\r\n另外，[buunguyen/octotree](https://github.com/buunguyen/octotree) 这个插件，是可以通过配置 access token 来访问私有仓库的\r\n\r\n## 控制台输出\r\n\r\n```\r\nGET https://api.github.com/repos/<user>/<repo>/git/trees/master?recursive=1 404 (Not Found)\r\n\r\nUncaught (in promise) TypeError: Cannot read property 'length' of undefined    sideBarHelp.js?1f7b:217\r\n    at generateCurrentTreeDOM (sideBarHelp.js?1f7b:217)\r\n    at initDOM (sideBarHelp.js?1f7b:91)\r\n    at eval (sidebarNav.js?c5dc:34)\r\n    at <anonymous>\r\n\r\ngenerateCurrentTreeDOM | @ | sideBarHelp.js?1f7b:217\r\ninitDOM | @ | sideBarHelp.js?1f7b:91\r\n(anonymous) | @ | sidebarNav.js?c5dc:34\r\nPromise resolved (async) |   |  \r\n(anonymous) | @ | sidebarNav.js?c5dc:32\r\nmodule.exports | @ | sidebarNav.js?c5dc:40\r\n(anonymous) | @ | index.js?1fdf:19\r\n(anonymous) | @ | contentscript.js:409\r\n__webpack_require__ | @ | contentscript.js:20\r\n(anonymous) | @ | contentscript.js:63\r\n(anonymous) | @ | contentscript.js:66\r\n```\r\n\r\n## 报错代码位置\r\n\r\n```js\r\n/**\r\n * 递归生成当前文件树下面所有的DOM结构 \r\n * @param {*当前目录所有的文件} CurrentTreeFiles \r\n * @param {*DOM的根节点} parent \r\n * @param {*当前层级，点击一下递归再生成两层目录} cascad \r\n * @param {*github接口返回的所有文件树} files \r\n */\r\n\r\nconst generateCurrentTreeDOM = function(\r\n  CurrentTreeFiles,\r\n  parent,\r\n  cascad,\r\n  files\r\n) {\r\n  if (!CurrentTreeFiles.length) {  // <- 错误定位在这一行\r\n    return;\r\n  }\r\n\r\n  /* 重新渲染Pjax */\r\n  new Pjax({\r\n    elements: \"a[data-href],a[id],a[type],span.js-path-segment>a\",\r\n    selectors: [\r\n      \"#js-repo-pjax-container\",\r\n      \".context-loader-container\",\r\n      \"[data-pjax-container]\"\r\n    ]\r\n  });\r\n```"},"comment":{"url":"https://api.github.com/repos/jawil/GayHub/issues/comments/336162842","html_url":"https://github.com/jawil/GayHub/issues/37#issuecomment-336162842","issue_url":"https://api.github.com/repos/jawil/GayHub/issues/37","id":336162842,"user":{"login":"ZHENGGEGE","id":20240270,"avatar_url":"https://avatars3.githubusercontent.com/u/20240270?v=4","gravatar_id":"","url":"https://api.github.com/users/ZHENGGEGE","html_url":"https://github.com/ZHENGGEGE","followers_url":"https://api.github.com/users/ZHENGGEGE/followers","following_url":"https://api.github.com/users/ZHENGGEGE/following{/other_user}","gists_url":"https://api.github.com/users/ZHENGGEGE/gists{/gist_id}","starred_url":"https://api.github.com/users/ZHENGGEGE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZHENGGEGE/subscriptions","organizations_url":"https://api.github.com/users/ZHENGGEGE/orgs","repos_url":"https://api.github.com/users/ZHENGGEGE/repos","events_url":"https://api.github.com/users/ZHENGGEGE/events{/privacy}","received_events_url":"https://api.github.com/users/ZHENGGEGE/received_events","type":"User","site_admin":false},"created_at":"2017-10-12T14:54:55Z","updated_at":"2017-10-12T14:54:55Z","author_association":"NONE","body":"对对，之前装的的一个类似的插件也是不满足私有仓库，这个比之前装的更漂亮，能加载私有的就更好了"}}
{"actor":{"display_login":"ZHENGGEGE"}}