feat: assets程序内嵌全局资源访问
This commit is contained in:
@@ -147,6 +147,16 @@ func Get(key string) any {
|
||||
return viper.Get(key)
|
||||
}
|
||||
|
||||
// GetAssetsDirFS 访问程序内全局资源访问
|
||||
func GetAssetsDirFS() embed.FS {
|
||||
return viper.Get("AssetsDir").(embed.FS)
|
||||
}
|
||||
|
||||
// SetAssetsDirFS 设置程序内全局资源访问
|
||||
func SetAssetsDirFS(assetsDir embed.FS) {
|
||||
viper.Set("AssetsDir", assetsDir)
|
||||
}
|
||||
|
||||
// IsAdmin 用户是否为管理员
|
||||
func IsAdmin(userID string) bool {
|
||||
if userID == "" {
|
||||
|
||||
Reference in New Issue
Block a user