Feat: admin dashboard homepage

This commit is contained in:
HFO4
2020-02-23 10:19:13 +08:00
parent 49f784104e
commit 31d4a0e1c2
9 changed files with 142 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package hashid
import (
"errors"
"github.com/HFO4/cloudreve/bootstrap/constant"
"github.com/HFO4/cloudreve/pkg/conf"
)
import "github.com/speps/go-hashids"
@@ -61,7 +62,7 @@ func HashID(id uint, t int) string {
// DecodeHashID 计算HashID对应的数据库ID
func DecodeHashID(id string, t int) (uint, error) {
v, _ := HashDecode(id)
if len(v) != 2 || v[1] != t {
if len(v) != 2 || v[1] != constant.HashIDTable[t] {
return 0, ErrTypeNotMatch
}
return uint(v[0]), nil