MCPcopy Index your code
hub / github.com/TruthHun/BookStack / Users

Method Users

controllers/ManagerController.go:86–123  ·  view source on GitHub ↗

用户列表.

()

Source from the content-addressed store, hash-verified

84
85// 用户列表.
86func (this *ManagerController) Users() {
87 this.TplName = "manager/users.html"
88 this.Data["IsUsers"] = true
89 wd := this.GetString("wd")
90 role, err := this.GetInt("role")
91 if err != nil {
92 role = -1
93 }
94 pageIndex, _ := this.GetInt("page", 0)
95 this.GetSeoByPage("manage_users", map[string]string{
96 "title": "用户管理 - " + this.Sitename,
97 "keywords": "用户管理",
98 "description": this.Sitename + "专注于文档在线写作、协作、分享、阅读与托管,让每个人更方便地发布、分享和获得知识。",
99 })
100
101 members, totalCount, err := models.NewMember().FindToPager(pageIndex, conf.PageSize, wd, role)
102
103 if err != nil {
104 this.Data["ErrorMessage"] = err.Error()
105 return
106 }
107
108 if totalCount > 0 {
109 this.Data["PageHtml"] = utils.NewPaginations(conf.RollPage, int(totalCount), conf.PageSize, pageIndex, beego.URLFor("ManagerController.Users"), "")
110 } else {
111 this.Data["PageHtml"] = ""
112 }
113
114 b, err := json.Marshal(members)
115
116 if err != nil {
117 this.Data["Result"] = template.JS("[]")
118 } else {
119 this.Data["Result"] = template.JS(string(b))
120 }
121 this.Data["Role"] = role
122 this.Data["Wd"] = wd
123}
124
125// 标签管理.
126func (this *ManagerController) Tags() {

Callers

nothing calls this directly

Calls 5

NewMemberFunction · 0.92
NewPaginationsFunction · 0.92
stringFunction · 0.85
GetSeoByPageMethod · 0.80
FindToPagerMethod · 0.45

Tested by

no test coverage detected