支持数据授权管理功能

This commit is contained in:
algotao
2025-11-14 19:24:18 +08:00
parent 85f64c16b4
commit 430ce87959
11 changed files with 867 additions and 224 deletions

View File

@@ -26,6 +26,9 @@ const (
scriptUsePath = "/saas/script/use"
expListPath = "/saas/exp/list"
expGetPath = "/saas/exp/get"
grantListPath = "/saas/grant/list"
grantAddPath = "/saas/grant/add"
grantDeletePath = "/saas/grant/delete"
)
type Auth struct {
@@ -59,6 +62,9 @@ type ApiUrls struct {
ScriptUsePath string
ExpListPath string
ExpGetPath string
GrantListPath string
GrantAddPath string
GrantDeletePath string
}
func InitAPIUrl(c *ApiUrls) *ApiUrls {
@@ -198,5 +204,23 @@ func InitAPIUrl(c *ApiUrls) *ApiUrls {
r.ExpGetPath = expGetPath
}
if c.GrantListPath != "" {
r.GrantListPath = c.GrantListPath
} else {
r.GrantListPath = grantListPath
}
if c.GrantAddPath != "" {
r.GrantAddPath = c.GrantAddPath
} else {
r.GrantAddPath = grantAddPath
}
if c.GrantDeletePath != "" {
r.GrantDeletePath = c.GrantDeletePath
} else {
r.GrantDeletePath = grantDeletePath
}
return r
}