42 lines
846 B
Go
42 lines
846 B
Go
package models
|
|
|
|
import (
|
|
"errors"
|
|
"os"
|
|
)
|
|
|
|
const (
|
|
GinContextLog = "log"
|
|
GinContextChannel = "channel"
|
|
GinContextServerId = "serverid"
|
|
GinContextUnis = "unis"
|
|
GinContextExpire = "expire"
|
|
GinContextUnisHttpReq = "unis_http_req"
|
|
)
|
|
|
|
const (
|
|
GinAuthorKey = "Authorization"
|
|
GinAuthorPrefixKey = "Bearer "
|
|
)
|
|
|
|
var (
|
|
ErrorInvalidData = errors.New("no such value")
|
|
ErrorPasswordErr = errors.New("user or password invalid")
|
|
ErrorSqlInitErr = errors.New("database init err")
|
|
ErrorSendTimeOut = errors.New("send time out")
|
|
ErrorReciveTimeOut = errors.New("recive time out")
|
|
ErrorParamsErr = errors.New("invalid params")
|
|
)
|
|
|
|
const (
|
|
FileLoginHtml = "./static/login.html"
|
|
)
|
|
|
|
var AdminPassword = os.Getenv("ADMIN_PASSWORD")
|
|
|
|
func init() {
|
|
if AdminPassword == "" {
|
|
AdminPassword = "admin@123"
|
|
}
|
|
}
|