|
|
@ -3,7 +3,6 @@ package sysCloud |
|
|
|
import ( |
|
|
|
"GoClouds/cloud" |
|
|
|
"GoClouds/service/userService" |
|
|
|
gocloud "github.com/mgr9525/go-cloud" |
|
|
|
ruisUtil "github.com/mgr9525/go-ruisutil" |
|
|
|
"gopkg.in/macaron.v1" |
|
|
|
) |
|
|
@ -13,9 +12,9 @@ func ClearCache(key string) (rb bool) { |
|
|
|
rb = false |
|
|
|
}) |
|
|
|
|
|
|
|
pers := gocloud.GetNewMaps() |
|
|
|
pers["key"] = key |
|
|
|
code, _, err := cloud.SysCloudExec.ExecJSON("/comm/clearCache", &pers) |
|
|
|
pars := ruisUtil.NewMap() |
|
|
|
pars.Set("key", key) |
|
|
|
code, _, err := cloud.SysCloudExec.ExecJSON("/comm/clearCache", pars) |
|
|
|
if err != nil { |
|
|
|
return false |
|
|
|
} |
|
|
@ -29,9 +28,9 @@ func ClearUserCache(uid string) (rb bool) { |
|
|
|
rb = false |
|
|
|
}) |
|
|
|
|
|
|
|
pers := gocloud.GetNewMaps() |
|
|
|
pers["uid"] = uid |
|
|
|
code, _, err := cloud.SysCloudExec.ExecJSON("/comm/clearUserCache", &pers) |
|
|
|
pars := ruisUtil.NewMap() |
|
|
|
pars.Set("uid", uid) |
|
|
|
code, _, err := cloud.SysCloudExec.ExecJSON("/comm/clearUserCache", pars) |
|
|
|
if err != nil { |
|
|
|
return false |
|
|
|
} |
|
|
@ -45,10 +44,10 @@ func CheckPermission(uid, perm string) (rb bool) { |
|
|
|
rb = false |
|
|
|
}) |
|
|
|
|
|
|
|
pers := gocloud.GetNewMaps() |
|
|
|
pers["uid"] = uid |
|
|
|
pers["perm"] = perm |
|
|
|
code, cont, err := cloud.SysCloudExec.ExecJSON("/comm/checkPermission", &pers) |
|
|
|
pars := ruisUtil.NewMap() |
|
|
|
pars.Set("uid", uid) |
|
|
|
pars.Set("perm", perm) |
|
|
|
code, cont, err := cloud.SysCloudExec.ExecJSON("/comm/checkPermission", pars) |
|
|
|
if err != nil { |
|
|
|
return false |
|
|
|
} |
|
|
@ -70,9 +69,9 @@ func CheckUPermission(perm string, c *macaron.Context) (rb bool) { |
|
|
|
|
|
|
|
func GetUserPerms(uid string) map[string]bool { |
|
|
|
ret := make(map[string]bool) |
|
|
|
pers := gocloud.GetNewMaps() |
|
|
|
pers["uid"] = uid |
|
|
|
err := cloud.SysCloudExec.ExecObjJSON("/comm/getUserPerms", &pers, &ret) |
|
|
|
pars := ruisUtil.NewMap() |
|
|
|
pars.Set("uid", uid) |
|
|
|
err := cloud.SysCloudExec.ExecObjJSON("/comm/getUserPerms", pars, &ret) |
|
|
|
if err != nil { |
|
|
|
println("getUserPerms err:" + err.Error()) |
|
|
|
return ret |
|
|
|