用户库
This commit is contained in:
parent
9664a7cada
commit
8eb51f5cc4
|
@ -5,5 +5,5 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello, 世界")1
|
||||
fmt.Println("Hello, daniel")
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package file
|
|||
import (
|
||||
"encoding/json"
|
||||
"github.com/b3log/wide/conf"
|
||||
"github.com/b3log/wide/session"
|
||||
"github.com/golang/glog"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
@ -13,9 +14,17 @@ import (
|
|||
)
|
||||
|
||||
func GetFiles(w http.ResponseWriter, r *http.Request) {
|
||||
session, _ := session.Store.Get(r, "wide-session")
|
||||
|
||||
username := session.Values["name"].(string)
|
||||
|
||||
glog.Info(username)
|
||||
|
||||
userRepos := strings.Replace(conf.Wide.UserRepos, "{user}", username, -1)
|
||||
|
||||
data := map[string]interface{}{"succ": true}
|
||||
|
||||
root := FileNode{"projects", conf.Wide.Repos, "d", []*FileNode{}}
|
||||
root := FileNode{"projects", userRepos, "d", []*FileNode{}}
|
||||
fileInfo, _ := os.Lstat(conf.Wide.Repos)
|
||||
|
||||
walk(conf.Wide.Repos, fileInfo, &root)
|
||||
|
|
Loading…
Reference in New Issue