|
@@ -86,6 +86,25 @@ func main() {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
r.POST("/admin/popup", func(ctx *gin.Context) {
|
|
r.POST("/admin/popup", func(ctx *gin.Context) {
|
|
|
|
|
+
|
|
|
|
|
+ user, ok := eng.User(ctx)
|
|
|
|
|
+
|
|
|
|
|
+ if !ok {
|
|
|
|
|
+ ctx.JSON(http.StatusOK, gin.H{
|
|
|
|
|
+ "code": 401,
|
|
|
|
|
+ "msg": "auth fail",
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if !user.CheckPermission("*") {
|
|
|
|
|
+ //ctx.JSON(http.StatusOK, gin.H{
|
|
|
|
|
+ // "code": 401,
|
|
|
|
|
+ // "msg": "没有权限",
|
|
|
|
|
+ //})
|
|
|
|
|
+ //return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
ctx.JSON(http.StatusOK, gin.H{
|
|
ctx.JSON(http.StatusOK, gin.H{
|
|
|
"code": 0,
|
|
"code": 0,
|
|
|
"data": "<h2>hello world</h2>",
|
|
"data": "<h2>hello world</h2>",
|