This commit is contained in:
孟帅 2023-05-14 23:55:16 +08:00
parent 1227c754d0
commit f30dbf34fa
111 changed files with 2853 additions and 1969 deletions

View File

@ -11,6 +11,11 @@
> 如果升级(覆盖)代码后打开会出现 sql 报错, 请检查更新的数据库格式或自行调整
### v2.7.3
updated 2023.05.14
- 增加:增加注册、手机号登录、二维码邀请注册功能
- 优化:优化管理员业务模块验证唯一属性接口,将登录相关功能拆分到管理员基础模块中
- 移除移除web端mock插件
### v2.6.10
updated 2023.05.12

View File

@ -189,7 +189,7 @@ func (s *sSysTable) Status(ctx context.Context, in sysin.TableStatusInp) (err er
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}

View File

@ -7,6 +7,7 @@ package common
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model"
"hotgo/internal/model/input/adminin"
)
@ -16,6 +17,15 @@ type LoginLogoutReq struct {
}
type LoginLogoutRes struct{}
// RegisterReq 提交账号注册
type RegisterReq struct {
g.Meta `path:"/site/register" method:"post" tags:"后台基础" summary:"账号注册"`
adminin.RegisterInp
}
type RegisterRes struct {
*adminin.LoginModel
}
// LoginCaptchaReq 获取登录验证码
type LoginCaptchaReq struct {
g.Meta `path:"/site/captcha" method:"get" tags:"后台基础" summary:"获取登录验证码"`
@ -25,17 +35,22 @@ type LoginCaptchaRes struct {
Base64 string `json:"base64" dc:"验证码"`
}
// LoginReq 提交登录
type LoginReq struct {
g.Meta `path:"/site/login" method:"post" tags:"后台基础" summary:"账号登录"`
Username string `json:"username" v:"required#用户名不能为空" dc:"用户名"`
Password string `json:"password" v:"required#密码不能为空" dc:"密码"`
Cid string `json:"cid" dc:"验证码ID"`
Code string `json:"code" dc:"验证码"`
IsLock bool `json:"isLock" dc:"是否为锁屏状态"`
// AccountLoginReq 提交账号登录
type AccountLoginReq struct {
g.Meta `path:"/site/accountLogin" method:"post" tags:"后台基础" summary:"账号登录"`
adminin.AccountLoginInp
}
type LoginRes struct {
*adminin.MemberLoginModel
type AccountLoginRes struct {
*adminin.LoginModel
}
// MobileLoginReq 提交手机号登录
type MobileLoginReq struct {
g.Meta `path:"/site/mobileLogin" method:"post" tags:"后台基础" summary:"手机号登录"`
adminin.MobileLoginInp
}
type MobileLoginRes struct {
*adminin.LoginModel
}
// SiteConfigReq 获取配置
@ -43,9 +58,18 @@ type SiteConfigReq struct {
g.Meta `path:"/site/config" method:"get" tags:"后台基础" summary:"获取配置"`
}
type SiteConfigRes struct {
Version string `json:"version" dc:"系统版本"`
WsAddr string `json:"wsAddr" dc:"客户端websocket地址"`
Domain string `json:"domain" dc:"对外域名"`
Version string `json:"version" dc:"系统版本"`
WsAddr string `json:"wsAddr" dc:"客户端websocket地址"`
Domain string `json:"domain" dc:"对外域名"`
//InviteUrl string `json:"inviteUrl" dc:"邀请注册地址"`
}
// SiteLoginConfigReq 获取登录配置
type SiteLoginConfigReq struct {
g.Meta `path:"/site/loginConfig" method:"get" tags:"后台基础" summary:"获取登录配置"`
}
type SiteLoginConfigRes struct {
*model.LoginConfig
}
// SitePingReq ping

View File

@ -3,7 +3,6 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package common
import "github.com/gogf/gf/v2/frame/g"
@ -24,3 +23,12 @@ type SendBindSmsReq struct {
}
type SendBindSmsRes struct {
}
// SendSmsReq 发送短信
type SendSmsReq struct {
g.Meta `path:"/sms/send" tags:"短信" method:"post" summary:"发送短信"`
Event string `json:"event" v:"required#事件模板不能为空" dc:"事件模板"`
Mobile string `json:"mobile" v:"required#接收手机号不能为空" dc:"接收手机号"`
}
type SendSmsRes struct {
}

View File

@ -53,33 +53,6 @@ type ResetPwdReq struct {
}
type ResetPwdRes struct{}
// EmailUniqueReq 邮箱是否唯一
type EmailUniqueReq struct {
g.Meta `path:"/member/emailUnique" method:"get" tags:"用户" summary:"邮箱是否唯一"`
adminin.MemberEmailUniqueInp
}
type EmailUniqueRes struct {
*adminin.MemberEmailUniqueModel
}
// MobileUniqueReq 手机号是否唯一
type MobileUniqueReq struct {
g.Meta `path:"/member/mobileUnique" method:"get" tags:"用户" summary:"手机号是否唯一"`
adminin.MemberMobileUniqueInp
}
type MobileUniqueRes struct {
*adminin.MemberMobileUniqueModel
}
// NameUniqueReq 名称是否唯一
type NameUniqueReq struct {
g.Meta `path:"/member/nameUnique" method:"get" tags:"用户" summary:"用户名称是否唯一"`
adminin.MemberNameUniqueInp
}
type NameUniqueRes struct {
*adminin.MemberNameUniqueModel
}
// ListReq 查询列表
type ListReq struct {
g.Meta `path:"/member/list" method:"get" tags:"用户" summary:"获取用户列表"`
@ -114,15 +87,6 @@ type DeleteReq struct {
}
type DeleteRes struct{}
// LoginInfoReq 获取登录用户信息
type LoginInfoReq struct {
g.Meta `path:"/member/info" method:"get" tags:"用户" summary:"获取登录用户信息" dc:"获取管理后台的登录用户信息"`
}
type LoginInfoRes struct {
*adminin.LoginMemberInfoModel
}
// StatusReq 更新用户状态
type StatusReq struct {
g.Meta `path:"/member/status" method:"post" tags:"用户" summary:"更新用户状态"`
@ -132,10 +96,18 @@ type StatusRes struct{}
// SelectReq 获取可选的后台用户选项
type SelectReq struct {
g.Meta `path:"/member/option" method:"get" summary:"用户" tags:"获取可选的后台用户选项"`
g.Meta `path:"/member/option" method:"get" tags:"用户" summary:"获取可选的后台用户选项"`
}
type SelectRes []*adminin.MemberSelectModel
// InfoReq 获取登录用户信息
type InfoReq struct {
g.Meta `path:"/member/info" method:"get" tags:"用户" summary:"获取登录用户信息"`
}
type InfoRes struct {
*adminin.LoginMemberInfoModel
}
// AddBalanceReq 增加余额
type AddBalanceReq struct {
g.Meta `path:"/member/addBalance" method:"post" tags:"用户" summary:"增加余额"`

View File

@ -3,7 +3,6 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package consts
import "github.com/gogf/gf/v2/util/gconv"
@ -13,22 +12,25 @@ var RequestEncryptKey = []byte("f080a463654b2279")
// 配置数据类型
const (
ConfigTypeString = "string"
ConfigTypeInt = "int"
ConfigTypeInt8 = "int8"
ConfigTypeInt16 = "int16"
ConfigTypeInt32 = "int32"
ConfigTypeInt64 = "int64"
ConfigTypeUint = "uint"
ConfigTypeUint8 = "uint8"
ConfigTypeUint16 = "uint16"
ConfigTypeUint32 = "uint32"
ConfigTypeUint64 = "uint64"
ConfigTypeFloat32 = "float32"
ConfigTypeFloat64 = "float64"
ConfigTypeBool = "bool"
ConfigTypeDate = "date"
ConfigTypeDateTime = "datetime"
ConfigTypeString = "string"
ConfigTypeInt = "int"
ConfigTypeInt8 = "int8"
ConfigTypeInt16 = "int16"
ConfigTypeInt32 = "int32"
ConfigTypeInt64 = "int64"
ConfigTypeUint = "uint"
ConfigTypeUint8 = "uint8"
ConfigTypeUint16 = "uint16"
ConfigTypeUint32 = "uint32"
ConfigTypeUint64 = "uint64"
ConfigTypeFloat32 = "float32"
ConfigTypeFloat64 = "float64"
ConfigTypeBool = "bool"
ConfigTypeDate = "date"
ConfigTypeDateTime = "datetime"
ConfigTypeSliceString = "[]string"
ConfigTypeSliceInt = "[]int"
ConfigTypeSliceInt64 = "[]int64"
)
var ConfigTypes = []string{ConfigTypeString,
@ -37,6 +39,7 @@ var ConfigTypes = []string{ConfigTypeString,
ConfigTypeFloat32, ConfigTypeFloat64,
ConfigTypeBool,
ConfigTypeDate, ConfigTypeDateTime,
ConfigTypeSliceString, ConfigTypeSliceInt, ConfigTypeSliceInt64,
}
// ConvType 类型转换
@ -74,6 +77,12 @@ func ConvType(val interface{}, t string) interface{} {
val = gconv.Time(val, "Y-m-d")
case ConfigTypeDateTime:
val = gconv.Time(val, "Y-m-d H:i:s")
case ConfigTypeSliceInt:
val = gconv.SliceInt(val)
case ConfigTypeSliceInt64:
val = gconv.SliceInt64(val)
case ConfigTypeSliceString:
val = gconv.SliceStr(val)
default:
val = gconv.String(val)
}

View File

@ -3,7 +3,6 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package consts
// 状态码
@ -14,4 +13,4 @@ const (
StatusDelete int = 3 // 已删除
)
var StatusMap = []int{StatusALL, StatusEnabled, StatusDisable, StatusDelete}
var StatusSlice = []int{StatusALL, StatusEnabled, StatusDisable, StatusDelete}

View File

@ -7,5 +7,5 @@ package consts
// VersionApp HotGo版本
const (
VersionApp = "2.6.10"
VersionApp = "2.7.3"
)

View File

@ -96,54 +96,15 @@ func (c *cMember) ResetPwd(ctx context.Context, req *member.ResetPwdReq) (res *m
return
}
// EmailUnique 邮箱是否唯一
func (c *cMember) EmailUnique(ctx context.Context, req *member.EmailUniqueReq) (res *member.EmailUniqueRes, err error) {
var in = adminin.MemberEmailUniqueInp{
Id: req.Id,
Email: req.Email,
}
data, err := service.AdminMember().EmailUnique(ctx, in)
// MemberInfo 登录用户信息
func (c *cMember) MemberInfo(ctx context.Context, _ *member.InfoReq) (res *member.InfoRes, err error) {
data, err := service.AdminMember().LoginMemberInfo(ctx)
if err != nil {
return
}
res = new(member.EmailUniqueRes)
res.IsUnique = data.IsUnique
return
}
// MobileUnique 手机号是否唯一
func (c *cMember) MobileUnique(ctx context.Context, req *member.MobileUniqueReq) (res *member.MobileUniqueRes, err error) {
var in = adminin.MemberMobileUniqueInp{
Id: req.Id,
Mobile: req.Mobile,
}
data, err := service.AdminMember().MobileUnique(ctx, in)
if err != nil {
return
}
res = new(member.MobileUniqueRes)
res.IsUnique = data.IsUnique
return
}
// NameUnique 名称是否唯一
func (c *cMember) NameUnique(ctx context.Context, req *member.NameUniqueReq) (res *member.NameUniqueRes, err error) {
var in = adminin.MemberNameUniqueInp{
Id: req.Id,
Username: req.Username,
}
data, err := service.AdminMember().NameUnique(ctx, in)
if err != nil {
return
}
res = new(member.NameUniqueRes)
res.IsUnique = data.IsUnique
res = new(member.InfoRes)
res.LoginMemberInfoModel = data
return
}
@ -206,18 +167,6 @@ func (c *cMember) List(ctx context.Context, req *member.ListReq) (res *member.Li
return
}
// LoginInfo 登录用户信息
func (c *cMember) LoginInfo(ctx context.Context, req *member.LoginInfoReq) (res *member.LoginInfoRes, err error) {
data, err := service.AdminMember().LoginMemberInfo(ctx)
if err != nil {
return
}
res = new(member.LoginInfoRes)
res.LoginMemberInfoModel = data
return
}
// Status 更新状态
func (c *cMember) Status(ctx context.Context, req *member.StatusReq) (res *member.StatusRes, err error) {
var in adminin.MemberStatusInp

View File

@ -3,7 +3,6 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package common
import (
@ -16,7 +15,7 @@ var Console = cConsole{}
type cConsole struct{}
// Stat 综合数据统计
func (c *cConsole) Stat(ctx context.Context, req *common.ConsoleStatReq) (res *common.ConsoleStatRes, err error) {
func (c *cConsole) Stat(_ context.Context, _ *common.ConsoleStatReq) (res *common.ConsoleStatRes, err error) {
res = new(common.ConsoleStatRes)
res.Visits.DayVisits = 12010

View File

@ -16,7 +16,6 @@ import (
"hotgo/internal/library/captcha"
"hotgo/internal/library/token"
"hotgo/internal/model/input/adminin"
"hotgo/internal/model/input/sysin"
"hotgo/internal/service"
"hotgo/utility/validate"
)
@ -26,17 +25,18 @@ var Site = cSite{}
type cSite struct{}
// Ping ping
func (c *cSite) Ping(ctx context.Context, req *common.SitePingReq) (res *common.SitePingRes, err error) {
func (c *cSite) Ping(_ context.Context, _ *common.SitePingReq) (res *common.SitePingRes, err error) {
return
}
// Config 获取配置
func (c *cSite) Config(ctx context.Context, req *common.SiteConfigReq) (res *common.SiteConfigRes, err error) {
func (c *cSite) Config(ctx context.Context, _ *common.SiteConfigReq) (res *common.SiteConfigRes, err error) {
request := ghttp.RequestFromCtx(ctx)
res = &common.SiteConfigRes{
Version: consts.VersionApp,
WsAddr: c.getWsAddr(ctx, request),
Domain: c.getDomain(ctx, request),
//InviteUrl: "http://192.168.1.27:8001/#/login?scope=register&inviteCode=",
}
return
}
@ -71,35 +71,77 @@ func (c *cSite) getDomain(ctx context.Context, request *ghttp.Request) string {
return basic.Domain
}
// LoginConfig 登录配置
func (c *cSite) LoginConfig(ctx context.Context, _ *common.SiteLoginConfigReq) (res *common.SiteLoginConfigRes, err error) {
res = new(common.SiteLoginConfigRes)
login, err := service.SysConfig().GetLogin(ctx)
if err != nil {
return
}
res.LoginConfig = login
return
}
// Captcha 登录验证码
func (c *cSite) Captcha(ctx context.Context, req *common.LoginCaptchaReq) (res *common.LoginCaptchaRes, err error) {
func (c *cSite) Captcha(ctx context.Context, _ *common.LoginCaptchaReq) (res *common.LoginCaptchaRes, err error) {
cid, base64 := captcha.Generate(ctx)
res = &common.LoginCaptchaRes{Cid: cid, Base64: base64}
return
}
// Login 提交登录
func (c *cSite) Login(ctx context.Context, req *common.LoginReq) (res *common.LoginRes, err error) {
var in adminin.MemberLoginInp
// Register 账号注册
func (c *cSite) Register(ctx context.Context, req *common.RegisterReq) (res *common.RegisterRes, err error) {
var in adminin.RegisterInp
if err = gconv.Scan(req, &in); err != nil {
return
}
defer func() {
var response = new(adminin.MemberLoginModel)
if res != nil && res.MemberLoginModel != nil {
response = res.MemberLoginModel
}
service.SysLoginLog().Push(ctx, sysin.LoginLogPushInp{Input: in, Response: response, Err: err})
}()
// 校验 验证码
if !req.IsLock && !captcha.Verify(req.Cid, req.Code) {
err = gerror.New("验证码错误")
if err = validate.PreFilter(ctx, &in); err != nil {
return
}
model, err := service.AdminMember().Login(ctx, in)
err = service.AdminSite().Register(ctx, in)
return
}
// AccountLogin 账号登录
func (c *cSite) AccountLogin(ctx context.Context, req *common.AccountLoginReq) (res *common.AccountLoginRes, err error) {
var in adminin.AccountLoginInp
if err = gconv.Scan(req, &in); err != nil {
return
}
login, err := service.SysConfig().GetLogin(ctx)
if err != nil {
return
}
if login.CaptchaSwitch == 1 {
// 校验 验证码
if !req.IsLock && !captcha.Verify(req.Cid, req.Code) {
err = gerror.New("验证码错误")
return
}
}
model, err := service.AdminSite().AccountLogin(ctx, in)
if err != nil {
return
}
err = gconv.Scan(model, &res)
return
}
// MobileLogin 手机号登录
func (c *cSite) MobileLogin(ctx context.Context, req *common.MobileLoginReq) (res *common.MobileLoginRes, err error) {
var in adminin.MobileLoginInp
if err = gconv.Scan(req, &in); err != nil {
return
}
model, err := service.AdminSite().MobileLogin(ctx, in)
if err != nil {
return
}
@ -109,7 +151,7 @@ func (c *cSite) Login(ctx context.Context, req *common.LoginReq) (res *common.Lo
}
// Logout 注销登录
func (c *cSite) Logout(ctx context.Context, req *common.LoginLogoutReq) (res *common.LoginLogoutRes, err error) {
func (c *cSite) Logout(ctx context.Context, _ *common.LoginLogoutReq) (res *common.LoginLogoutRes, err error) {
err = token.Logout(ghttp.RequestFromCtx(ctx))
return
}

View File

@ -3,7 +3,6 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package common
import (
@ -40,7 +39,7 @@ func (c *cSms) SendTest(ctx context.Context, req *common.SendTestSmsReq) (res *c
}
// SendBindSms 发送换绑短信
func (c *cSms) SendBindSms(ctx context.Context, req *common.SendBindSmsReq) (res *common.SendBindSmsRes, err error) {
func (c *cSms) SendBindSms(ctx context.Context, _ *common.SendBindSmsReq) (res *common.SendBindSmsRes, err error) {
var (
memberId = contexts.GetUserId(ctx)
models *entity.AdminMember
@ -75,3 +74,18 @@ func (c *cSms) SendBindSms(ctx context.Context, req *common.SendBindSmsReq) (res
})
return
}
// SendSms 发送短信
func (c *cSms) SendSms(ctx context.Context, req *common.SendSmsReq) (res *common.SendSmsRes, err error) {
var in sysin.SendCodeInp
if err = gconv.Scan(req, &in); err != nil {
return
}
if err = validate.PreFilter(ctx, &in); err != nil {
return
}
err = service.SysSmsLog().SendCode(ctx, in)
return
}

View File

@ -3,7 +3,6 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package common
import (
@ -19,7 +18,7 @@ var Upload = new(cUpload)
type cUpload struct{}
// UploadImage 上传图片
func (c *cUpload) UploadImage(ctx context.Context, req *common.UploadImageReq) (res common.UploadImageRes, err error) {
func (c *cUpload) UploadImage(ctx context.Context, _ *common.UploadImageReq) (res common.UploadImageRes, err error) {
file := g.RequestFromCtx(ctx).GetUploadFile("file")
if file == nil {
err = gerror.New("没有找到上传的文件")
@ -30,7 +29,7 @@ func (c *cUpload) UploadImage(ctx context.Context, req *common.UploadImageReq) (
}
// UploadFile 上传附件
func (c *cUpload) UploadFile(ctx context.Context, req *common.UploadFileReq) (res common.UploadFileRes, err error) {
func (c *cUpload) UploadFile(ctx context.Context, _ *common.UploadFileReq) (res common.UploadFileRes, err error) {
file := g.RequestFromCtx(ctx).GetUploadFile("file")
if file == nil {
err = gerror.New("没有找到上传的文件")

View File

@ -5,11 +5,7 @@
package dao
import (
"context"
"github.com/gogf/gf/v2/errors/gerror"
"hotgo/internal/consts"
"hotgo/internal/dao/internal"
"hotgo/internal/model/entity"
)
// internalAdminMemberDao is internal type for wrapping internal DAO implements.
@ -29,66 +25,3 @@ var (
)
// Fill with you ideas below.
// IsUniqueName 判断用户名是否唯一
func (dao *adminMemberDao) IsUniqueName(ctx context.Context, id int64, name string) (bool, error) {
var data *entity.AdminDept
m := dao.Ctx(ctx).Where("username", name)
if id > 0 {
m = m.WhereNot("id", id)
}
if err := m.Scan(&data); err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return false, err
}
if data == nil {
return true, nil
}
return false, nil
}
// IsUniqueEmail 判断邮箱是否唯一
func (dao *adminMemberDao) IsUniqueEmail(ctx context.Context, id int64, email string) (bool, error) {
var data *entity.AdminMember
m := dao.Ctx(ctx).Where("email", email)
if id > 0 {
m = m.WhereNot("id", id)
}
if err := m.Scan(&data); err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return false, err
}
if data == nil {
return true, nil
}
return false, nil
}
// IsUniqueMobile 判断手机号是否唯一
func (dao *adminMemberDao) IsUniqueMobile(ctx context.Context, id int64, mobile string) (bool, error) {
var data *entity.AdminMember
m := dao.Ctx(ctx).Where("mobile", mobile)
if id > 0 {
m = m.WhereNot("id", id)
}
if err := m.Scan(&data); err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return false, err
}
if data == nil {
return true, nil
}
return false, nil
}

View File

@ -41,6 +41,7 @@ type AdminMemberColumns struct {
Pid string // 上级管理员ID
Level string // 关系树等级
Tree string // 关系树
InviteCode string // 邀请码
Cash string // 提现配置
LastActiveAt string // 最后活跃时间
Remark string // 备注
@ -72,6 +73,7 @@ var adminMemberColumns = AdminMemberColumns{
Pid: "pid",
Level: "level",
Tree: "tree",
InviteCode: "invite_code",
Cash: "cash",
LastActiveAt: "last_active_at",
Remark: "remark",

View File

@ -1,3 +1,8 @@
// Package handler
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package handler
import (

View File

@ -1,3 +1,8 @@
// Package handler
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package handler
import (

View File

@ -1,3 +1,8 @@
// Package hook
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package hook
// hook.

View File

@ -1,3 +1,8 @@
// Package hook
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package hook
import (

View File

@ -1,3 +1,8 @@
// Package hook
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package hook
import (

View File

@ -1,3 +1,8 @@
// Package location
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package location
import (

View File

@ -1,3 +1,8 @@
// Package location
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package location
import (

View File

@ -1,3 +1,8 @@
// Package tcp
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package tcp
import (

View File

@ -1,3 +1,8 @@
// Package tcp
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package tcp
import (

View File

@ -1,3 +1,8 @@
// Package tcp
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package tcp
import (

View File

@ -1,3 +1,8 @@
// Package tcp
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package tcp
import (

View File

@ -1,3 +1,8 @@
// Package tcp
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package tcp
import (

View File

@ -1,3 +1,8 @@
// Package tcp
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package tcp
type Response interface {

View File

@ -1,3 +1,8 @@
// Package tcp
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package tcp
import (

View File

@ -1,3 +1,8 @@
// Package tcp
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package tcp
import (

View File

@ -1,3 +1,8 @@
// Package tcp
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package tcp
import (

View File

@ -1,3 +1,8 @@
// Package tcp
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package tcp
import (

View File

@ -1,3 +1,8 @@
// Package tcp
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package tcp
import (

View File

@ -1,3 +1,8 @@
// Package tcp
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package tcp
import (

View File

@ -112,7 +112,7 @@ func (s *sAdminDept) Status(ctx context.Context, in adminin.DeptStatusInp) (err
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}

View File

@ -19,16 +19,13 @@ import (
"hotgo/internal/consts"
"hotgo/internal/dao"
"hotgo/internal/library/contexts"
"hotgo/internal/library/hgorm"
"hotgo/internal/library/hgorm/handler"
"hotgo/internal/library/hgorm/hook"
"hotgo/internal/library/token"
"hotgo/internal/model"
"hotgo/internal/model/do"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/adminin"
"hotgo/internal/model/input/sysin"
"hotgo/internal/service"
"hotgo/utility/simple"
"hotgo/utility/tree"
"hotgo/utility/validate"
)
@ -157,7 +154,7 @@ func (s *sAdminMember) UpdateCash(ctx context.Context, in adminin.MemberUpdateCa
_, err = dao.AdminMember.Ctx(ctx).
Where("id", memberId).
Data(g.Map{
"cash": adminin.MemberCash{
dao.AdminMember.Columns().Cash: adminin.MemberCash{
Name: in.Name,
Account: in.Account,
PayeeCode: in.PayeeCode,
@ -316,13 +313,13 @@ func (s *sAdminMember) UpdateProfile(ctx context.Context, in adminin.MemberUpdat
// UpdatePwd 修改登录密码
func (s *sAdminMember) UpdatePwd(ctx context.Context, in adminin.MemberUpdatePwdInp) (err error) {
var memberInfo entity.AdminMember
if err = dao.AdminMember.Ctx(ctx).Where("id", in.Id).Scan(&memberInfo); err != nil {
var mb entity.AdminMember
if err = dao.AdminMember.Ctx(ctx).Where("id", in.Id).Scan(&mb); err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return err
}
if gmd5.MustEncryptString(in.OldPassword+memberInfo.Salt) != memberInfo.PasswordHash {
if gmd5.MustEncryptString(in.OldPassword+mb.Salt) != mb.PasswordHash {
err = gerror.New("原密码不正确")
return err
}
@ -330,10 +327,10 @@ func (s *sAdminMember) UpdatePwd(ctx context.Context, in adminin.MemberUpdatePwd
_, err = dao.AdminMember.Ctx(ctx).
Where("id", in.Id).
Data(g.Map{
"password_hash": gmd5.MustEncryptString(in.NewPassword + memberInfo.Salt),
"updated_at": gtime.Now(),
dao.AdminMember.Columns().PasswordHash: gmd5.MustEncryptString(in.NewPassword + mb.Salt),
}).
Update()
if err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return err
@ -362,61 +359,40 @@ func (s *sAdminMember) ResetPwd(ctx context.Context, in adminin.MemberResetPwdIn
_, err = s.FilterAuthModel(ctx, memberId).
Where("id", in.Id).
Data(g.Map{
"password_hash": gmd5.MustEncryptString(in.Password + mb.Salt),
"updated_at": gtime.Now(),
dao.AdminMember.Columns().PasswordHash: gmd5.MustEncryptString(in.Password + mb.Salt),
}).
Update()
return
}
// EmailUnique 菜单名称是否唯一
func (s *sAdminMember) EmailUnique(ctx context.Context, in adminin.MemberEmailUniqueInp) (res *adminin.MemberEmailUniqueModel, err error) {
isUnique, err := dao.AdminMember.IsUniqueEmail(ctx, in.Id, in.Email)
if err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
// VerifyUnique 验证管理员唯一属性
func (s *sAdminMember) VerifyUnique(ctx context.Context, in adminin.VerifyUniqueInp) (err error) {
if in.Where == nil {
return
}
res = new(adminin.MemberEmailUniqueModel)
res.IsUnique = isUnique
return
}
// MobileUnique 手机号是否唯一
func (s *sAdminMember) MobileUnique(ctx context.Context, in adminin.MemberMobileUniqueInp) (res *adminin.MemberMobileUniqueModel, err error) {
isUnique, err := dao.AdminMember.IsUniqueMobile(ctx, in.Id, in.Mobile)
if err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return
msgMap := g.MapStrStr{
"username": "用户名已存在,请换一个",
"email": "邮箱已存在,请换一个",
"mobile": "手机号已存在,请换一个",
"invite_code": "邀请码已存在,请换一个",
}
res = new(adminin.MemberMobileUniqueModel)
res.IsUnique = isUnique
return
}
// NameUnique 菜单名称是否唯一
func (s *sAdminMember) NameUnique(ctx context.Context, in adminin.MemberNameUniqueInp) (res *adminin.MemberNameUniqueModel, err error) {
isUnique, err := dao.AdminMember.IsUniqueName(ctx, in.Id, in.Username)
if err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return
}
res = new(adminin.MemberNameUniqueModel)
res.IsUnique = isUnique
return
}
// VerifySuperId 验证是否为超管
func (s *sAdminMember) VerifySuperId(ctx context.Context, verifyId int64) bool {
superIds := g.Cfg().MustGet(ctx, "hotgo.admin.superIds")
for _, id := range superIds.Int64s() {
if id == verifyId {
return true
for k, v := range in.Where {
if v == "" {
continue
}
message, ok := msgMap[k]
if !ok {
err = gerror.Newf("字段 [ %v ] 未配置唯一属性验证", k)
return
}
if err = hgorm.IsUnique(ctx, dao.AdminMember, g.Map{k: v}, message, in.Id); err != nil {
return
}
}
return false
return
}
// Delete 删除
@ -449,36 +425,17 @@ func (s *sAdminMember) Edit(ctx context.Context, in adminin.MemberEditInp) (err
return
}
uniqueName, err := dao.AdminMember.IsUniqueName(ctx, in.Id, in.Username)
err = s.VerifyUnique(ctx, adminin.VerifyUniqueInp{
Id: in.Id,
Where: g.Map{
dao.AdminMember.Columns().Username: in.Username,
dao.AdminMember.Columns().Mobile: in.Mobile,
dao.AdminMember.Columns().Email: in.Email,
},
})
if err != nil {
return
}
if !uniqueName {
err = gerror.New("用户名已存在")
return
}
if in.Mobile != "" {
uniqueMobile, err := dao.AdminMember.IsUniqueMobile(ctx, in.Id, in.Mobile)
if err != nil {
return err
}
if !uniqueMobile {
err = gerror.New("手机号已存在")
return err
}
}
if in.Email != "" {
uniqueEmail, err := dao.AdminMember.IsUniqueEmail(ctx, in.Id, in.Email)
if err != nil {
return err
}
if !uniqueEmail {
err = gerror.New("邮箱已存在")
return err
}
}
// 修改
if in.Id > 0 {
@ -488,8 +445,13 @@ func (s *sAdminMember) Edit(ctx context.Context, in adminin.MemberEditInp) (err
}
mod := s.FilterAuthModel(ctx, opMemberId)
if in.Password != "" {
salt, err := s.FilterAuthModel(ctx, contexts.GetUserId(ctx)).Fields(dao.AdminMember.Columns().Salt).Where("id", in.Id).Value()
// 修改密码
salt, err := s.FilterAuthModel(ctx, contexts.GetUserId(ctx)).
Fields(dao.AdminMember.Columns().Salt).
Where("id", in.Id).
Value()
if err != nil {
return err
}
@ -498,35 +460,39 @@ func (s *sAdminMember) Edit(ctx context.Context, in adminin.MemberEditInp) (err
mod = mod.FieldsEx(dao.AdminMember.Columns().PasswordHash)
}
if _, err = mod.Where("id", in.Id).Data(in).Update(); err != nil {
return
}
return g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) (err error) {
if _, err = mod.Where("id", in.Id).Data(in).Update(); err != nil {
return
}
// 更新岗位
err = dao.AdminMemberPost.UpdatePostIds(ctx, in.Id, in.PostIds)
return
// 更新岗位
return dao.AdminMemberPost.UpdatePostIds(ctx, in.Id, in.PostIds)
})
}
// 新增用户时的额外属性
var data adminin.MemberAddInp
data.MemberEditInp = in
data.Salt = grand.S(6)
data.InviteCode = grand.S(12)
data.PasswordHash = gmd5.MustEncryptString(data.Password + data.Salt)
// 关系树
data.Pid = opMemberId
data.Level, data.Tree, err = s.genTree(ctx, opMemberId)
data.Level, data.Tree, err = s.GenTree(ctx, opMemberId)
if err != nil {
return
}
id, err := dao.AdminMember.Ctx(ctx).Data(data).InsertAndGetId()
if err != nil {
return
}
return g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) (err error) {
id, err := dao.AdminMember.Ctx(ctx).Data(data).InsertAndGetId()
if err != nil {
return
}
err = dao.AdminMemberPost.UpdatePostIds(ctx, id, in.PostIds)
return
// 更新岗位
return dao.AdminMemberPost.UpdatePostIds(ctx, id, in.PostIds)
})
}
// View 获取信息
@ -589,6 +555,7 @@ func (s *sAdminMember) List(ctx context.Context, in adminin.MemberListInp) (list
Fields("post_id").
Where("member_id", list[i].Id).
Array()
if err != nil {
return nil, 0, err
}
@ -601,20 +568,68 @@ func (s *sAdminMember) List(ctx context.Context, in adminin.MemberListInp) (list
return
}
// genTree 生成关系树
func (s *sAdminMember) genTree(ctx context.Context, pid int64) (level int, newTree string, err error) {
var pInfo *entity.AdminMember
if err = dao.AdminMember.Ctx(ctx).Where("id", pid).Scan(&pInfo); err != nil {
// Status 更新状态
func (s *sAdminMember) Status(ctx context.Context, in adminin.MemberStatusInp) (err error) {
if in.Id <= 0 {
err = gerror.New("ID不能为空")
return
}
if pInfo == nil {
if s.VerifySuperId(ctx, in.Id) {
err = gerror.New("超管账号不能更改状态")
return
}
if in.Status <= 0 {
err = gerror.New("状态不能为空")
return
}
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}
// 修改
in.UpdatedAt = gtime.Now()
_, err = s.FilterAuthModel(ctx, contexts.GetUserId(ctx)).Where("id", in.Id).Data("status", in.Status).Update()
return
}
// GenTree 生成关系树
func (s *sAdminMember) GenTree(ctx context.Context, pid int64) (level int, newTree string, err error) {
var pmb *entity.AdminMember
if err = dao.AdminMember.Ctx(ctx).Where("id", pid).Scan(&pmb); err != nil {
return
}
if pmb == nil {
err = gerror.New("上级信息不存在")
return
}
level = pInfo.Level + 1
newTree = tree.GenLabel(pInfo.Tree, pInfo.Id)
level = pmb.Level + 1
newTree = tree.GenLabel(pmb.Tree, pmb.Id)
return
}
// RoleMemberList 获取角色下的用户列表
func (s *sAdminMember) RoleMemberList(ctx context.Context, in adminin.RoleMemberListInp) (list []*adminin.MemberListModel, totalCount int, err error) {
mod := dao.AdminMember.Ctx(ctx)
if in.Role > 0 {
mod = mod.Where("role", in.Role)
}
totalCount, err = mod.Count()
if err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return
}
if err = mod.Page(in.Page, in.PerPage).Order("id desc").Scan(&list); err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return
}
return
}
@ -626,11 +641,7 @@ func (s *sAdminMember) LoginMemberInfo(ctx context.Context) (res *adminin.LoginM
return
}
err = dao.AdminMember.Ctx(ctx).
Hook(hook.MemberInfo).
Where("id", memberId).
Scan(&res)
if err != nil {
if err = dao.AdminMember.Ctx(ctx).Hook(hook.MemberInfo).Where("id", memberId).Scan(&res); err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return
}
@ -660,142 +671,36 @@ func (s *sAdminMember) LoginMemberInfo(ctx context.Context) (res *adminin.LoginM
return
}
// Login 提交登录
func (s *sAdminMember) Login(ctx context.Context, in adminin.MemberLoginInp) (res *adminin.MemberLoginModel, err error) {
var (
ro *entity.AdminRole
mb *entity.AdminMember
)
// MemberLoginStat 用户登录统计
func (s *sAdminMember) MemberLoginStat(ctx context.Context, in adminin.MemberLoginStatInp) (res *adminin.MemberLoginStatModel, err error) {
var models *entity.SysLoginLog
err = dao.SysLoginLog.Ctx(ctx).
Fields("login_at,login_ip").
Where("member_id", in.MemberId).
Where("status", consts.StatusEnabled).
Scan(&models)
if err = dao.AdminMember.Ctx(ctx).Where("username", in.Username).Scan(&mb); err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return
}
if mb == nil {
err = gerror.New("账号不存在")
return
}
if mb.Salt == "" {
err = gerror.New("用户信息错误")
return
}
if err = simple.CheckPassword(in.Password, mb.Salt, mb.PasswordHash); err != nil {
return
}
if mb.Status != consts.StatusEnabled {
err = gerror.New("账号已被禁用")
return
}
if err = dao.AdminRole.Ctx(ctx).Fields("id,key,status").Where("id", mb.RoleId).Scan(&ro); err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return
}
if ro == nil {
err = gerror.New("角色不存在")
return
}
if ro.Status != consts.StatusEnabled {
err = gerror.New("角色已被禁用")
return
}
user := &model.Identity{
Id: mb.Id,
Pid: mb.Pid,
DeptId: mb.DeptId,
RoleId: ro.Id,
RoleKey: ro.Key,
Username: mb.Username,
RealName: mb.RealName,
Avatar: mb.Avatar,
Email: mb.Email,
Mobile: mb.Mobile,
App: consts.AppAdmin,
LoginAt: gtime.Now(),
}
loginToken, expires, err := token.Login(ctx, user)
if err != nil {
return nil, err
}
update := do.AdminMember{
LastActiveAt: user.LoginAt,
}
// 更新登录信息
if _, err = dao.AdminMember.Ctx(ctx).Data(update).Where(do.AdminMember{Id: mb.Id}).Update(); err != nil {
return
}
res = &adminin.MemberLoginModel{
Id: user.Id,
Token: loginToken,
Expires: expires,
}
return
}
// RoleMemberList 获取角色下的用户列表
func (s *sAdminMember) RoleMemberList(ctx context.Context, in adminin.RoleMemberListInp) (list []*adminin.MemberListModel, totalCount int, err error) {
mod := dao.AdminMember.Ctx(ctx)
if in.Role > 0 {
mod = mod.Where("role", in.Role)
}
totalCount, err = mod.Count()
if err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
res = new(adminin.MemberLoginStatModel)
if models == nil {
return
}
if err = mod.Page(in.Page, in.PerPage).Order("id desc").Scan(&list); err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return
}
return
}
// Status 更新状态
func (s *sAdminMember) Status(ctx context.Context, in adminin.MemberStatusInp) (err error) {
if in.Id <= 0 {
err = gerror.New("ID不能为空")
return
}
if s.VerifySuperId(ctx, in.Id) {
err = gerror.New("超管账号不能更改状态")
return
}
if in.Status <= 0 {
err = gerror.New("状态不能为空")
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
err = gerror.New("状态不正确")
return
}
// 修改
in.UpdatedAt = gtime.Now()
_, err = s.FilterAuthModel(ctx, contexts.GetUserId(ctx)).Where("id", in.Id).Data("status", in.Status).Update()
res.LastLoginAt = models.LoginAt
res.LastLoginIp = models.LoginIp
res.LoginCount, err = dao.SysLoginLog.Ctx(ctx).
Where("member_id", in.MemberId).
Where("status", consts.StatusEnabled).
Count()
return
}
// GetIdByCode 通过邀请码获取用户ID
func (s *sAdminMember) GetIdByCode(ctx context.Context, in adminin.GetIdByCodeInp) (res *adminin.GetIdByCodeModel, err error) {
err = dao.AdminMember.Ctx(ctx).Fields("invite_code").Where("invite_code", in.Code).Scan(&res)
err = dao.AdminMember.Ctx(ctx).Fields(adminin.GetIdByCodeModel{}).Where("invite_code", in.Code).Scan(&res)
return
}
@ -808,6 +713,17 @@ func (s *sAdminMember) Select(ctx context.Context, in adminin.MemberSelectInp) (
return
}
// VerifySuperId 验证是否为超管
func (s *sAdminMember) VerifySuperId(ctx context.Context, verifyId int64) bool {
superIds := g.Cfg().MustGet(ctx, "hotgo.admin.superIds")
for _, id := range superIds.Int64s() {
if id == verifyId {
return true
}
}
return false
}
func (s *sAdminMember) FilterAuthModel(ctx context.Context, memberId int64) *gdb.Model {
m := dao.AdminMember.Ctx(ctx)
if !s.VerifySuperId(ctx, memberId) {
@ -815,26 +731,3 @@ func (s *sAdminMember) FilterAuthModel(ctx context.Context, memberId int64) *gdb
}
return m.Handler(handler.FilterAuthWithField("id"))
}
// MemberLoginStat 用户登录统计
func (s *sAdminMember) MemberLoginStat(ctx context.Context, in adminin.MemberLoginStatInp) (res *adminin.MemberLoginStatModel, err error) {
var models *entity.SysLoginLog
err = dao.SysLoginLog.Ctx(ctx).
Fields("login_at,login_ip").
Where("member_id", in.MemberId).
Where("status", consts.StatusEnabled).
Scan(&models)
if err != nil {
return
}
res = new(adminin.MemberLoginStatModel)
if models == nil {
return
}
res.LastLoginAt = models.LoginAt
res.LastLoginIp = models.LoginIp
res.LoginCount, err = dao.SysLoginLog.Ctx(ctx).Where("member_id", in.MemberId).Where("status", consts.StatusEnabled).Count()
return
}

View File

@ -124,7 +124,7 @@ func (s *sAdminNotice) Status(ctx context.Context, in adminin.NoticeStatusInp) (
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}

View File

@ -378,7 +378,7 @@ func (s *sAdminOrder) Status(ctx context.Context, in adminin.OrderStatusInp) (er
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}

View File

@ -203,7 +203,7 @@ func (s *sAdminPost) Status(ctx context.Context, in adminin.PostStatusInp) (err
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}

View File

@ -0,0 +1,266 @@
package admin
import (
"context"
"github.com/gogf/gf/v2/crypto/gmd5"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/util/grand"
"hotgo/internal/consts"
"hotgo/internal/dao"
"hotgo/internal/library/token"
"hotgo/internal/model"
"hotgo/internal/model/do"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/adminin"
"hotgo/internal/model/input/sysin"
"hotgo/internal/service"
"hotgo/utility/simple"
)
type sAdminSite struct{}
func NewAdminSite() *sAdminSite {
return &sAdminSite{}
}
func init() {
service.RegisterAdminSite(NewAdminSite())
}
// Register 账号注册
func (s *sAdminSite) Register(ctx context.Context, in adminin.RegisterInp) (err error) {
var data adminin.MemberAddInp
// 默认上级
data.Pid = 1
// 存在邀请人
if in.InviteCode != "" {
pmb, err := service.AdminMember().GetIdByCode(ctx, adminin.GetIdByCodeInp{Code: in.InviteCode})
if err != nil {
return err
}
if pmb == nil {
err = gerror.New("邀请人信息不存在")
return err
}
data.Pid = pmb.Id
}
config, err := service.SysConfig().GetLogin(ctx)
if err != nil {
return
}
if config.RegisterSwitch != 1 {
err = gerror.New("管理员未开放注册")
return
}
if config.RoleId < 1 {
err = gerror.New("管理员未配置默认角色")
return
}
if config.DeptId < 1 {
err = gerror.New("管理员未配置默认部门")
return
}
if len(config.PostIds) == 0 {
err = gerror.New("管理员未配置默认岗位")
return
}
// 验证唯一性
err = service.AdminMember().VerifyUnique(ctx, adminin.VerifyUniqueInp{
Where: g.Map{
dao.AdminMember.Columns().Username: in.Username,
dao.AdminMember.Columns().Mobile: in.Mobile,
},
})
if err != nil {
return
}
// 验证短信验证码
err = service.SysSmsLog().VerifyCode(ctx, sysin.VerifyCodeInp{
Event: consts.SmsTemplateRegister,
Mobile: in.Mobile,
Code: in.Code,
})
if err != nil {
return
}
data.MemberEditInp = adminin.MemberEditInp{
Id: 0,
RoleId: config.RoleId,
PostIds: config.PostIds,
DeptId: config.DeptId,
Username: in.Username,
Password: in.Password,
RealName: "",
Avatar: config.Avatar,
Sex: 3, // 保密
Mobile: in.Mobile,
Status: consts.StatusEnabled,
}
data.Salt = grand.S(6)
data.InviteCode = grand.S(12)
data.PasswordHash = gmd5.MustEncryptString(data.Password + data.Salt)
data.Level, data.Tree, err = service.AdminMember().GenTree(ctx, data.Pid)
if err != nil {
return
}
// 提交注册信息
return g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) (err error) {
id, err := dao.AdminMember.Ctx(ctx).Data(data).InsertAndGetId()
if err != nil {
return
}
return dao.AdminMemberPost.UpdatePostIds(ctx, id, config.PostIds)
})
}
// AccountLogin 账号登录
func (s *sAdminSite) AccountLogin(ctx context.Context, in adminin.AccountLoginInp) (res *adminin.LoginModel, err error) {
defer func() {
service.SysLoginLog().Push(ctx, sysin.LoginLogPushInp{Response: res, Err: err})
}()
var mb *entity.AdminMember
if err = dao.AdminMember.Ctx(ctx).Where("username", in.Username).Scan(&mb); err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return
}
if mb == nil {
err = gerror.New("账号不存在")
return
}
res = new(adminin.LoginModel)
res.Id = mb.Id
res.Username = mb.Username
if mb.Salt == "" {
err = gerror.New("用户信息错误")
return
}
if err = simple.CheckPassword(in.Password, mb.Salt, mb.PasswordHash); err != nil {
return
}
if mb.Status != consts.StatusEnabled {
err = gerror.New("账号已被禁用")
return
}
res, err = s.handleLogin(ctx, mb)
return
}
// MobileLogin 手机号登录
func (s *sAdminSite) MobileLogin(ctx context.Context, in adminin.MobileLoginInp) (res *adminin.LoginModel, err error) {
defer func() {
service.SysLoginLog().Push(ctx, sysin.LoginLogPushInp{Response: res, Err: err})
}()
var mb *entity.AdminMember
if err = dao.AdminMember.Ctx(ctx).Where("mobile ", in.Mobile).Scan(&mb); err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return
}
if mb == nil {
err = gerror.New("账号不存在")
return
}
res = new(adminin.LoginModel)
res.Id = mb.Id
res.Username = mb.Username
err = service.SysSmsLog().VerifyCode(ctx, sysin.VerifyCodeInp{
Event: consts.SmsTemplateLogin,
Mobile: in.Mobile,
Code: in.Code,
})
if err != nil {
return
}
if mb.Status != consts.StatusEnabled {
err = gerror.New("账号已被禁用")
return
}
res, err = s.handleLogin(ctx, mb)
return
}
// handleLogin .
func (s *sAdminSite) handleLogin(ctx context.Context, mb *entity.AdminMember) (res *adminin.LoginModel, err error) {
var ro *entity.AdminRole
if err = dao.AdminRole.Ctx(ctx).Fields("id,key,status").Where("id", mb.RoleId).Scan(&ro); err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return
}
if ro == nil {
err = gerror.New("角色不存在")
return
}
if ro.Status != consts.StatusEnabled {
err = gerror.New("角色已被禁用")
return
}
user := &model.Identity{
Id: mb.Id,
Pid: mb.Pid,
DeptId: mb.DeptId,
RoleId: ro.Id,
RoleKey: ro.Key,
Username: mb.Username,
RealName: mb.RealName,
Avatar: mb.Avatar,
Email: mb.Email,
Mobile: mb.Mobile,
App: consts.AppAdmin,
LoginAt: gtime.Now(),
}
loginToken, expires, err := token.Login(ctx, user)
if err != nil {
return nil, err
}
update := do.AdminMember{
LastActiveAt: user.LoginAt,
}
// 更新登录信息
if _, err = dao.AdminMember.Ctx(ctx).Data(update).Where(do.AdminMember{Id: mb.Id}).Update(); err != nil {
return
}
res = &adminin.LoginModel{
Username: user.Username,
Id: user.Id,
Token: loginToken,
Expires: expires,
}
return
}

View File

@ -39,8 +39,9 @@ func NewMiddleware() *sMiddleware {
return &sMiddleware{
LoginUrl: "/common",
DemoWhiteList: g.Map{
"/admin/site/login": struct{}{}, // 后台登录
"/admin/genCodes/preview": struct{}{}, // 预览代码
"/admin/site/accountLogin": struct{}{}, // 账号登录
"/admin/site/mobileLogin": struct{}{}, // 手机号登录
"/admin/genCodes/preview": struct{}{}, // 预览代码
},
PayNotifyRoutes: g.Map{
"/api/pay/notify/alipay": struct{}{}, // 支付宝

View File

@ -61,11 +61,6 @@ func (s *sPay) List(ctx context.Context, in payin.PayListInp) (list []*payin.Pay
mod = mod.WhereBetween(dao.PayLog.Columns().CreatedAt, in.CreatedAt[0], in.CreatedAt[1])
}
// 查询分类名称
if in.TestCategoryName != "" {
mod = mod.WhereLike(dao.TestCategory.Columns().Name, in.TestCategoryName)
}
totalCount, err = mod.Clone().Count()
if err != nil {
return
@ -143,7 +138,7 @@ func (s *sPay) Status(ctx context.Context, in payin.PayStatusInp) (err error) {
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}

View File

@ -73,7 +73,7 @@ func (s *sSysAttachment) Status(ctx context.Context, in sysin.AttachmentStatusIn
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}

View File

@ -68,7 +68,7 @@ func (s *sSysBlacklist) Status(ctx context.Context, in sysin.BlacklistStatusInp)
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}

View File

@ -83,27 +83,13 @@ func (s *sSysConfig) InitConfig(ctx context.Context) {
}
// GetLoadTCP 获取本地tcp配置
func (s *sSysConfig) GetLoadTCP(ctx context.Context) (conf *model.TCPConfig, err error) {
err = g.Cfg().MustGet(ctx, "tcp").Scan(&conf)
return
}
// GetLoadCache 获取本地缓存配置
func (s *sSysConfig) GetLoadCache(ctx context.Context) (conf *model.CacheConfig, err error) {
err = g.Cfg().MustGet(ctx, "cache").Scan(&conf)
return
}
// GetLoadGenerate 获取本地生成配置
func (s *sSysConfig) GetLoadGenerate(ctx context.Context) (conf *model.GenerateConfig, err error) {
err = g.Cfg().MustGet(ctx, "hggen").Scan(&conf)
return
}
// GetLoadToken 获取本地token配置
func (s *sSysConfig) GetLoadToken(ctx context.Context) (conf *model.TokenConfig, err error) {
err = g.Cfg().MustGet(ctx, "token").Scan(&conf)
// GetLogin 获取登录配置
func (s *sSysConfig) GetLogin(ctx context.Context) (conf *model.LoginConfig, err error) {
models, err := s.GetConfigByGroup(ctx, sysin.GetConfigInp{Group: "login"})
if err != nil {
return
}
err = gconv.Scan(models.List, &conf)
return
}
@ -182,6 +168,30 @@ func (s *sSysConfig) GetBasic(ctx context.Context) (conf *model.BasicConfig, err
return
}
// GetLoadTCP 获取本地tcp配置
func (s *sSysConfig) GetLoadTCP(ctx context.Context) (conf *model.TCPConfig, err error) {
err = g.Cfg().MustGet(ctx, "tcp").Scan(&conf)
return
}
// GetLoadCache 获取本地缓存配置
func (s *sSysConfig) GetLoadCache(ctx context.Context) (conf *model.CacheConfig, err error) {
err = g.Cfg().MustGet(ctx, "cache").Scan(&conf)
return
}
// GetLoadGenerate 获取本地生成配置
func (s *sSysConfig) GetLoadGenerate(ctx context.Context) (conf *model.GenerateConfig, err error) {
err = g.Cfg().MustGet(ctx, "hggen").Scan(&conf)
return
}
// GetLoadToken 获取本地token配置
func (s *sSysConfig) GetLoadToken(ctx context.Context) (conf *model.TokenConfig, err error) {
err = g.Cfg().MustGet(ctx, "token").Scan(&conf)
return
}
// GetLoadSSL 获取本地日志配置
func (s *sSysConfig) GetLoadSSL(ctx context.Context) (conf *model.SSLConfig, err error) {
err = g.Cfg().MustGet(ctx, "hotgo.ssl").Scan(&conf)

View File

@ -107,7 +107,7 @@ func (s *sSysCron) Status(ctx context.Context, in sysin.CronStatusInp) (err erro
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}

View File

@ -63,7 +63,7 @@ func (s *sSysCronGroup) Status(ctx context.Context, in sysin.CronGroupStatusInp)
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}

View File

@ -180,7 +180,7 @@ func (s *sSysCurdDemo) Status(ctx context.Context, in sysin.CurdDemoStatusInp) (
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}

View File

@ -76,7 +76,7 @@ func (s *sSysEmsLog) Status(ctx context.Context, in sysin.EmsLogStatusInp) (err
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}

View File

@ -110,7 +110,7 @@ func (s *sSysGenCodes) Status(ctx context.Context, in sysin.GenCodesStatusInp) (
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}

View File

@ -24,6 +24,7 @@ import (
"hotgo/internal/library/location"
"hotgo/internal/library/queue"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/adminin"
"hotgo/internal/model/input/form"
"hotgo/internal/model/input/sysin"
"hotgo/internal/service"
@ -147,10 +148,14 @@ func (s *sSysLoginLog) View(ctx context.Context, in sysin.LoginLogViewInp) (res
// Push 推送登录日志
func (s *sSysLoginLog) Push(ctx context.Context, in sysin.LoginLogPushInp) {
g.DumpWithType(in)
if in.Response == nil {
in.Response = new(adminin.LoginModel)
}
var models entity.SysLoginLog
models.ReqId = gctx.CtxId(ctx)
models.MemberId = in.Response.Id
models.Username = in.Input.Username
models.Username = in.Response.Username
models.LoginAt = gtime.Now()
models.LoginIp = location.GetClientIp(ghttp.RequestFromCtx(ctx))
models.Status = consts.StatusEnabled
@ -161,12 +166,12 @@ func (s *sSysLoginLog) Push(ctx context.Context, in sysin.LoginLogPushInp) {
}
models.Response = gjson.New(consts.NilJsonToString)
if in.Response != nil && in.Response.Id > 0 {
if in.Response != nil {
models.Response = gjson.New(in.Response)
}
if err := queue.Push(consts.QueueLoginLogTopic, models); err != nil {
g.Log().Warningf(ctx, "sSysLoginLog.Push err:%+v, models:%+v", err, models)
g.Log().Warningf(ctx, "push err:%+v, models:%+v", err, models)
}
return
}

View File

@ -3,7 +3,6 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package sys
import (
@ -127,7 +126,7 @@ func (s *sSysProvinces) Status(ctx context.Context, in sysin.ProvincesStatusInp)
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}

View File

@ -15,7 +15,6 @@ import (
"hotgo/internal/consts"
"hotgo/internal/dao"
"hotgo/internal/library/location"
"hotgo/internal/library/sms"
"hotgo/internal/model"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
@ -71,7 +70,7 @@ func (s *sSysSmsLog) Status(ctx context.Context, in sysin.SmsLogStatusInp) (err
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}
@ -180,9 +179,9 @@ func (s *sSysSmsLog) SendCode(ctx context.Context, in sysin.SendCodeInp) (err er
in.Code = grand.Digits(4)
}
if err = sms.New(config.SmsDrive).SendCode(ctx, in, config); err != nil {
return
}
//if err = sms.New(config.SmsDrive).SendCode(ctx, in, config); err != nil {
// return
//}
var data = new(entity.SysSmsLog)
data.Event = in.Event

View File

@ -50,6 +50,7 @@ func (s *sAuthClient) Start(ctx context.Context) {
LoginEvent: s.onLoginEvent,
CloseEvent: s.onCloseEvent,
})
if err != nil {
g.Log().Errorf(ctx, "AuthClient NewClient fail%+v", err)
return

View File

@ -37,7 +37,7 @@ func (s *sCronClient) Start(ctx context.Context) {
}
simple.SafeGo(ctx, func(ctx context.Context) {
client, err := tcp.NewClient(&tcp.ClientConfig{
s.client, err = tcp.NewClient(&tcp.ClientConfig{
Addr: config.Client.Cron.Address,
Auth: &tcp.AuthMeta{
Group: config.Client.Cron.Group,
@ -48,13 +48,12 @@ func (s *sCronClient) Start(ctx context.Context) {
LoginEvent: s.onLoginEvent,
CloseEvent: s.onCloseEvent,
})
if err != nil {
g.Log().Errorf(ctx, "CronClient NewClient fail%+v", err)
return
}
s.client = client
err = s.client.RegisterRouter(map[string]tcp.RouterHandler{
"CronDelete": s.OnCronDelete, // 删除任务
"CronEdit": s.OnCronEdit, // 编辑任务

View File

@ -157,6 +157,18 @@ type WechatConfig struct {
*WechatOpenPlatformConfig
}
// LoginConfig 登录配置
type LoginConfig struct {
RegisterSwitch int `json:"loginRegisterSwitch"`
CaptchaSwitch int `json:"loginCaptchaSwitch"`
Avatar string `json:"loginAvatar"`
Protocol string `json:"loginProtocol"`
Policy string `json:"loginPolicy"`
RoleId int64 `json:"loginRoleId"`
DeptId int64 `json:"loginDeptId"`
PostIds []int64 `json:"loginPostIds"`
}
///////////// 以下是本地配置
// SSLConfig https配置

View File

@ -34,6 +34,7 @@ type AdminMember struct {
Pid interface{} // 上级管理员ID
Level interface{} // 关系树等级
Tree interface{} // 关系树
InviteCode interface{} // 邀请码
Cash *gjson.Json // 提现配置
LastActiveAt *gtime.Time // 最后活跃时间
Remark interface{} // 备注

View File

@ -32,6 +32,7 @@ type AdminMember struct {
Pid int64 `json:"pid" description:"上级管理员ID"`
Level int `json:"level" description:"关系树等级"`
Tree string `json:"tree" description:"关系树"`
InviteCode string `json:"inviteCode" description:"邀请码"`
Cash *gjson.Json `json:"cash" description:"提现配置"`
LastActiveAt *gtime.Time `json:"lastActiveAt" description:"最后活跃时间"`
Remark string `json:"remark" description:"备注"`

View File

@ -82,48 +82,44 @@ type MemberResetPwdInp struct {
Id int64 `json:"id" dc:"用户ID"`
}
// MemberEmailUniqueInp 邮箱是否唯一
type MemberEmailUniqueInp struct {
Email string `json:"email" v:"required#邮箱不能为空" dc:"邮箱"`
Id int64 `json:"id" dc:"用户ID"`
}
type MemberEmailUniqueModel struct {
IsUnique bool
}
// MemberMobileUniqueInp 手机号是否唯一
type MemberMobileUniqueInp struct {
Mobile string `json:"mobile" v:"required#手机号不能为空" dc:"手机号"`
Id int64 `json:"id" dc:"用户ID"`
}
type MemberMobileUniqueModel struct {
IsUnique bool
}
// MemberNameUniqueInp 名称是否唯一
type MemberNameUniqueInp struct {
Username string `json:"username" v:"required#用户名称不能为空" dc:"用户名称"`
Id int64 `json:"id" dc:"用户ID"`
}
type MemberNameUniqueModel struct {
IsUnique bool
type LoginMemberInfoModel struct {
Id int64 `json:"id" dc:"用户ID"`
DeptName string `json:"deptName" dc:"所属部门"`
RoleName string `json:"roleName" dc:"所属角色"`
Permissions []string `json:"permissions" dc:"角色信息"`
DeptId int64 `json:"-" dc:"部门ID"`
RoleId int64 `json:"-" dc:"角色ID"`
Username string `json:"username" dc:"用户名"`
RealName string `json:"realName" dc:"姓名"`
Avatar string `json:"avatar" dc:"头像"`
Balance float64 `json:"balance" dc:"余额"`
Integral float64 `json:"integral" dc:"积分"`
Sex int `json:"sex" dc:"性别"`
Qq string `json:"qq" dc:"qq"`
Email string `json:"email" dc:"邮箱"`
Mobile string `json:"mobile" dc:"手机号码"`
Birthday *gtime.Time `json:"birthday" dc:"生日"`
CityId int64 `json:"cityId" dc:"城市编码"`
Address string `json:"address" dc:"联系地址"`
Cash *MemberCash `json:"cash" dc:"收款信息"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
OpenId string `json:"openId" dc:"本次登录的openId"` // 区别与绑定的微信openid
InviteCode string `json:"inviteCode" dc:"邀请码"`
*MemberLoginStatModel
}
// MemberEditInp 修改/新增管理员
type MemberEditInp struct {
Id int64 `json:"id" dc:""`
RoleId int `json:"roleId" v:"required#角色不能为空" dc:"角色ID"`
PostIds []int64 `json:"postIds" v:"required#岗位不能为空" dc:"岗位ID"`
DeptId int64 `json:"deptId" v:"required#部门不能为空" dc:"部门ID"`
Username string `json:"username" v:"required#账号不能为空" dc:"帐号"`
RoleId int64 `json:"roleId" v:"required#角色不能为空" dc:"角色ID"`
PostIds []int64 `json:"postIds" v:"required#岗位不能为空" dc:"岗位ID"`
DeptId int64 `json:"deptId" v:"required#部门不能为空" dc:"部门ID"`
Username string `json:"username" v:"required#账号不能为空" dc:"帐号"`
PasswordHash string `json:"passwordHash" dc:"密码hash"`
Password string `json:"password" dc:"密码"`
RealName string `json:"realName" dc:"真实姓名"`
Avatar string `json:"avatar" dc:"头像"`
Sex string `json:"sex" dc:"性别"`
Sex int `json:"sex" dc:"性别"`
Qq string `json:"qq" dc:"qq"`
Email string `json:"email" dc:"邮箱"`
Birthday *gtime.Time `json:"birthday" dc:"生日"`
@ -133,17 +129,18 @@ type MemberEditInp struct {
Address string `json:"address" dc:"默认地址"`
Mobile string `json:"mobile" dc:"手机号码"`
Remark string `json:"remark" dc:"备注"`
Status string `json:"status" dc:"状态"`
Status int `json:"status" dc:"状态"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
}
type MemberAddInp struct {
MemberEditInp
Salt string `json:"salt" dc:"密码盐"`
Pid int64 `json:"pid" dc:"上级ID"`
Level int `json:"level" dc:"等级"`
Tree string `json:"tree" dc:"关系树"`
Salt string `json:"salt" dc:"密码盐"`
Pid int64 `json:"pid" dc:"上级ID"`
Level int `json:"level" dc:"等级"`
Tree string `json:"tree" dc:"关系树"`
InviteCode string `json:"inviteCode" dc:"邀请码"`
}
func (in *MemberEditInp) Filter(ctx context.Context) (err error) {
@ -160,6 +157,12 @@ func (in *MemberEditInp) Filter(ctx context.Context) (err error) {
type MemberEditModel struct{}
// VerifyUniqueInp 验证管理员唯一属性
type VerifyUniqueInp struct {
Id int64
Where g.Map
}
// MemberDeleteInp 删除字典类型
type MemberDeleteInp struct {
Id interface{} `json:"id" v:"required#用户ID不能为空" dc:"用户ID"`
@ -200,45 +203,6 @@ type MemberListModel struct {
DeptId int64 `json:"deptId" dc:"部门ID"`
}
// MemberLoginInp 登录
type MemberLoginInp struct {
Username string
Password string
}
type MemberLoginModel struct {
Id int64 `json:"id" dc:"用户ID"`
Token string `json:"token" dc:"登录token"`
Expires int64 `json:"expires" dc:"登录有效期"`
}
type LoginMemberInfoModel struct {
Id int64 `json:"id" dc:"用户ID"`
DeptName string `json:"deptName" dc:"所属部门"`
RoleName string `json:"roleName" dc:"所属角色"`
Permissions []string `json:"permissions" dc:"角色信息"`
DeptId int64 `json:"-" dc:"部门ID"`
RoleId int64 `json:"-" dc:"角色ID"`
Username string `json:"username" dc:"用户名"`
RealName string `json:"realName" dc:"姓名"`
Avatar string `json:"avatar" dc:"头像"`
Balance float64 `json:"balance" dc:"余额"`
Integral float64 `json:"integral" dc:"积分"`
Sex int `json:"sex" dc:"性别"`
Qq string `json:"qq" dc:"qq"`
Email string `json:"email" dc:"邮箱"`
Mobile string `json:"mobile" dc:"手机号码"`
Birthday *gtime.Time `json:"birthday" dc:"生日"`
CityId int64 `json:"cityId" dc:"城市编码"`
Address string `json:"address" dc:"联系地址"`
Cash *MemberCash `json:"cash" dc:"收款信息"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
OpenId string `json:"openId" dc:"本次登录的openId"` // 区别与绑定的微信openid
*MemberLoginStatModel
}
// MemberLoginPermissions 登录用户角色信息
type MemberLoginPermissions []string
// MemberCash 用户提现配置
type MemberCash struct {
Name string `json:"name" dc:"收款人姓名"`
@ -263,17 +227,6 @@ type MemberSelectModel struct {
Avatar string `json:"avatar" dc:"头像"`
}
// MemberLoginStatInp 用户登录统计
type MemberLoginStatInp struct {
MemberId int64
}
type MemberLoginStatModel struct {
LoginCount int `json:"loginCount" dc:"登录次数"`
LastLoginAt *gtime.Time `json:"lastLoginAt" dc:"最后登录时间"`
LastLoginIp string `json:"lastLoginIp" dc:"最后登录IP"`
}
// MemberAddBalanceInp 增加余额
type MemberAddBalanceInp struct {
Id int64 `json:"id" v:"required#用户ID不能为空" dc:"管理员ID"`

View File

@ -0,0 +1,78 @@
package adminin
import (
"context"
"github.com/gogf/gf/v2/encoding/gbase64"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"hotgo/internal/consts"
"hotgo/utility/encrypt"
)
// RegisterInp 账号注册
type RegisterInp struct {
Username string `json:"username" v:"required#用户名不能为空" dc:"用户名"`
Password string `json:"password" v:"required#密码不能为空" dc:"密码"`
Mobile string `json:"mobile" v:"required|phone-loose#手机号不能为空|手机号格式不正确" dc:"手机号"`
Code string `json:"code" v:"required#验证码不能为空" dc:"验证码"`
InviteCode string `json:"inviteCode" dc:"邀请码"`
}
func (in *RegisterInp) Filter(ctx context.Context) (err error) {
// 解密密码
str, err := gbase64.Decode([]byte(in.Password))
if err != nil {
return err
}
str, err = encrypt.AesECBDecrypt(str, consts.RequestEncryptKey)
if err != nil {
return err
}
password := string(str)
if err = g.Validator().Data(password).Rules("password").Messages("密码长度在6~18之间").Run(ctx); err != nil {
return
}
in.Password = password
return
}
// LoginModel 统一登录响应
type LoginModel struct {
Id int64 `json:"id" dc:"用户ID"`
Username string `json:"username" dc:"用户名"`
Token string `json:"token" dc:"登录token"`
Expires int64 `json:"expires" dc:"登录有效期"`
}
// AccountLoginInp 账号登录
type AccountLoginInp struct {
Username string `json:"username" v:"required#用户名不能为空" dc:"用户名"`
Password string `json:"password" v:"required#密码不能为空" dc:"密码"`
Cid string `json:"cid" dc:"验证码ID"`
Code string `json:"code" dc:"验证码"`
IsLock bool `json:"isLock" dc:"是否为锁屏状态"`
}
// MobileLoginInp 手机号登录
type MobileLoginInp struct {
Mobile string `json:"mobile" v:"required|phone-loose#手机号不能为空|手机号格式不正确" dc:"手机号"`
Code string `json:"code" v:"required#验证码不能为空" dc:"验证码"`
}
// MemberLoginPermissions 登录用户角色信息
type MemberLoginPermissions []string
// MemberLoginStatInp 用户登录统计
type MemberLoginStatInp struct {
MemberId int64
}
type MemberLoginStatModel struct {
LoginCount int `json:"loginCount" dc:"登录次数"`
LastLoginAt *gtime.Time `json:"lastLoginAt" dc:"最后登录时间"`
LastLoginIp string `json:"lastLoginIp" dc:"最后登录IP"`
}

View File

@ -88,10 +88,9 @@ type PayViewModel struct {
// PayListInp 获取支付日志列表
type PayListInp struct {
form.PageReq
Id int64 `json:"id" dc:"ID"`
Status int `json:"status" dc:"状态"`
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
TestCategoryName string `json:"testCategoryName" dc:"分类名称"`
Id int64 `json:"id" dc:"ID"`
Status int `json:"status" dc:"状态"`
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
}
func (in *PayListInp) Filter(ctx context.Context) (err error) {

View File

@ -3,7 +3,6 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package sysin
import (
@ -84,7 +83,6 @@ type LoginLogExportModel struct {
// LoginLogPushInp 解推送登录日志
type LoginLogPushInp struct {
Input adminin.MemberLoginInp
Response *adminin.MemberLoginModel
Response *adminin.LoginModel
Err error
}

View File

@ -55,8 +55,7 @@ type SmsLogListInp struct {
func (in *SmsLogListInp) Filter(ctx context.Context) (err error) {
if in.Event != "" {
_, ok := consts.SmsTemplateEventMap[in.Event]
if !ok {
if _, ok := consts.SmsTemplateEventMap[in.Event]; !ok {
err = gerror.Newf("无效的事件类型:%v", in.Event)
return
}

View File

@ -25,9 +25,11 @@ func Admin(ctx context.Context, group *ghttp.RouterGroup) {
prefix := g.Cfg().MustGet(ctx, "router.admin.prefix", "/admin")
group.Group(prefix.String(), func(group *ghttp.RouterGroup) {
group.Bind(
common.Site, // 基础
)
group.Middleware(service.Middleware().AdminAuth)
group.Bind(
common.Site, // 基础
common.Console, // 控制台
common.Ems, // 邮件
common.Sms, // 短信

View File

@ -19,17 +19,37 @@ import (
)
type (
IAdminRole interface {
Verify(ctx context.Context, path, method string) bool
List(ctx context.Context, in adminin.RoleListInp) (res *adminin.RoleListModel, totalCount int, err error)
GetName(ctx context.Context, RoleId int64) (name string, err error)
GetMemberList(ctx context.Context, RoleId int64) (list []*adminin.RoleListModel, err error)
GetPermissions(ctx context.Context, reqInfo *role.GetPermissionsReq) (MenuIds []int64, err error)
UpdatePermissions(ctx context.Context, reqInfo *role.UpdatePermissionsReq) (err error)
Edit(ctx context.Context, in *role.EditReq) (err error)
Delete(ctx context.Context, in *role.DeleteReq) (err error)
DataScopeSelect(ctx context.Context) (res form.Selects)
DataScopeEdit(ctx context.Context, in *adminin.DataScopeEditInp) (err error)
IAdminCash interface {
View(ctx context.Context, in adminin.CashViewInp) (res *adminin.CashViewModel, err error)
List(ctx context.Context, in adminin.CashListInp) (list []*adminin.CashListModel, totalCount int, err error)
Apply(ctx context.Context, in adminin.CashApplyInp) (err error)
Payment(ctx context.Context, in adminin.CashPaymentInp) (err error)
}
IAdminMenu interface {
MaxSort(ctx context.Context, req *menu.MaxSortReq) (res *menu.MaxSortRes, err error)
NameUnique(ctx context.Context, req *menu.NameUniqueReq) (res *menu.NameUniqueRes, err error)
CodeUnique(ctx context.Context, req *menu.CodeUniqueReq) (res *menu.CodeUniqueRes, err error)
Delete(ctx context.Context, req *menu.DeleteReq) (err error)
Edit(ctx context.Context, req *menu.EditReq) (err error)
View(ctx context.Context, req *menu.ViewReq) (res *menu.ViewRes, err error)
List(ctx context.Context, req *menu.ListReq) (lists []map[string]interface{}, err error)
GetMenuList(ctx context.Context, memberId int64) (lists role.DynamicRes, err error)
LoginPermissions(ctx context.Context, memberId int64) (lists adminin.MemberLoginPermissions, err error)
}
IAdminMonitor interface {
StartMonitor(ctx context.Context)
GetMeta(ctx context.Context) *model.MonitorData
}
IAdminPost interface {
Delete(ctx context.Context, in adminin.PostDeleteInp) (err error)
Edit(ctx context.Context, in adminin.PostEditInp) (err error)
MaxSort(ctx context.Context, in adminin.PostMaxSortInp) (res *adminin.PostMaxSortModel, err error)
NameUnique(ctx context.Context, in adminin.PostNameUniqueInp) (res *adminin.PostNameUniqueModel, err error)
CodeUnique(ctx context.Context, in adminin.PostCodeUniqueInp) (res *adminin.PostCodeUniqueModel, err error)
View(ctx context.Context, in adminin.PostViewInp) (res *adminin.PostViewModel, err error)
List(ctx context.Context, in adminin.PostListInp) (list []*adminin.PostListModel, totalCount int, err error)
GetMemberByStartName(ctx context.Context, memberId int64) (name string, err error)
Status(ctx context.Context, in adminin.PostStatusInp) (err error)
}
IAdminNotice interface {
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
@ -45,11 +65,35 @@ type (
ReadAll(ctx context.Context, in adminin.NoticeReadAllInp) (err error)
MessageList(ctx context.Context, in adminin.NoticeMessageListInp) (list []*adminin.NoticeMessageListModel, totalCount int, err error)
}
IAdminCash interface {
View(ctx context.Context, in adminin.CashViewInp) (res *adminin.CashViewModel, err error)
List(ctx context.Context, in adminin.CashListInp) (list []*adminin.CashListModel, totalCount int, err error)
Apply(ctx context.Context, in adminin.CashApplyInp) (err error)
Payment(ctx context.Context, in adminin.CashPaymentInp) (err error)
IAdminOrder interface {
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
AcceptRefund(ctx context.Context, in adminin.OrderAcceptRefundInp) (err error)
ApplyRefund(ctx context.Context, in adminin.OrderApplyRefundInp) (err error)
PayNotify(ctx context.Context, in payin.NotifyCallFuncInp) (err error)
Create(ctx context.Context, in adminin.OrderCreateInp) (res *adminin.OrderCreateModel, err error)
List(ctx context.Context, in adminin.OrderListInp) (list []*adminin.OrderListModel, totalCount int, err error)
Export(ctx context.Context, in adminin.OrderListInp) (err error)
Edit(ctx context.Context, in adminin.OrderEditInp) (err error)
Delete(ctx context.Context, in adminin.OrderDeleteInp) (err error)
View(ctx context.Context, in adminin.OrderViewInp) (res *adminin.OrderViewModel, err error)
Status(ctx context.Context, in adminin.OrderStatusInp) (err error)
}
IAdminRole interface {
Verify(ctx context.Context, path, method string) bool
List(ctx context.Context, in adminin.RoleListInp) (res *adminin.RoleListModel, totalCount int, err error)
GetName(ctx context.Context, RoleId int64) (name string, err error)
GetMemberList(ctx context.Context, RoleId int64) (list []*adminin.RoleListModel, err error)
GetPermissions(ctx context.Context, reqInfo *role.GetPermissionsReq) (MenuIds []int64, err error)
UpdatePermissions(ctx context.Context, reqInfo *role.UpdatePermissionsReq) (err error)
Edit(ctx context.Context, in *role.EditReq) (err error)
Delete(ctx context.Context, in *role.DeleteReq) (err error)
DataScopeSelect(ctx context.Context) (res form.Selects)
DataScopeEdit(ctx context.Context, in *adminin.DataScopeEditInp) (err error)
}
IAdminSite interface {
Register(ctx context.Context, in adminin.RegisterInp) (err error)
AccountLogin(ctx context.Context, in adminin.AccountLoginInp) (res *adminin.LoginModel, err error)
MobileLogin(ctx context.Context, in adminin.MobileLoginInp) (res *adminin.LoginModel, err error)
}
IAdminCreditsLog interface {
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
@ -78,102 +122,62 @@ type (
UpdateProfile(ctx context.Context, in adminin.MemberUpdateProfileInp) (err error)
UpdatePwd(ctx context.Context, in adminin.MemberUpdatePwdInp) (err error)
ResetPwd(ctx context.Context, in adminin.MemberResetPwdInp) (err error)
EmailUnique(ctx context.Context, in adminin.MemberEmailUniqueInp) (res *adminin.MemberEmailUniqueModel, err error)
MobileUnique(ctx context.Context, in adminin.MemberMobileUniqueInp) (res *adminin.MemberMobileUniqueModel, err error)
NameUnique(ctx context.Context, in adminin.MemberNameUniqueInp) (res *adminin.MemberNameUniqueModel, err error)
VerifySuperId(ctx context.Context, verifyId int64) bool
VerifyUnique(ctx context.Context, in adminin.VerifyUniqueInp) (err error)
Delete(ctx context.Context, in adminin.MemberDeleteInp) (err error)
Edit(ctx context.Context, in adminin.MemberEditInp) (err error)
View(ctx context.Context, in adminin.MemberViewInp) (res *adminin.MemberViewModel, err error)
List(ctx context.Context, in adminin.MemberListInp) (list []*adminin.MemberListModel, totalCount int, err error)
LoginMemberInfo(ctx context.Context) (res *adminin.LoginMemberInfoModel, err error)
Login(ctx context.Context, in adminin.MemberLoginInp) (res *adminin.MemberLoginModel, err error)
RoleMemberList(ctx context.Context, in adminin.RoleMemberListInp) (list []*adminin.MemberListModel, totalCount int, err error)
Status(ctx context.Context, in adminin.MemberStatusInp) (err error)
GenTree(ctx context.Context, pid int64) (level int, newTree string, err error)
RoleMemberList(ctx context.Context, in adminin.RoleMemberListInp) (list []*adminin.MemberListModel, totalCount int, err error)
LoginMemberInfo(ctx context.Context) (res *adminin.LoginMemberInfoModel, err error)
MemberLoginStat(ctx context.Context, in adminin.MemberLoginStatInp) (res *adminin.MemberLoginStatModel, err error)
GetIdByCode(ctx context.Context, in adminin.GetIdByCodeInp) (res *adminin.GetIdByCodeModel, err error)
Select(ctx context.Context, in adminin.MemberSelectInp) (res []*adminin.MemberSelectModel, err error)
VerifySuperId(ctx context.Context, verifyId int64) bool
FilterAuthModel(ctx context.Context, memberId int64) *gdb.Model
MemberLoginStat(ctx context.Context, in adminin.MemberLoginStatInp) (res *adminin.MemberLoginStatModel, err error)
}
IAdminMemberPost interface {
UpdatePostIds(ctx context.Context, memberId int64, postIds []int64) (err error)
GetMemberByIds(ctx context.Context, memberId int64) (postIds []int64, err error)
}
IAdminMenu interface {
MaxSort(ctx context.Context, req *menu.MaxSortReq) (res *menu.MaxSortRes, err error)
NameUnique(ctx context.Context, req *menu.NameUniqueReq) (res *menu.NameUniqueRes, err error)
CodeUnique(ctx context.Context, req *menu.CodeUniqueReq) (res *menu.CodeUniqueRes, err error)
Delete(ctx context.Context, req *menu.DeleteReq) (err error)
Edit(ctx context.Context, req *menu.EditReq) (err error)
View(ctx context.Context, req *menu.ViewReq) (res *menu.ViewRes, err error)
List(ctx context.Context, req *menu.ListReq) (lists []map[string]interface{}, err error)
GetMenuList(ctx context.Context, memberId int64) (lists role.DynamicRes, err error)
LoginPermissions(ctx context.Context, memberId int64) (lists adminin.MemberLoginPermissions, err error)
}
IAdminMonitor interface {
StartMonitor(ctx context.Context)
GetMeta(ctx context.Context) *model.MonitorData
}
IAdminOrder interface {
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
AcceptRefund(ctx context.Context, in adminin.OrderAcceptRefundInp) (err error)
ApplyRefund(ctx context.Context, in adminin.OrderApplyRefundInp) (err error)
PayNotify(ctx context.Context, in payin.NotifyCallFuncInp) (err error)
Create(ctx context.Context, in adminin.OrderCreateInp) (res *adminin.OrderCreateModel, err error)
List(ctx context.Context, in adminin.OrderListInp) (list []*adminin.OrderListModel, totalCount int, err error)
Export(ctx context.Context, in adminin.OrderListInp) (err error)
Edit(ctx context.Context, in adminin.OrderEditInp) (err error)
Delete(ctx context.Context, in adminin.OrderDeleteInp) (err error)
View(ctx context.Context, in adminin.OrderViewInp) (res *adminin.OrderViewModel, err error)
Status(ctx context.Context, in adminin.OrderStatusInp) (err error)
}
IAdminPost interface {
Delete(ctx context.Context, in adminin.PostDeleteInp) (err error)
Edit(ctx context.Context, in adminin.PostEditInp) (err error)
MaxSort(ctx context.Context, in adminin.PostMaxSortInp) (res *adminin.PostMaxSortModel, err error)
NameUnique(ctx context.Context, in adminin.PostNameUniqueInp) (res *adminin.PostNameUniqueModel, err error)
CodeUnique(ctx context.Context, in adminin.PostCodeUniqueInp) (res *adminin.PostCodeUniqueModel, err error)
View(ctx context.Context, in adminin.PostViewInp) (res *adminin.PostViewModel, err error)
List(ctx context.Context, in adminin.PostListInp) (list []*adminin.PostListModel, totalCount int, err error)
GetMemberByStartName(ctx context.Context, memberId int64) (name string, err error)
Status(ctx context.Context, in adminin.PostStatusInp) (err error)
}
)
var (
localAdminCash IAdminCash
localAdminMemberPost IAdminMemberPost
localAdminNotice IAdminNotice
localAdminOrder IAdminOrder
localAdminRole IAdminRole
localAdminSite IAdminSite
localAdminCreditsLog IAdminCreditsLog
localAdminDept IAdminDept
localAdminMember IAdminMember
localAdminMemberPost IAdminMemberPost
localAdminPost IAdminPost
localAdminCash IAdminCash
localAdminMenu IAdminMenu
localAdminMonitor IAdminMonitor
localAdminNotice IAdminNotice
localAdminOrder IAdminOrder
localAdminPost IAdminPost
localAdminRole IAdminRole
)
func AdminMenu() IAdminMenu {
if localAdminMenu == nil {
panic("implement not found for interface IAdminMenu, forgot register?")
func AdminMember() IAdminMember {
if localAdminMember == nil {
panic("implement not found for interface IAdminMember, forgot register?")
}
return localAdminMenu
return localAdminMember
}
func RegisterAdminMenu(i IAdminMenu) {
localAdminMenu = i
func RegisterAdminMember(i IAdminMember) {
localAdminMember = i
}
func AdminMonitor() IAdminMonitor {
if localAdminMonitor == nil {
panic("implement not found for interface IAdminMonitor, forgot register?")
func AdminMemberPost() IAdminMemberPost {
if localAdminMemberPost == nil {
panic("implement not found for interface IAdminMemberPost, forgot register?")
}
return localAdminMonitor
return localAdminMemberPost
}
func RegisterAdminMonitor(i IAdminMonitor) {
localAdminMonitor = i
func RegisterAdminMemberPost(i IAdminMemberPost) {
localAdminMemberPost = i
}
func AdminNotice() IAdminNotice {
@ -187,15 +191,37 @@ func RegisterAdminNotice(i IAdminNotice) {
localAdminNotice = i
}
func AdminCash() IAdminCash {
if localAdminCash == nil {
panic("implement not found for interface IAdminCash, forgot register?")
func AdminOrder() IAdminOrder {
if localAdminOrder == nil {
panic("implement not found for interface IAdminOrder, forgot register?")
}
return localAdminCash
return localAdminOrder
}
func RegisterAdminCash(i IAdminCash) {
localAdminCash = i
func RegisterAdminOrder(i IAdminOrder) {
localAdminOrder = i
}
func AdminRole() IAdminRole {
if localAdminRole == nil {
panic("implement not found for interface IAdminRole, forgot register?")
}
return localAdminRole
}
func RegisterAdminRole(i IAdminRole) {
localAdminRole = i
}
func AdminSite() IAdminSite {
if localAdminSite == nil {
panic("implement not found for interface IAdminSite, forgot register?")
}
return localAdminSite
}
func RegisterAdminSite(i IAdminSite) {
localAdminSite = i
}
func AdminCreditsLog() IAdminCreditsLog {
@ -220,37 +246,15 @@ func RegisterAdminDept(i IAdminDept) {
localAdminDept = i
}
func AdminMember() IAdminMember {
if localAdminMember == nil {
panic("implement not found for interface IAdminMember, forgot register?")
func AdminMonitor() IAdminMonitor {
if localAdminMonitor == nil {
panic("implement not found for interface IAdminMonitor, forgot register?")
}
return localAdminMember
return localAdminMonitor
}
func RegisterAdminMember(i IAdminMember) {
localAdminMember = i
}
func AdminMemberPost() IAdminMemberPost {
if localAdminMemberPost == nil {
panic("implement not found for interface IAdminMemberPost, forgot register?")
}
return localAdminMemberPost
}
func RegisterAdminMemberPost(i IAdminMemberPost) {
localAdminMemberPost = i
}
func AdminOrder() IAdminOrder {
if localAdminOrder == nil {
panic("implement not found for interface IAdminOrder, forgot register?")
}
return localAdminOrder
}
func RegisterAdminOrder(i IAdminOrder) {
localAdminOrder = i
func RegisterAdminMonitor(i IAdminMonitor) {
localAdminMonitor = i
}
func AdminPost() IAdminPost {
@ -264,13 +268,24 @@ func RegisterAdminPost(i IAdminPost) {
localAdminPost = i
}
func AdminRole() IAdminRole {
if localAdminRole == nil {
panic("implement not found for interface IAdminRole, forgot register?")
func AdminCash() IAdminCash {
if localAdminCash == nil {
panic("implement not found for interface IAdminCash, forgot register?")
}
return localAdminRole
return localAdminCash
}
func RegisterAdminRole(i IAdminRole) {
localAdminRole = i
func RegisterAdminCash(i IAdminCash) {
localAdminCash = i
}
func AdminMenu() IAdminMenu {
if localAdminMenu == nil {
panic("implement not found for interface IAdminMenu, forgot register?")
}
return localAdminMenu
}
func RegisterAdminMenu(i IAdminMenu) {
localAdminMenu = i
}

View File

@ -17,20 +17,112 @@ import (
)
type (
ISysBlacklist interface {
Delete(ctx context.Context, in sysin.BlacklistDeleteInp) (err error)
Edit(ctx context.Context, in sysin.BlacklistEditInp) (err error)
Status(ctx context.Context, in sysin.BlacklistStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.BlacklistMaxSortInp) (res *sysin.BlacklistMaxSortModel, err error)
View(ctx context.Context, in sysin.BlacklistViewInp) (res *sysin.BlacklistViewModel, err error)
List(ctx context.Context, in sysin.BlacklistListInp) (list []*sysin.BlacklistListModel, totalCount int, err error)
VariableLoad(ctx context.Context, err error)
Load(ctx context.Context)
}
ISysCronGroup interface {
Delete(ctx context.Context, in sysin.CronGroupDeleteInp) (err error)
Edit(ctx context.Context, in sysin.CronGroupEditInp) (err error)
Status(ctx context.Context, in sysin.CronGroupStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.CronGroupMaxSortInp) (res *sysin.CronGroupMaxSortModel, err error)
View(ctx context.Context, in sysin.CronGroupViewInp) (res *sysin.CronGroupViewModel, err error)
List(ctx context.Context, in sysin.CronGroupListInp) (list []*sysin.CronGroupListModel, totalCount int, err error)
Select(ctx context.Context, in sysin.CronGroupSelectInp) (res *sysin.CronGroupSelectModel, err error)
}
ISysGenCodes interface {
Delete(ctx context.Context, in sysin.GenCodesDeleteInp) (err error)
Edit(ctx context.Context, in sysin.GenCodesEditInp) (res *sysin.GenCodesEditModel, err error)
Status(ctx context.Context, in sysin.GenCodesStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.GenCodesMaxSortInp) (res *sysin.GenCodesMaxSortModel, err error)
View(ctx context.Context, in sysin.GenCodesViewInp) (res *sysin.GenCodesViewModel, err error)
List(ctx context.Context, in sysin.GenCodesListInp) (list []*sysin.GenCodesListModel, totalCount int, err error)
Selects(ctx context.Context, in sysin.GenCodesSelectsInp) (res *sysin.GenCodesSelectsModel, err error)
TableSelect(ctx context.Context, in sysin.GenCodesTableSelectInp) (res []*sysin.GenCodesTableSelectModel, err error)
ColumnSelect(ctx context.Context, in sysin.GenCodesColumnSelectInp) (res []*sysin.GenCodesColumnSelectModel, err error)
ColumnList(ctx context.Context, in sysin.GenCodesColumnListInp) (res []*sysin.GenCodesColumnListModel, err error)
Preview(ctx context.Context, in sysin.GenCodesPreviewInp) (res *sysin.GenCodesPreviewModel, err error)
Build(ctx context.Context, in sysin.GenCodesBuildInp) (err error)
}
ISysLoginLog interface {
Model(ctx context.Context) *gdb.Model
List(ctx context.Context, in sysin.LoginLogListInp) (list []*sysin.LoginLogListModel, totalCount int, err error)
Export(ctx context.Context, in sysin.LoginLogListInp) (err error)
Delete(ctx context.Context, in sysin.LoginLogDeleteInp) (err error)
View(ctx context.Context, in sysin.LoginLogViewInp) (res *sysin.LoginLogViewModel, err error)
Push(ctx context.Context, in sysin.LoginLogPushInp)
RealWrite(ctx context.Context, models entity.SysLoginLog) (err error)
}
ISysAddonsConfig interface {
GetConfigByGroup(ctx context.Context, in sysin.GetAddonsConfigInp) (res *sysin.GetAddonsConfigModel, err error)
ConversionType(ctx context.Context, models *entity.SysAddonsConfig) (value interface{}, err error)
UpdateConfigByGroup(ctx context.Context, in sysin.UpdateAddonsConfigInp) (err error)
}
ISysCron interface {
StartCron(ctx context.Context)
Delete(ctx context.Context, in sysin.CronDeleteInp) (err error)
Edit(ctx context.Context, in sysin.CronEditInp) (err error)
Status(ctx context.Context, in sysin.CronStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.CronMaxSortInp) (res *sysin.CronMaxSortModel, err error)
View(ctx context.Context, in sysin.CronViewInp) (res *sysin.CronViewModel, err error)
List(ctx context.Context, in sysin.CronListInp) (list []*sysin.CronListModel, totalCount int, err error)
OnlineExec(ctx context.Context, in sysin.OnlineExecInp) (err error)
ISysAttachment interface {
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
Delete(ctx context.Context, in sysin.AttachmentDeleteInp) (err error)
Edit(ctx context.Context, in sysin.AttachmentEditInp) (err error)
Status(ctx context.Context, in sysin.AttachmentStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.AttachmentMaxSortInp) (res *sysin.AttachmentMaxSortModel, err error)
View(ctx context.Context, in sysin.AttachmentViewInp) (res *sysin.AttachmentViewModel, err error)
List(ctx context.Context, in sysin.AttachmentListInp) (list []*sysin.AttachmentListModel, totalCount int, err error)
Add(ctx context.Context, meta *sysin.UploadFileMeta, fullPath, drive string) (models *entity.SysAttachment, err error)
}
ISysConfig interface {
InitConfig(ctx context.Context)
GetLogin(ctx context.Context) (conf *model.LoginConfig, err error)
GetWechat(ctx context.Context) (conf *model.WechatConfig, err error)
GetPay(ctx context.Context) (conf *model.PayConfig, err error)
GetSms(ctx context.Context) (conf *model.SmsConfig, err error)
GetGeo(ctx context.Context) (conf *model.GeoConfig, err error)
GetUpload(ctx context.Context) (conf *model.UploadConfig, err error)
GetSmtp(ctx context.Context) (conf *model.EmailConfig, err error)
GetBasic(ctx context.Context) (conf *model.BasicConfig, err error)
GetLoadTCP(ctx context.Context) (conf *model.TCPConfig, err error)
GetLoadCache(ctx context.Context) (conf *model.CacheConfig, err error)
GetLoadGenerate(ctx context.Context) (conf *model.GenerateConfig, err error)
GetLoadToken(ctx context.Context) (conf *model.TokenConfig, err error)
GetLoadSSL(ctx context.Context) (conf *model.SSLConfig, err error)
GetLoadLog(ctx context.Context) (conf *model.LogConfig, err error)
GetLoadServeLog(ctx context.Context) (conf *model.ServeLogConfig, err error)
GetConfigByGroup(ctx context.Context, in sysin.GetConfigInp) (res *sysin.GetConfigModel, err error)
ConversionType(ctx context.Context, models *entity.SysConfig) (value interface{}, err error)
UpdateConfigByGroup(ctx context.Context, in sysin.UpdateConfigInp) (err error)
}
ISysLog interface {
Export(ctx context.Context, in sysin.LogListInp) (err error)
RealWrite(ctx context.Context, log entity.SysLog) (err error)
AutoLog(ctx context.Context) error
AnalysisLog(ctx context.Context) entity.SysLog
View(ctx context.Context, in sysin.LogViewInp) (res *sysin.LogViewModel, err error)
Delete(ctx context.Context, in sysin.LogDeleteInp) (err error)
List(ctx context.Context, in sysin.LogListInp) (list []*sysin.LogListModel, totalCount int, err error)
}
ISysServeLog interface {
Model(ctx context.Context) *gdb.Model
List(ctx context.Context, in sysin.ServeLogListInp) (list []*sysin.ServeLogListModel, totalCount int, err error)
Export(ctx context.Context, in sysin.ServeLogListInp) (err error)
Delete(ctx context.Context, in sysin.ServeLogDeleteInp) (err error)
View(ctx context.Context, in sysin.ServeLogViewInp) (res *sysin.ServeLogViewModel, err error)
RealWrite(ctx context.Context, models entity.SysServeLog) (err error)
}
ISysDictData interface {
Delete(ctx context.Context, in sysin.DictDataDeleteInp) error
Edit(ctx context.Context, in sysin.DictDataEditInp) (err error)
List(ctx context.Context, in sysin.DictDataListInp) (list []*sysin.DictDataListModel, totalCount int, err error)
Select(ctx context.Context, in sysin.DataSelectInp) (list sysin.DataSelectModel, err error)
}
ISysDictType interface {
Tree(ctx context.Context) (list []*sysin.DictTypeTree, err error)
Delete(ctx context.Context, in sysin.DictTypeDeleteInp) (err error)
Edit(ctx context.Context, in sysin.DictTypeEditInp) (err error)
TreeSelect(ctx context.Context, in sysin.DictTreeSelectInp) (list []*sysin.DictTypeTree, err error)
}
ISysCurdDemo interface {
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
@ -43,27 +135,6 @@ type (
Status(ctx context.Context, in sysin.CurdDemoStatusInp) (err error)
Switch(ctx context.Context, in sysin.CurdDemoSwitchInp) (err error)
}
ISysDictType interface {
Tree(ctx context.Context) (list []*sysin.DictTypeTree, err error)
Delete(ctx context.Context, in sysin.DictTypeDeleteInp) (err error)
Edit(ctx context.Context, in sysin.DictTypeEditInp) (err error)
TreeSelect(ctx context.Context, in sysin.DictTreeSelectInp) (list []*sysin.DictTypeTree, err error)
}
ISysCronGroup interface {
Delete(ctx context.Context, in sysin.CronGroupDeleteInp) (err error)
Edit(ctx context.Context, in sysin.CronGroupEditInp) (err error)
Status(ctx context.Context, in sysin.CronGroupStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.CronGroupMaxSortInp) (res *sysin.CronGroupMaxSortModel, err error)
View(ctx context.Context, in sysin.CronGroupViewInp) (res *sysin.CronGroupViewModel, err error)
List(ctx context.Context, in sysin.CronGroupListInp) (list []*sysin.CronGroupListModel, totalCount int, err error)
Select(ctx context.Context, in sysin.CronGroupSelectInp) (res *sysin.CronGroupSelectModel, err error)
}
ISysDictData interface {
Delete(ctx context.Context, in sysin.DictDataDeleteInp) error
Edit(ctx context.Context, in sysin.DictDataEditInp) (err error)
List(ctx context.Context, in sysin.DictDataListInp) (list []*sysin.DictDataListModel, totalCount int, err error)
Select(ctx context.Context, in sysin.DataSelectInp) (list sysin.DataSelectModel, err error)
}
ISysEmsLog interface {
Delete(ctx context.Context, in sysin.EmsLogDeleteInp) (err error)
Edit(ctx context.Context, in sysin.EmsLogEditInp) (err error)
@ -75,14 +146,17 @@ type (
AllowSend(ctx context.Context, models *entity.SysEmsLog, config *model.EmailConfig) (err error)
VerifyCode(ctx context.Context, in sysin.VerifyEmsCodeInp) (err error)
}
ISysLog interface {
Export(ctx context.Context, in sysin.LogListInp) (err error)
RealWrite(ctx context.Context, log entity.SysLog) (err error)
AutoLog(ctx context.Context) error
AnalysisLog(ctx context.Context) entity.SysLog
View(ctx context.Context, in sysin.LogViewInp) (res *sysin.LogViewModel, err error)
Delete(ctx context.Context, in sysin.LogDeleteInp) (err error)
List(ctx context.Context, in sysin.LogListInp) (list []*sysin.LogListModel, totalCount int, err error)
ISysProvinces interface {
Tree(ctx context.Context) (list []g.Map, err error)
Delete(ctx context.Context, in sysin.ProvincesDeleteInp) (err error)
Edit(ctx context.Context, in sysin.ProvincesEditInp) (err error)
Status(ctx context.Context, in sysin.ProvincesStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.ProvincesMaxSortInp) (res *sysin.ProvincesMaxSortModel, err error)
View(ctx context.Context, in sysin.ProvincesViewInp) (res *sysin.ProvincesViewModel, err error)
List(ctx context.Context, in sysin.ProvincesListInp) (list []*sysin.ProvincesListModel, totalCount int, err error)
ChildrenList(ctx context.Context, in sysin.ProvincesChildrenListInp) (list []*sysin.ProvincesChildrenListModel, totalCount int, err error)
UniqueId(ctx context.Context, in sysin.ProvincesUniqueIdInp) (res *sysin.ProvincesUniqueIdModel, err error)
Select(ctx context.Context, in sysin.ProvincesSelectInp) (res *sysin.ProvincesSelectModel, err error)
}
ISysSmsLog interface {
Delete(ctx context.Context, in sysin.SmsLogDeleteInp) (err error)
@ -104,142 +178,47 @@ type (
Upgrade(ctx context.Context, in sysin.AddonsUpgradeInp) (err error)
UnInstall(ctx context.Context, in sysin.AddonsUnInstallInp) (err error)
}
ISysConfig interface {
InitConfig(ctx context.Context)
GetLoadTCP(ctx context.Context) (conf *model.TCPConfig, err error)
GetLoadCache(ctx context.Context) (conf *model.CacheConfig, err error)
GetLoadGenerate(ctx context.Context) (conf *model.GenerateConfig, err error)
GetLoadToken(ctx context.Context) (conf *model.TokenConfig, err error)
GetWechat(ctx context.Context) (conf *model.WechatConfig, err error)
GetPay(ctx context.Context) (conf *model.PayConfig, err error)
GetSms(ctx context.Context) (conf *model.SmsConfig, err error)
GetGeo(ctx context.Context) (conf *model.GeoConfig, err error)
GetUpload(ctx context.Context) (conf *model.UploadConfig, err error)
GetSmtp(ctx context.Context) (conf *model.EmailConfig, err error)
GetBasic(ctx context.Context) (conf *model.BasicConfig, err error)
GetLoadSSL(ctx context.Context) (conf *model.SSLConfig, err error)
GetLoadLog(ctx context.Context) (conf *model.LogConfig, err error)
GetLoadServeLog(ctx context.Context) (conf *model.ServeLogConfig, err error)
GetConfigByGroup(ctx context.Context, in sysin.GetConfigInp) (res *sysin.GetConfigModel, err error)
ConversionType(ctx context.Context, models *entity.SysConfig) (value interface{}, err error)
UpdateConfigByGroup(ctx context.Context, in sysin.UpdateConfigInp) (err error)
}
ISysLoginLog interface {
Model(ctx context.Context) *gdb.Model
List(ctx context.Context, in sysin.LoginLogListInp) (list []*sysin.LoginLogListModel, totalCount int, err error)
Export(ctx context.Context, in sysin.LoginLogListInp) (err error)
Delete(ctx context.Context, in sysin.LoginLogDeleteInp) (err error)
View(ctx context.Context, in sysin.LoginLogViewInp) (res *sysin.LoginLogViewModel, err error)
Push(ctx context.Context, in sysin.LoginLogPushInp)
RealWrite(ctx context.Context, models entity.SysLoginLog) (err error)
}
ISysProvinces interface {
Tree(ctx context.Context) (list []g.Map, err error)
Delete(ctx context.Context, in sysin.ProvincesDeleteInp) (err error)
Edit(ctx context.Context, in sysin.ProvincesEditInp) (err error)
Status(ctx context.Context, in sysin.ProvincesStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.ProvincesMaxSortInp) (res *sysin.ProvincesMaxSortModel, err error)
View(ctx context.Context, in sysin.ProvincesViewInp) (res *sysin.ProvincesViewModel, err error)
List(ctx context.Context, in sysin.ProvincesListInp) (list []*sysin.ProvincesListModel, totalCount int, err error)
ChildrenList(ctx context.Context, in sysin.ProvincesChildrenListInp) (list []*sysin.ProvincesChildrenListModel, totalCount int, err error)
UniqueId(ctx context.Context, in sysin.ProvincesUniqueIdInp) (res *sysin.ProvincesUniqueIdModel, err error)
Select(ctx context.Context, in sysin.ProvincesSelectInp) (res *sysin.ProvincesSelectModel, err error)
}
ISysServeLog interface {
Model(ctx context.Context) *gdb.Model
List(ctx context.Context, in sysin.ServeLogListInp) (list []*sysin.ServeLogListModel, totalCount int, err error)
Export(ctx context.Context, in sysin.ServeLogListInp) (err error)
Delete(ctx context.Context, in sysin.ServeLogDeleteInp) (err error)
View(ctx context.Context, in sysin.ServeLogViewInp) (res *sysin.ServeLogViewModel, err error)
RealWrite(ctx context.Context, models entity.SysServeLog) (err error)
}
ISysAttachment interface {
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
Delete(ctx context.Context, in sysin.AttachmentDeleteInp) (err error)
Edit(ctx context.Context, in sysin.AttachmentEditInp) (err error)
Status(ctx context.Context, in sysin.AttachmentStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.AttachmentMaxSortInp) (res *sysin.AttachmentMaxSortModel, err error)
View(ctx context.Context, in sysin.AttachmentViewInp) (res *sysin.AttachmentViewModel, err error)
List(ctx context.Context, in sysin.AttachmentListInp) (list []*sysin.AttachmentListModel, totalCount int, err error)
Add(ctx context.Context, meta *sysin.UploadFileMeta, fullPath, drive string) (models *entity.SysAttachment, err error)
}
ISysBlacklist interface {
Delete(ctx context.Context, in sysin.BlacklistDeleteInp) (err error)
Edit(ctx context.Context, in sysin.BlacklistEditInp) (err error)
Status(ctx context.Context, in sysin.BlacklistStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.BlacklistMaxSortInp) (res *sysin.BlacklistMaxSortModel, err error)
View(ctx context.Context, in sysin.BlacklistViewInp) (res *sysin.BlacklistViewModel, err error)
List(ctx context.Context, in sysin.BlacklistListInp) (list []*sysin.BlacklistListModel, totalCount int, err error)
VariableLoad(ctx context.Context, err error)
Load(ctx context.Context)
}
ISysGenCodes interface {
Delete(ctx context.Context, in sysin.GenCodesDeleteInp) (err error)
Edit(ctx context.Context, in sysin.GenCodesEditInp) (res *sysin.GenCodesEditModel, err error)
Status(ctx context.Context, in sysin.GenCodesStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.GenCodesMaxSortInp) (res *sysin.GenCodesMaxSortModel, err error)
View(ctx context.Context, in sysin.GenCodesViewInp) (res *sysin.GenCodesViewModel, err error)
List(ctx context.Context, in sysin.GenCodesListInp) (list []*sysin.GenCodesListModel, totalCount int, err error)
Selects(ctx context.Context, in sysin.GenCodesSelectsInp) (res *sysin.GenCodesSelectsModel, err error)
TableSelect(ctx context.Context, in sysin.GenCodesTableSelectInp) (res []*sysin.GenCodesTableSelectModel, err error)
ColumnSelect(ctx context.Context, in sysin.GenCodesColumnSelectInp) (res []*sysin.GenCodesColumnSelectModel, err error)
ColumnList(ctx context.Context, in sysin.GenCodesColumnListInp) (res []*sysin.GenCodesColumnListModel, err error)
Preview(ctx context.Context, in sysin.GenCodesPreviewInp) (res *sysin.GenCodesPreviewModel, err error)
Build(ctx context.Context, in sysin.GenCodesBuildInp) (err error)
ISysCron interface {
StartCron(ctx context.Context)
Delete(ctx context.Context, in sysin.CronDeleteInp) (err error)
Edit(ctx context.Context, in sysin.CronEditInp) (err error)
Status(ctx context.Context, in sysin.CronStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.CronMaxSortInp) (res *sysin.CronMaxSortModel, err error)
View(ctx context.Context, in sysin.CronViewInp) (res *sysin.CronViewModel, err error)
List(ctx context.Context, in sysin.CronListInp) (list []*sysin.CronListModel, totalCount int, err error)
OnlineExec(ctx context.Context, in sysin.OnlineExecInp) (err error)
}
)
var (
localSysEmsLog ISysEmsLog
localSysLog ISysLog
localSysSmsLog ISysSmsLog
localSysCronGroup ISysCronGroup
localSysDictData ISysDictData
localSysLoginLog ISysLoginLog
localSysProvinces ISysProvinces
localSysDictType ISysDictType
localSysLog ISysLog
localSysServeLog ISysServeLog
localSysProvinces ISysProvinces
localSysSmsLog ISysSmsLog
localSysAddons ISysAddons
localSysConfig ISysConfig
localSysCron ISysCron
localSysCurdDemo ISysCurdDemo
localSysEmsLog ISysEmsLog
localSysGenCodes ISysGenCodes
localSysLoginLog ISysLoginLog
localSysAddonsConfig ISysAddonsConfig
localSysAttachment ISysAttachment
localSysBlacklist ISysBlacklist
localSysCurdDemo ISysCurdDemo
localSysDictType ISysDictType
localSysAddonsConfig ISysAddonsConfig
localSysCron ISysCron
localSysCronGroup ISysCronGroup
localSysConfig ISysConfig
)
func SysAddonsConfig() ISysAddonsConfig {
if localSysAddonsConfig == nil {
panic("implement not found for interface ISysAddonsConfig, forgot register?")
func SysDictData() ISysDictData {
if localSysDictData == nil {
panic("implement not found for interface ISysDictData, forgot register?")
}
return localSysAddonsConfig
return localSysDictData
}
func RegisterSysAddonsConfig(i ISysAddonsConfig) {
localSysAddonsConfig = i
}
func SysCron() ISysCron {
if localSysCron == nil {
panic("implement not found for interface ISysCron, forgot register?")
}
return localSysCron
}
func RegisterSysCron(i ISysCron) {
localSysCron = i
}
func SysCurdDemo() ISysCurdDemo {
if localSysCurdDemo == nil {
panic("implement not found for interface ISysCurdDemo, forgot register?")
}
return localSysCurdDemo
}
func RegisterSysCurdDemo(i ISysCurdDemo) {
localSysCurdDemo = i
func RegisterSysDictData(i ISysDictData) {
localSysDictData = i
}
func SysDictType() ISysDictType {
@ -253,39 +232,6 @@ func RegisterSysDictType(i ISysDictType) {
localSysDictType = i
}
func SysCronGroup() ISysCronGroup {
if localSysCronGroup == nil {
panic("implement not found for interface ISysCronGroup, forgot register?")
}
return localSysCronGroup
}
func RegisterSysCronGroup(i ISysCronGroup) {
localSysCronGroup = i
}
func SysDictData() ISysDictData {
if localSysDictData == nil {
panic("implement not found for interface ISysDictData, forgot register?")
}
return localSysDictData
}
func RegisterSysDictData(i ISysDictData) {
localSysDictData = i
}
func SysEmsLog() ISysEmsLog {
if localSysEmsLog == nil {
panic("implement not found for interface ISysEmsLog, forgot register?")
}
return localSysEmsLog
}
func RegisterSysEmsLog(i ISysEmsLog) {
localSysEmsLog = i
}
func SysLog() ISysLog {
if localSysLog == nil {
panic("implement not found for interface ISysLog, forgot register?")
@ -297,6 +243,28 @@ func RegisterSysLog(i ISysLog) {
localSysLog = i
}
func SysServeLog() ISysServeLog {
if localSysServeLog == nil {
panic("implement not found for interface ISysServeLog, forgot register?")
}
return localSysServeLog
}
func RegisterSysServeLog(i ISysServeLog) {
localSysServeLog = i
}
func SysProvinces() ISysProvinces {
if localSysProvinces == nil {
panic("implement not found for interface ISysProvinces, forgot register?")
}
return localSysProvinces
}
func RegisterSysProvinces(i ISysProvinces) {
localSysProvinces = i
}
func SysSmsLog() ISysSmsLog {
if localSysSmsLog == nil {
panic("implement not found for interface ISysSmsLog, forgot register?")
@ -319,15 +287,48 @@ func RegisterSysAddons(i ISysAddons) {
localSysAddons = i
}
func SysConfig() ISysConfig {
if localSysConfig == nil {
panic("implement not found for interface ISysConfig, forgot register?")
func SysCron() ISysCron {
if localSysCron == nil {
panic("implement not found for interface ISysCron, forgot register?")
}
return localSysConfig
return localSysCron
}
func RegisterSysConfig(i ISysConfig) {
localSysConfig = i
func RegisterSysCron(i ISysCron) {
localSysCron = i
}
func SysCurdDemo() ISysCurdDemo {
if localSysCurdDemo == nil {
panic("implement not found for interface ISysCurdDemo, forgot register?")
}
return localSysCurdDemo
}
func RegisterSysCurdDemo(i ISysCurdDemo) {
localSysCurdDemo = i
}
func SysEmsLog() ISysEmsLog {
if localSysEmsLog == nil {
panic("implement not found for interface ISysEmsLog, forgot register?")
}
return localSysEmsLog
}
func RegisterSysEmsLog(i ISysEmsLog) {
localSysEmsLog = i
}
func SysGenCodes() ISysGenCodes {
if localSysGenCodes == nil {
panic("implement not found for interface ISysGenCodes, forgot register?")
}
return localSysGenCodes
}
func RegisterSysGenCodes(i ISysGenCodes) {
localSysGenCodes = i
}
func SysLoginLog() ISysLoginLog {
@ -341,26 +342,15 @@ func RegisterSysLoginLog(i ISysLoginLog) {
localSysLoginLog = i
}
func SysProvinces() ISysProvinces {
if localSysProvinces == nil {
panic("implement not found for interface ISysProvinces, forgot register?")
func SysAddonsConfig() ISysAddonsConfig {
if localSysAddonsConfig == nil {
panic("implement not found for interface ISysAddonsConfig, forgot register?")
}
return localSysProvinces
return localSysAddonsConfig
}
func RegisterSysProvinces(i ISysProvinces) {
localSysProvinces = i
}
func SysServeLog() ISysServeLog {
if localSysServeLog == nil {
panic("implement not found for interface ISysServeLog, forgot register?")
}
return localSysServeLog
}
func RegisterSysServeLog(i ISysServeLog) {
localSysServeLog = i
func RegisterSysAddonsConfig(i ISysAddonsConfig) {
localSysAddonsConfig = i
}
func SysAttachment() ISysAttachment {
@ -385,13 +375,24 @@ func RegisterSysBlacklist(i ISysBlacklist) {
localSysBlacklist = i
}
func SysGenCodes() ISysGenCodes {
if localSysGenCodes == nil {
panic("implement not found for interface ISysGenCodes, forgot register?")
func SysCronGroup() ISysCronGroup {
if localSysCronGroup == nil {
panic("implement not found for interface ISysCronGroup, forgot register?")
}
return localSysGenCodes
return localSysCronGroup
}
func RegisterSysGenCodes(i ISysGenCodes) {
localSysGenCodes = i
func RegisterSysCronGroup(i ISysCronGroup) {
localSysCronGroup = i
}
func SysConfig() ISysConfig {
if localSysConfig == nil {
panic("implement not found for interface ISysConfig, forgot register?")
}
return localSysConfig
}
func RegisterSysConfig(i ISysConfig) {
localSysConfig = i
}

View File

@ -109,14 +109,11 @@ router:
prefix: "/admin"
# 不需要验证登录的路由地址
exceptLogin: [
"/site/captcha", # 登录验证码
"/site/login", # 登录
"/site/ping", # ping
"/sms/send", # 短信验证码
"/wechat/authorizeCall", # 微信用户授权回调
]
# 不需要验证权限的路由地址
exceptAuth: [
"/site/config", # 获取后台配置
"/member/info", # 登录用户信息
"/role/dynamic", # 获取动态路由
"/notice/pullMessages", # 拉取我的消息

View File

@ -140,7 +140,7 @@ func (s *s@{.servFunName}) Status(ctx context.Context, in @{.templateGroup}in.@{
return
}
if !validate.InSliceInt(consts.StatusMap, in.Status) {
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}

View File

@ -1,14 +1,13 @@
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- 主机 localhost:3306
-- 生成日期 2023-05-12 15:45:52
-- 服务器版本 5.7.38-log
-- PHP 版本 5.6.40
-- 主机 localhost
-- 生成日期 2023-05-14 08:51:30
-- 服务器版本 5.7.41
-- PHP 版本 7.3.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
@ -73,8 +72,8 @@ CREATE TABLE `hg_addon_hgexample_table` (
--
INSERT INTO `hg_addon_hgexample_table` (`id`, `category_id`, `flag`, `title`, `description`, `content`, `image`, `images`, `attachfile`, `attachfiles`, `map`, `star`, `price`, `views`, `activity_at`, `start_at`, `end_at`, `switch`, `sort`, `avatar`, `sex`, `qq`, `email`, `mobile`, `hobby`, `channel`, `city_id`, `pid`, `level`, `tree`, `remark`, `status`, `created_by`, `updated_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, '[1, 2]', '测试标题', '描述', '<p>这是内容............</p>', 'http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqamvhlq4w3ki6bl.webp', '[\"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqap5l9brk2lkavu.jpg\", \"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqaqua7fw8ukbbp5.jpg\"]', 'http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqaup19k9oznyixz.doc', '[\"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqawg96ba4cuezvv.xlsx\", \"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqaup19k9oznyixz.doc\"]', '[{\"key\": \"qwe\", \"value\": \"123\"}, {\"key\": \"asd\", \"value\": \"456\"}]', '3.0', '88.00', 10, '2022-12-23', '2022-12-01 00:00:00', '2022-12-31 23:59:59', 1, 20, '', 15, '133814250', '133814250@qq.com', '15303830571', '[3, 2, 1]', 1, 140406, 0, 1, '', '备注!', 1, 1, 3, '2022-12-15 19:30:14', '2023-04-28 16:46:17', NULL),
(2, 0, '[1]', '测试2', '描述', '<h2><strong>不知道写点啥</strong></h2><p><br></p><p><img src=\"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqbknawlkgdttuxl.png\"></p>', 'http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqbmxmtaq06gbnqa.jpeg', '[\"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqborf529kf4cxbm.jpeg\"]', 'http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqawg96ba4cuezvv.xlsx', '[\"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqaup19k9oznyixz.doc\"]', '{}', '2.5', '10.00', 0, '2023-02-18', NULL, NULL, 2, 30, '', 0, '', '1561561@qq.com', '15303830571', '[2, 1]', 3, 140214, 0, 1, '', '', 1, 1, 1, '2023-02-06 14:17:11', '2023-02-23 13:59:01', NULL);
(1, 1, '[1, 2]', '测试标题', '描述', '<p>这是内容............</p>', 'http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqamvhlq4w3ki6bl.webp', '[\"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqap5l9brk2lkavu.jpg\", \"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqaqua7fw8ukbbp5.jpg\"]', 'http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqaup19k9oznyixz.doc', '[\"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqawg96ba4cuezvv.xlsx\", \"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqaup19k9oznyixz.doc\"]', '[{\"key\": \"qwe\", \"value\": \"123\"}, {\"key\": \"asd\", \"value\": \"456\"}]', 3.0, 88.00, 10, '2022-12-23', '2022-12-01 00:00:00', '2022-12-31 23:59:59', 1, 20, '', 15, '133814250', '133814250@qq.com', '15303830571', '[3, 2, 1]', 1, 140406, 0, 1, '', '备注!', 1, 1, 3, '2022-12-15 19:30:14', '2023-04-28 16:46:17', NULL),
(2, 0, '[1]', '测试2', '描述', '<h2><strong>不知道写点啥</strong></h2><p><br></p><p><img src=\"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqbknawlkgdttuxl.png\"></p>', 'http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqbmxmtaq06gbnqa.jpeg', '[\"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqborf529kf4cxbm.jpeg\"]', 'http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqawg96ba4cuezvv.xlsx', '[\"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdqaup19k9oznyixz.doc\"]', '{}', 2.5, 10.00, 0, '2023-02-18', NULL, NULL, 2, 30, '', 0, '', '1561561@qq.com', '15303830571', '[2, 1]', 3, 140214, 0, 1, '', '', 1, 1, 1, '2023-02-06 14:17:11', '2023-02-23 13:59:01', NULL);
-- --------------------------------------------------------
@ -185,6 +184,7 @@ CREATE TABLE `hg_admin_member` (
`pid` bigint(20) NOT NULL COMMENT '上级管理员ID',
`level` int(11) DEFAULT '1' COMMENT '关系树等级',
`tree` varchar(512) NOT NULL COMMENT '关系树',
`invite_code` varchar(12) DEFAULT NULL COMMENT '邀请码',
`cash` json DEFAULT NULL COMMENT '提现配置',
`last_active_at` datetime DEFAULT NULL COMMENT '最后活跃时间',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
@ -197,10 +197,10 @@ CREATE TABLE `hg_admin_member` (
-- 转存表中的数据 `hg_admin_member`
--
INSERT INTO `hg_admin_member` (`id`, `dept_id`, `role_id`, `real_name`, `username`, `password_hash`, `salt`, `password_reset_token`, `integral`, `balance`, `avatar`, `sex`, `qq`, `email`, `mobile`, `birthday`, `city_id`, `address`, `pid`, `level`, `tree`, `cash`, `last_active_at`, `remark`, `status`, `created_at`, `updated_at`) VALUES
(1, 100, 1, '孟帅', 'admin', 'a7c588fffeb2c1d99b29879d7fe97c78', '6541561', '', '89.00', '99391.78', 'http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdq8er9nfkchdopav.png', 1, '133814250', '133814250@qq.com', '15303830571', '2016-04-16', 410172, '莲花街001号', 0, 1, '', '{\"name\": \"孟帅\", \"account\": \"15303830571\", \"payeeCode\": \"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdq8mqal5isvcb58g.jpg\"}', '2023-05-12 15:44:12', NULL, 1, '2021-02-12 17:59:45', '2023-05-12 15:44:12'),
(3, 100, 2, '测试账号', 'test', 'a7c588fffeb2c1d99b29879d7fe97c78', '6541561', '', '0.00', '4.00', 'http://alioss.qvnidaye.com//images/2021/03/12/image_1615529198_vMK4kwq2.jpg', 1, '', 'c@qq.cc', '15303888888', '2016-04-13', 371100, '大潮街道666号', 1, 2, 'tr_1 ', NULL, '2023-04-29 10:20:16', '', 1, '2022-02-11 17:59:45', '2023-04-29 10:20:16'),
(8, 101, 200, 'ameng', 'ameng', '382df3b083a27886edb94e669a857c33', 'hfuUEb', '', '11.00', '3.22', '', 1, '', '', '', NULL, 0, '', 1, 2, 'tr_1 ', NULL, '2023-04-30 20:04:06', '', 1, '2023-02-03 17:34:31', '2023-04-30 20:04:06');
INSERT INTO `hg_admin_member` (`id`, `dept_id`, `role_id`, `real_name`, `username`, `password_hash`, `salt`, `password_reset_token`, `integral`, `balance`, `avatar`, `sex`, `qq`, `email`, `mobile`, `birthday`, `city_id`, `address`, `pid`, `level`, `tree`, `invite_code`, `cash`, `last_active_at`, `remark`, `status`, `created_at`, `updated_at`) VALUES
(1, 100, 1, '孟帅', 'admin', 'a7c588fffeb2c1d99b29879d7fe97c78', '6541561', '', 89.00, 99391.78, 'http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdq8er9nfkchdopav.png', 1, '133814250', '133814250@qq.com', '15303830571', '2016-04-16', 410172, '莲花街001号', 0, 1, '', '111', '{\"name\": \"孟帅\", \"account\": \"15303830571\", \"payeeCode\": \"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdq8mqal5isvcb58g.jpg\"}', '2023-05-14 16:44:27', NULL, 1, '2021-02-12 17:59:45', '2023-05-14 16:44:27'),
(3, 100, 2, '测试账号', 'test', 'a7c588fffeb2c1d99b29879d7fe97c78', '6541561', '', 0.00, 4.00, 'http://alioss.qvnidaye.com//images/2021/03/12/image_1615529198_vMK4kwq2.jpg', 1, '', 'c@qq.cc', '15303888888', '2016-04-13', 371100, '大潮街道666号', 1, 2, 'tr_1 ', '222', NULL, '2023-05-14 12:29:15', '', 1, '2022-02-11 17:59:45', '2023-05-14 12:29:15'),
(8, 101, 200, 'ameng', 'ameng', '382df3b083a27886edb94e669a857c33', 'hfuUEb', '', 11.00, 3.22, '', 1, '', '', '', NULL, 0, '', 1, 2, 'tr_1 ', '333', NULL, '2023-05-14 12:25:24', '', 1, '2023-02-03 17:34:31', '2023-05-14 12:25:24');
-- --------------------------------------------------------
@ -220,8 +220,7 @@ CREATE TABLE `hg_admin_member_post` (
INSERT INTO `hg_admin_member_post` (`member_id`, `post_id`) VALUES
(1, 1),
(3, 4),
(8, 2),
(9, 2);
(8, 2);
-- --------------------------------------------------------
@ -300,13 +299,12 @@ INSERT INTO `hg_admin_menu` (`id`, `pid`, `title`, `name`, `path`, `icon`, `type
(2073, 2219, '个人设置', 'home_account', 'account', '', 2, '', '', '', '/home/account/account', 1, '', 0, 0, '', 0, 0, 0, 2, '', 10, '', 1, '2022-09-16 17:34:35', '2023-02-01 15:05:57'),
(2074, 0, '日志管理', 'Logs', '/log', 'UnorderedListOutlined', 1, '', '', '', 'LAYOUT', 1, '', 0, 0, '', 0, 0, 0, 1, '', 60, '', 1, '2022-09-16 01:38:32', '2023-01-10 17:19:46'),
(2075, 2074, '访问日志', 'log', 'log', '', 1, '/log/log/index', '', '', 'ParentLayout', 0, '', 0, 0, '', 0, 0, 0, 2, '', 10, '', 1, '2022-09-09 17:39:16', '2023-01-20 23:08:41'),
(2076, 2074, '登录日志', 'login_log', 'login', '', 1, '/log/login/index', '', '', 'ParentLayout', 0, '', 0, 0, '', 0, 0, 0, 2, '', 20, '', 1, '2022-09-15 20:04:20', '2023-01-20 23:08:43'),
(2076, 2074, '登录日志', 'login_log', 'login-log', '', 1, '/log/login-log/index', '', '', 'ParentLayout', 0, '', 0, 0, '', 0, 0, 0, 2, '', 20, '', 1, '2022-09-15 20:04:20', '2023-05-11 22:22:54'),
(2077, 2075, '全局日志详情', 'log_view', 'view/:id?', '', 2, '', '/log/view', '', '/log/log/view', 0, 'log', 0, 0, '', 0, 1, 0, 3, '', 62, '', 1, '2022-09-14 20:07:04', '2022-11-23 22:12:27'),
(2078, 2075, '全局日志列表', 'log_list', 'index', '', 2, '', '/log/list', '', '/log/log/index', 0, 'log', 0, 0, '', 0, 1, 0, 3, '', 61, '', 1, '2022-09-15 04:38:33', '2022-11-23 22:12:07'),
(2082, 2076, '登录日志详情', 'loginLogView', 'view/:id?', '', 2, '', '/loginLog/view', '', '/log/login-log/view', 0, 'login_log', 0, 0, '', 0, 1, 0, 3, '', 62, '', 1, '2022-09-14 20:07:04', '2023-01-19 21:13:43'),
(2083, 2076, '登录列表', 'login_log_index', 'index', '', 2, '', '', '', '/log/login-log/index', 0, 'login_log', 0, 0, '', 0, 1, 0, 3, '', 61, '', 1, '2022-09-15 04:38:33', '2022-11-23 22:11:14'),
(2084, 2074, '短信记录', 'sms_log', 'sms', '', 1, '/log/sms/index', '', '', 'ParentLayout', 1, '', 0, 0, '', 0, 0, 0, 2, '', 70, '', 1, '2022-09-17 19:13:51', '2023-01-21 10:07:09'),
(2086, 2084, '日志列表', 'sms_log_index', 'index', '', 2, '', '', '', '/log/sms-log/index', 0, 'sms_log', 0, 0, '', 0, 1, 0, 3, '', 61, '', 1, '2022-09-15 04:38:33', '2023-01-21 10:08:31'),
(2083, 2076, '登录列表', 'login_log_index', 'index', '', 2, '', '', '', '/log/login-log/index', 0, 'login_log', 0, 0, '', 0, 1, 0, 3, '', 61, '', 1, '2022-09-15 04:38:33', '2023-05-11 22:23:46'),
(2084, 2074, '短信记录', 'sms_log', 'sms', '', 1, '', '', '', '/log/sms-log/index', 0, '', 0, 0, '', 0, 0, 0, 2, '', 70, '', 1, '2022-09-17 19:13:51', '2023-05-11 21:59:17'),
(2087, 2074, '服务日志', 'monitor_serve_log', 'serve_log', '', 1, '/log/serve_log/index', '', '', 'ParentLayout', 1, '', 0, 0, '', 0, 0, 0, 2, '', 30, '', 1, '2022-09-18 20:59:28', '2023-01-20 23:08:50'),
(2088, 2087, '服务日志详情', 'monitor_serve_log_view', 'view/:id?', '', 2, '', '/serve_log/view', '', '/monitor/serve-log/view', 0, 'monitor_serve_log', 0, 0, '', 0, 1, 0, 3, '', 62, '', 1, '2022-09-14 20:07:04', '2023-01-20 18:41:13'),
(2089, 2087, '服务日志列表', 'monitor_serve_log_index', 'index', '', 2, '', '', '', '/monitor/serve-log/index', 0, 'monitor_serve_log', 0, 0, '', 0, 1, 0, 2, '', 61, '', 1, '2022-09-15 04:38:33', '2022-09-18 13:14:27'),
@ -346,8 +344,8 @@ INSERT INTO `hg_admin_menu` (`id`, `pid`, `title`, `name`, `path`, `icon`, `type
(2204, 2199, '修改生成演示状态', 'curdDemoStatus', '', '', 3, '', '/curdDemo/status', '', '', 1, '', 0, 0, '', 0, 0, 0, 3, '', 10, '', 1, '2023-01-18 15:19:43', '2023-01-18 15:19:43'),
(2205, 2199, '操作生成演示开关', 'curdDemoSwitch', '', '', 3, '', '/curdDemo/switch', '', '', 1, '', 0, 0, '', 0, 0, 0, 3, '', 10, '', 1, '2023-01-18 15:19:43', '2023-01-18 15:19:43'),
(2206, 2199, '导出生成演示', 'curdDemoExport', '', '', 3, '', '/curdDemo/export', '', '', 1, '', 0, 0, '', 0, 0, 0, 3, '', 10, '', 1, '2023-01-18 15:19:43', '2023-01-18 15:19:43'),
(2207, 2083, '删除登录日志', 'loginLogDelete', '', '', 3, '', '/loginLog/delete', '', '', 1, '', 0, 0, '', 0, 0, 0, 3, '', 10, '', 1, '2023-01-19 21:06:45', '2023-01-19 21:06:45'),
(2208, 2083, '导出登录日志', 'loginLogExport', '', '', 3, '', '/loginLog/export', '', '', 1, '', 0, 0, '', 0, 0, 0, 3, '', 10, '', 1, '2023-01-19 21:06:45', '2023-01-19 21:06:45'),
(2207, 2076, '删除登录日志', 'loginLogDelete', '', '', 3, '', '/loginLog/delete', '', '', 1, '', 0, 0, '', 0, 0, 0, 3, '', 10, '', 1, '2023-01-19 21:06:45', '2023-05-11 22:12:05'),
(2208, 2076, '导出登录日志', 'loginLogExport', '', '', 3, '', '/loginLog/export', '', '', 1, '', 0, 0, '', 0, 0, 0, 3, '', 10, '', 1, '2023-01-19 21:06:45', '2023-05-11 22:12:21'),
(2209, 2087, '删除服务日志', 'serveLogDelete', '', '', 3, '', '/serveLog/delete', '', '', 1, '', 0, 0, '', 0, 0, 0, 3, '', 10, '', 1, '2023-01-20 18:37:50', '2023-01-20 18:37:50'),
(2210, 2087, '导出服务日志', 'serveLogExport', '', '', 3, '', '/serveLog/export', '', '', 1, '', 0, 0, '', 0, 0, 0, 3, '', 10, '', 1, '2023-01-20 18:37:50', '2023-01-20 18:37:50'),
(2211, 2094, '获取公告最大排序', 'noticeMaxSort', '', '', 3, '', '/notice/maxSort', '', '', 1, '', 0, 0, '', 0, 0, 0, 3, '', 10, '', 1, '2023-01-18 15:19:43', '2023-01-18 15:19:43'),
@ -601,201 +599,201 @@ CREATE TABLE `hg_admin_role_casbin` (
--
INSERT INTO `hg_admin_role_casbin` (`id`, `p_type`, `v0`, `v1`, `v2`, `v3`, `v4`, `v5`) VALUES
(20042, 'p', 'manage', 'dashboard', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20043, 'p', 'manage', '/console/stat', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20044, 'p', 'manage', 'dashboard_workplace', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20045, 'p', 'manage', '/dept/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20046, 'p', 'manage', '/post/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20047, 'p', 'manage', '/role/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20048, 'p', 'manage', '/member/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20049, 'p', 'manage', '/dept/option', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20050, 'p', 'manage', '/post/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20051, 'p', 'manage', '/menu/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20052, 'p', 'manage', '/role/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20053, 'p', 'manage', '/log/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20054, 'p', 'manage', '/log/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20055, 'p', 'manage', '/loginLog/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20056, 'p', 'manage', '/serve_log/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20057, 'p', 'manage', '/notice/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20058, 'p', 'manage', '/attachment/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20059, 'p', 'manage', '/provinces/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20060, 'p', 'manage', '/member/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20061, 'p', 'manage', '/member/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20062, 'p', 'manage', '/member/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20063, 'p', 'manage', '/member/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20064, 'p', 'manage', '/dept/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20065, 'p', 'manage', '/dept/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20066, 'p', 'manage', '/dept/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20067, 'p', 'manage', '/post/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20068, 'p', 'manage', '/post/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20069, 'p', 'manage', '/post/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20070, 'p', 'manage', '/upload/image', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20071, 'p', 'manage', '/hgexample/table/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20072, 'p', 'manage', '/hgexample/table/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20073, 'p', 'manage', '/curdDemo/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20074, 'p', 'manage', '/curdDemo/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20075, 'p', 'manage', '/curdDemo/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20076, 'p', 'manage', '/curdDemo/maxSort', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20077, 'p', 'manage', '/curdDemo/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20078, 'p', 'manage', '/curdDemo/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20079, 'p', 'manage', '/curdDemo/switch', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20080, 'p', 'manage', '/curdDemo/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20081, 'p', 'manage', '/loginLog/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20082, 'p', 'manage', '/loginLog/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20083, 'p', 'manage', '/serveLog/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20084, 'p', 'manage', '/serveLog/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20085, 'p', 'manage', '/notice/maxSort', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20086, 'p', 'manage', '/notice/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20087, 'p', 'manage', '/notice/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20088, 'p', 'manage', '/notice/switch', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20089, 'p', 'manage', '/notice/editNotify', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20090, 'p', 'manage', '/notice/editNotice', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20091, 'p', 'manage', '/notice/editLetter', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20092, 'p', 'manage', '/notice/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20093, 'p', 'manage', '/test/maxSort', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20094, 'p', 'manage', '/test/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20095, 'p', 'manage', '/test/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20096, 'p', 'manage', '/test/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20097, 'p', 'manage', '/test/switch', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20098, 'p', 'manage', '/test/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20099, 'p', 'manage', '/order/create', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20100, 'p', 'manage', '/creditsLog/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20101, 'p', 'manage', '/creditsLog/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20102, 'p', 'manage', '/order/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20103, 'p', 'manage', '/order/acceptRefund', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20104, 'p', 'manage', '/order/applyRefund', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20105, 'p', 'manage', '/order/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20106, 'p', 'manage', '/cash/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20107, 'p', 'manage', '/cash/apply', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20108, 'p', 'manage', '/cash/apply', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20109, 'p', 'manage', '/cash/payment', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20110, 'p', 'manage', '/cash/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20111, 'p', 'manage', '/member/addBalance', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20112, 'p', 'manage', '/member/addIntegral', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20113, 'p', 'manage', '/member/resetPwd', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20114, 'p', 'manage', '/dept/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20115, 'p', 'manage', '/post/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20116, 'p', 'manage', '/role/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20117, 'p', 'manage', '/member/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20118, 'p', 'manage', '/dept/option', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20119, 'p', 'manage', '/config/get', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20120, 'p', 'manage', '/config/update', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20121, 'p', 'manage', '/dictType/tree', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20122, 'p', 'manage', '/dictData/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20123, 'p', 'manage', '/config/typeSelect', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20124, 'p', 'manage', '/dictData/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20125, 'p', 'manage', '/dictData/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20126, 'p', 'manage', '/dictType/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20127, 'p', 'manage', '/dictType/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20128, 'p', 'manage', '/cron/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20129, 'p', 'manage', '/cronGroup/select', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20130, 'p', 'manage', '/cronGroup/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20131, 'p', 'manage', '/cron/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20132, 'p', 'manage', '/cron/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20133, 'p', 'manage', '/cron/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20134, 'p', 'manage', '/cron/onlineExec', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20135, 'p', 'manage', '/cronGroup/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20136, 'p', 'manage', '/cronGroup/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20137, 'p', 'manage', '/blacklist/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20138, 'p', 'manage', '/blacklist/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20139, 'p', 'manage', '/blacklist/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20140, 'p', 'manage', '/blacklist/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20141, 'p', 'gold_agent', 'dashboard', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20142, 'p', 'gold_agent', '/console/stat', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20143, 'p', 'gold_agent', 'dashboard_workplace', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20144, 'p', 'gold_agent', '/dept/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20145, 'p', 'gold_agent', '/post/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20146, 'p', 'gold_agent', '/role/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20147, 'p', 'gold_agent', '/member/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20148, 'p', 'gold_agent', '/dept/option', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20149, 'p', 'gold_agent', '/member/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20150, 'p', 'gold_agent', '/member/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20151, 'p', 'gold_agent', '/member/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20152, 'p', 'gold_agent', '/member/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20153, 'p', 'gold_agent', '/order/create', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20154, 'p', 'gold_agent', '/creditsLog/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20155, 'p', 'gold_agent', '/creditsLog/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20156, 'p', 'gold_agent', '/order/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20157, 'p', 'gold_agent', '/order/acceptRefund', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20158, 'p', 'gold_agent', '/order/applyRefund', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20159, 'p', 'gold_agent', '/order/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20160, 'p', 'gold_agent', '/cash/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20161, 'p', 'gold_agent', '/cash/apply', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20162, 'p', 'gold_agent', '/cash/apply', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20163, 'p', 'gold_agent', '/cash/payment', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20164, 'p', 'gold_agent', '/cash/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20165, 'p', 'gold_agent', '/member/addBalance', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20166, 'p', 'gold_agent', '/member/addIntegral', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20167, 'p', 'gold_agent', '/member/resetPwd', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20168, 'p', 'gold_agent', '/dept/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20169, 'p', 'gold_agent', '/post/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20170, 'p', 'gold_agent', '/role/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20171, 'p', 'gold_agent', '/member/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20172, 'p', 'gold_agent', '/dept/option', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20173, 'p', 'gold_agent', '/member/updatePwd', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20174, 'p', 'gold_agent', '/member/updateMobile', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20175, 'p', 'gold_agent', '/member/updateEmail', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20176, 'p', 'silver_agent', 'dashboard', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20177, 'p', 'silver_agent', '/console/stat', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20178, 'p', 'silver_agent', 'dashboard_workplace', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20179, 'p', 'copper_agent', 'dashboard', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20180, 'p', 'copper_agent', '/console/stat', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20181, 'p', 'copper_agent', 'dashboard_workplace', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20182, 'p', 'finance', 'dashboard', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20183, 'p', 'finance', '/console/stat', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20184, 'p', 'finance', 'dashboard_workplace', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20185, 'p', 'finance', '/dept/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20186, 'p', 'finance', '/post/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20187, 'p', 'finance', '/role/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20188, 'p', 'finance', '/member/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20189, 'p', 'finance', '/dept/option', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20190, 'p', 'finance', '/post/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20191, 'p', 'finance', '/menu/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20192, 'p', 'finance', '/role/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20193, 'p', 'finance', '/log/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20194, 'p', 'finance', '/log/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20195, 'p', 'finance', '/loginLog/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20196, 'p', 'finance', '/serve_log/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20197, 'p', 'finance', '/notice/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20198, 'p', 'finance', '/attachment/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20199, 'p', 'finance', '/provinces/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20200, 'p', 'finance', '/member/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20201, 'p', 'finance', '/member/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20202, 'p', 'finance', '/member/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20203, 'p', 'finance', '/member/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20204, 'p', 'finance', '/dept/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20205, 'p', 'finance', '/dept/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20206, 'p', 'finance', '/dept/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20207, 'p', 'finance', '/post/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20208, 'p', 'finance', '/post/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20209, 'p', 'finance', '/post/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20210, 'p', 'finance', '/upload/image', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20211, 'p', 'finance', '/hgexample/table/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20212, 'p', 'finance', '/hgexample/table/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20213, 'p', 'finance', '/loginLog/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20214, 'p', 'finance', '/loginLog/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20215, 'p', 'finance', '/serveLog/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20216, 'p', 'finance', '/serveLog/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20217, 'p', 'finance', '/notice/maxSort', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20218, 'p', 'finance', '/notice/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20219, 'p', 'finance', '/notice/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20220, 'p', 'finance', '/notice/switch', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20221, 'p', 'finance', '/notice/editNotify', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20222, 'p', 'finance', '/notice/editNotice', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20223, 'p', 'finance', '/notice/editLetter', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20224, 'p', 'finance', '/notice/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20225, 'p', 'finance', '/test/maxSort', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20226, 'p', 'finance', '/test/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20227, 'p', 'finance', '/test/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20228, 'p', 'finance', '/test/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20229, 'p', 'finance', '/test/switch', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20230, 'p', 'finance', '/test/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20231, 'p', 'business', 'dashboard', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20232, 'p', 'business', '/console/stat', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20233, 'p', 'business', 'dashboard_workplace', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20234, 'p', 'science', 'dashboard', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20235, 'p', 'science', '/console/stat', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(20236, 'p', 'science', 'dashboard_workplace', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', '');
(28037, 'p', 'manage', 'dashboard', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28038, 'p', 'manage', '/console/stat', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28039, 'p', 'manage', 'dashboard_workplace', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28040, 'p', 'manage', '/dept/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28041, 'p', 'manage', '/post/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28042, 'p', 'manage', '/role/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28043, 'p', 'manage', '/member/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28044, 'p', 'manage', '/dept/option', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28045, 'p', 'manage', '/post/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28046, 'p', 'manage', '/menu/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28047, 'p', 'manage', '/role/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28048, 'p', 'manage', '/log/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28049, 'p', 'manage', '/log/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28050, 'p', 'manage', '/loginLog/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28051, 'p', 'manage', '/serve_log/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28052, 'p', 'manage', '/notice/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28053, 'p', 'manage', '/attachment/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28054, 'p', 'manage', '/provinces/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28055, 'p', 'manage', '/member/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28056, 'p', 'manage', '/member/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28057, 'p', 'manage', '/member/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28058, 'p', 'manage', '/member/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28059, 'p', 'manage', '/dept/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28060, 'p', 'manage', '/dept/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28061, 'p', 'manage', '/dept/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28062, 'p', 'manage', '/post/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28063, 'p', 'manage', '/post/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28064, 'p', 'manage', '/post/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28065, 'p', 'manage', '/upload/image', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28066, 'p', 'manage', '/hgexample/table/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28067, 'p', 'manage', '/hgexample/table/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28068, 'p', 'manage', '/curdDemo/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28069, 'p', 'manage', '/curdDemo/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28070, 'p', 'manage', '/curdDemo/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28071, 'p', 'manage', '/curdDemo/maxSort', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28072, 'p', 'manage', '/curdDemo/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28073, 'p', 'manage', '/curdDemo/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28074, 'p', 'manage', '/curdDemo/switch', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28075, 'p', 'manage', '/curdDemo/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28076, 'p', 'manage', '/loginLog/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28077, 'p', 'manage', '/loginLog/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28078, 'p', 'manage', '/serveLog/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28079, 'p', 'manage', '/serveLog/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28080, 'p', 'manage', '/notice/maxSort', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28081, 'p', 'manage', '/notice/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28082, 'p', 'manage', '/notice/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28083, 'p', 'manage', '/notice/switch', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28084, 'p', 'manage', '/notice/editNotify', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28085, 'p', 'manage', '/notice/editNotice', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28086, 'p', 'manage', '/notice/editLetter', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28087, 'p', 'manage', '/notice/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28088, 'p', 'manage', '/test/maxSort', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28089, 'p', 'manage', '/test/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28090, 'p', 'manage', '/test/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28091, 'p', 'manage', '/test/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28092, 'p', 'manage', '/test/switch', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28093, 'p', 'manage', '/test/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28094, 'p', 'manage', '/order/create', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28095, 'p', 'manage', '/creditsLog/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28096, 'p', 'manage', '/creditsLog/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28097, 'p', 'manage', '/order/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28098, 'p', 'manage', '/order/acceptRefund', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28099, 'p', 'manage', '/order/applyRefund', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28100, 'p', 'manage', '/order/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28101, 'p', 'manage', '/cash/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28102, 'p', 'manage', '/cash/apply', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28103, 'p', 'manage', '/cash/apply', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28104, 'p', 'manage', '/cash/payment', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28105, 'p', 'manage', '/cash/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28106, 'p', 'manage', '/member/addBalance', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28107, 'p', 'manage', '/member/addIntegral', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28108, 'p', 'manage', '/member/resetPwd', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28109, 'p', 'manage', '/dept/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28110, 'p', 'manage', '/post/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28111, 'p', 'manage', '/role/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28112, 'p', 'manage', '/member/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28113, 'p', 'manage', '/dept/option', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28114, 'p', 'manage', '/config/get', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28115, 'p', 'manage', '/config/update', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28116, 'p', 'manage', '/dictType/tree', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28117, 'p', 'manage', '/dictData/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28118, 'p', 'manage', '/config/typeSelect', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28119, 'p', 'manage', '/dictData/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28120, 'p', 'manage', '/dictData/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28121, 'p', 'manage', '/dictType/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28122, 'p', 'manage', '/dictType/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28123, 'p', 'manage', '/cron/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28124, 'p', 'manage', '/cronGroup/select', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28125, 'p', 'manage', '/cronGroup/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28126, 'p', 'manage', '/cron/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28127, 'p', 'manage', '/cron/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28128, 'p', 'manage', '/cron/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28129, 'p', 'manage', '/cron/onlineExec', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28130, 'p', 'manage', '/cronGroup/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28131, 'p', 'manage', '/cronGroup/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28132, 'p', 'manage', '/blacklist/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28133, 'p', 'manage', '/blacklist/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28134, 'p', 'manage', '/blacklist/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28135, 'p', 'manage', '/blacklist/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28136, 'p', 'gold_agent', 'dashboard', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28137, 'p', 'gold_agent', '/console/stat', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28138, 'p', 'gold_agent', 'dashboard_workplace', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28139, 'p', 'gold_agent', '/dept/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28140, 'p', 'gold_agent', '/post/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28141, 'p', 'gold_agent', '/role/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28142, 'p', 'gold_agent', '/member/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28143, 'p', 'gold_agent', '/dept/option', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28144, 'p', 'gold_agent', '/member/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28145, 'p', 'gold_agent', '/member/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28146, 'p', 'gold_agent', '/member/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28147, 'p', 'gold_agent', '/member/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28148, 'p', 'gold_agent', '/order/create', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28149, 'p', 'gold_agent', '/creditsLog/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28150, 'p', 'gold_agent', '/creditsLog/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28151, 'p', 'gold_agent', '/order/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28152, 'p', 'gold_agent', '/order/acceptRefund', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28153, 'p', 'gold_agent', '/order/applyRefund', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28154, 'p', 'gold_agent', '/order/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28155, 'p', 'gold_agent', '/cash/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28156, 'p', 'gold_agent', '/cash/apply', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28157, 'p', 'gold_agent', '/cash/apply', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28158, 'p', 'gold_agent', '/cash/payment', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28159, 'p', 'gold_agent', '/cash/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28160, 'p', 'gold_agent', '/member/addBalance', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28161, 'p', 'gold_agent', '/member/addIntegral', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28162, 'p', 'gold_agent', '/member/resetPwd', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28163, 'p', 'gold_agent', '/dept/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28164, 'p', 'gold_agent', '/post/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28165, 'p', 'gold_agent', '/role/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28166, 'p', 'gold_agent', '/member/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28167, 'p', 'gold_agent', '/dept/option', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28168, 'p', 'gold_agent', '/member/updatePwd', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28169, 'p', 'gold_agent', '/member/updateMobile', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28170, 'p', 'gold_agent', '/member/updateEmail', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28171, 'p', 'silver_agent', 'dashboard', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28172, 'p', 'silver_agent', '/console/stat', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28173, 'p', 'silver_agent', 'dashboard_workplace', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28174, 'p', 'copper_agent', 'dashboard', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28175, 'p', 'copper_agent', '/console/stat', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28176, 'p', 'copper_agent', 'dashboard_workplace', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28177, 'p', 'finance', 'dashboard', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28178, 'p', 'finance', '/console/stat', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28179, 'p', 'finance', 'dashboard_workplace', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28180, 'p', 'finance', '/dept/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28181, 'p', 'finance', '/post/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28182, 'p', 'finance', '/role/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28183, 'p', 'finance', '/member/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28184, 'p', 'finance', '/dept/option', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28185, 'p', 'finance', '/post/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28186, 'p', 'finance', '/menu/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28187, 'p', 'finance', '/role/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28188, 'p', 'finance', '/log/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28189, 'p', 'finance', '/log/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28190, 'p', 'finance', '/loginLog/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28191, 'p', 'finance', '/serve_log/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28192, 'p', 'finance', '/notice/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28193, 'p', 'finance', '/attachment/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28194, 'p', 'finance', '/provinces/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28195, 'p', 'finance', '/member/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28196, 'p', 'finance', '/member/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28197, 'p', 'finance', '/member/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28198, 'p', 'finance', '/member/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28199, 'p', 'finance', '/dept/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28200, 'p', 'finance', '/dept/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28201, 'p', 'finance', '/dept/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28202, 'p', 'finance', '/post/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28203, 'p', 'finance', '/post/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28204, 'p', 'finance', '/post/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28205, 'p', 'finance', '/upload/image', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28206, 'p', 'finance', '/hgexample/table/list', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28207, 'p', 'finance', '/hgexample/table/view', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28208, 'p', 'finance', '/loginLog/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28209, 'p', 'finance', '/loginLog/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28210, 'p', 'finance', '/serveLog/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28211, 'p', 'finance', '/serveLog/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28212, 'p', 'finance', '/notice/maxSort', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28213, 'p', 'finance', '/notice/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28214, 'p', 'finance', '/notice/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28215, 'p', 'finance', '/notice/switch', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28216, 'p', 'finance', '/notice/editNotify', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28217, 'p', 'finance', '/notice/editNotice', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28218, 'p', 'finance', '/notice/editLetter', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28219, 'p', 'finance', '/notice/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28220, 'p', 'finance', '/test/maxSort', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28221, 'p', 'finance', '/test/export', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28222, 'p', 'finance', '/test/delete', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28223, 'p', 'finance', '/test/status', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28224, 'p', 'finance', '/test/switch', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28225, 'p', 'finance', '/test/edit', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28226, 'p', 'business', 'dashboard', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28227, 'p', 'business', '/console/stat', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28228, 'p', 'business', 'dashboard_workplace', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28229, 'p', 'science', 'dashboard', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28230, 'p', 'science', '/console/stat', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', ''),
(28231, 'p', 'science', 'dashboard_workplace', 'GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD', '', '', '');
-- --------------------------------------------------------
@ -1216,6 +1214,13 @@ CREATE TABLE `hg_sys_attachment` (
`updated_at` datetime DEFAULT NULL COMMENT '修改时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统_附件管理';
--
-- 转存表中的数据 `hg_sys_attachment`
--
INSERT INTO `hg_sys_attachment` (`id`, `app_id`, `member_id`, `cate_id`, `drive`, `name`, `kind`, `meta_type`, `naive_type`, `path`, `file_url`, `size`, `ext`, `md5`, `status`, `created_at`, `updated_at`) VALUES
(55, 'admin', 1, 0, 'local', 'logo.png', 'images', 'image/png', '', 'attachment/2023-05-14/csltf747yrr4gd4kc5.png', 'attachment/2023-05-14/csltf747yrr4gd4kc5.png', 38601, 'png', '492c0e0f0eb8e7e6c7b6901d32854d19', 1, '2023-05-14 15:17:25', '2023-05-14 15:17:25');
-- --------------------------------------------------------
--
@ -1273,8 +1278,6 @@ INSERT INTO `hg_sys_config` (`id`, `group`, `name`, `type`, `key`, `value`, `def
(1, 'theme', '默认主题', 'string', 'themeDarkTheme', 'dark', 'dark', 50, '', 1, 1, '2021-01-30 13:27:43', '2022-09-05 20:29:05'),
(2, 'theme', '默认系统主题', 'string', 'themeAppTheme', '#2d8cf0', '#2d8cf0', 60, '', 1, 1, '2021-01-30 13:27:43', '2022-09-05 20:29:05'),
(3, 'theme', '默认侧边栏风格', 'string', 'themeNavTheme', 'light', 'dark', 70, '', 1, 1, '2021-01-30 13:27:43', '2022-09-05 20:29:05'),
(4, 'basic', '用户是否可注册开关', 'int', 'basicRegisterSwitch', '1', '1', 80, '', 1, 1, '2021-09-29 23:51:21', '2023-04-30 20:38:06'),
(5, 'basic', '验证码开关', 'int', 'basicCaptchaSwitch', '1', '1', 90, '', 1, 1, '2021-09-29 23:51:21', '2023-04-30 20:38:06'),
(6, 'basic', '网站名称', 'string', 'basicName', 'HotGo', 'HotGo!', 10, '', 1, 1, '2021-01-30 13:27:43', '2023-04-30 20:38:06'),
(7, 'basic', '网站logo', 'string', 'basicLogo', 'http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdq8er9nfkchdopav.png', '', 20, '首页使用', 1, 1, '2021-01-30 13:27:43', '2023-04-30 20:38:06'),
(8, 'basic', '网站备案号', 'string', 'basicIcpCode', '豫ICP备16035288号', '', 30, '', 1, 1, '2021-01-30 13:27:43', '2023-04-30 20:38:06'),
@ -1363,7 +1366,15 @@ INSERT INTO `hg_sys_config` (`id`, `group`, `name`, `type`, `key`, `value`, `def
(108, 'wechat', '开放平台AppId', 'string', 'openPlatformAppId', '', '', 1040, '请填写微信开放平台平台后台的AppId', 1, 1, '2021-01-30 13:27:43', '2023-04-30 22:26:12'),
(109, 'wechat', '开放平台AppSecret', 'string', 'openPlatformAppSecret', '', '', 1050, '请填写微信开放平台平台后台的AppSecret', 1, 1, '2021-01-30 13:27:43', '2023-04-30 22:26:12'),
(110, 'wechat', '开放平台EncodingAESKey', 'string', 'openPlatformEncodingAESKey', '', '', 1060, '与开放平台接入设置值一致必须为英文或者数字长度为43个字符. 请妥善保管,EncodingAESKey 泄露将可能被窃取或篡改平台的操作数据', 1, 1, '2021-01-30 13:27:43', '2023-04-30 22:26:12'),
(111, 'wechat', '开放平台token', 'string', 'openPlatformToken', '', '', 1070, '', 1, 1, '2021-01-30 13:27:43', '2023-04-30 22:26:12');
(111, 'wechat', '开放平台token', 'string', 'openPlatformToken', '', '', 1070, '', 1, 1, '2021-01-30 13:27:43', '2023-04-30 22:26:12'),
(112, 'login', '注册开关', 'int', 'loginRegisterSwitch', '1', '1', 1100, '', 1, 1, '2021-09-29 23:51:21', '2023-05-14 16:35:46'),
(113, 'login', '验证码开关', 'int', 'loginCaptchaSwitch', '1', '1', 1110, '', 1, 1, '2021-09-29 23:51:21', '2023-05-14 16:35:46'),
(114, 'login', '用户协议', 'string', 'loginProtocol', '<p><span style=\"color: rgb(31, 34, 37);\">用户协议..</span></p>', '', 1120, '', 1, 1, '2021-09-29 23:51:21', '2023-05-14 16:35:46'),
(115, 'login', '隐私权政策', 'string', 'loginPolicy', '<p><span style=\"color: rgb(31, 34, 37);\">隐私权政策..</span></p>', '', 1130, '', 1, 1, '2021-09-29 23:51:21', '2023-05-14 16:35:46'),
(116, 'login', '默认注册角色', 'int64', 'loginRoleId', '202', '', 1140, '', 1, 1, '2021-09-29 23:51:21', '2023-05-14 16:35:46'),
(117, 'login', '默认注册部门', 'int64', 'loginDeptId', '112', '', 1150, '', 1, 1, '2021-09-29 23:51:21', '2023-05-14 16:35:46'),
(118, 'login', '默认注册岗位', '[]int64', 'loginPostIds', '[4,6]', '', 1160, '', 1, 1, '2021-09-29 23:51:21', '2023-05-14 16:35:46'),
(119, 'login', '默认注册头像', 'string', 'loginAvatar', 'http://localhost:8000/attachment/2023-05-14/csltf747yrr4gd4kc5.png', '', 1170, '', 1, 1, '2021-09-29 23:51:21', '2023-05-14 16:35:46');
-- --------------------------------------------------------
@ -1715,13 +1726,6 @@ CREATE TABLE `hg_sys_login_log` (
`updated_at` datetime DEFAULT NULL COMMENT '修改时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统_登录日志';
--
-- 转存表中的数据 `hg_sys_login_log`
--
INSERT INTO `hg_sys_login_log` (`id`, `req_id`, `member_id`, `username`, `response`, `login_at`, `login_ip`, `err_msg`, `status`, `created_at`, `updated_at`) VALUES
(40, 'c043b70bb0045e17d7eafe258038334d', 1, 'admin', '{\"id\": 1, \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHAiOiJhZG1pbiIsImF2YXRhciI6Imh0dHA6Ly9idWZhbnl1bi5jbi1iai51ZmlsZW9zLmNvbS9ob3Rnby9hdHRhY2htZW50LzIwMjMtMDItMDkvY3FkcThlcjluZmtjaGRvcGF2LnBuZyIsImRlcHRJZCI6MTAwLCJlbWFpbCI6IjEzMzgxNDI1MEBxcS5jb20iLCJleHAiOjE2ODQ2NTI0NjQsImV4cGlyZXMiOjg2NDAwMCwiaWQiOjEsImlzUmVmcmVzaCI6ZmFsc2UsImp3dFZlcnNpb24iOiIxLjAiLCJtb2JpbGUiOiIxNTMwMzgzMDU3MSIsInBpZCI6MCwicmVhbE5hbWUiOiLlrZ_luIUiLCJyb2xlSWQiOjEsInJvbGVLZXkiOiJzdXBlciIsInVzZXJuYW1lIjoiYWRtaW4ifQ.66ppHKrI8QbIo4u_fH88BlI6NdiomqnuIVGkyDKy1-I\", \"expires\": 864000}', '2023-05-11 15:01:04', '127.0.0.1', '', 1, '2023-05-11 15:41:45', '2023-05-11 15:41:45');
-- --------------------------------------------------------
--
@ -5469,7 +5473,7 @@ CREATE TABLE `hg_sys_serve_license` (
--
INSERT INTO `hg_sys_serve_license` (`id`, `group`, `name`, `appid`, `secret_key`, `desc`, `remote_addr`, `online`, `online_limit`, `login_times`, `last_login_at`, `last_active_at`, `routes`, `allowed_ips`, `end_at`, `remark`, `status`, `created_at`, `updated_at`) VALUES
(1, 'cron', '默认的定时任务', '1002', 'hotgo', '这是默认的定时任务TCP客户端授权凭证', '127.0.0.1:52537', 1, 1, 163, '2023-05-11 15:52:56', '2023-05-11 15:54:30', NULL, '127.0.0.1', '2033-03-09 00:00:00', '', 1, '2023-03-11 00:00:00', '2023-05-11 15:54:30'),
(1, 'cron', '默认的定时任务', '1002', 'hotgo', '这是默认的定时任务TCP客户端授权凭证', '127.0.0.1:62905', 1, 1, 295, '2023-05-14 16:44:30', '2023-05-14 16:50:30', NULL, '127.0.0.1', '2033-03-09 00:00:00', '', 1, '2023-03-11 00:00:00', '2023-05-14 16:50:30'),
(2, 'auth', '测试授权', 'mengshuai', '123456', '这是一个测试的授权服务可以为第三方平台提供授权支持', '127.0.0.1:51615', 1, 1, 0, '2023-05-04 23:23:52', '2023-05-04 23:23:52', NULL, '127.0.0.1', '2033-03-09 00:00:00', '', 1, '2023-03-11 00:00:00', '2023-05-04 23:23:52');
-- --------------------------------------------------------
@ -5586,6 +5590,7 @@ ALTER TABLE `hg_admin_dept`
--
ALTER TABLE `hg_admin_member`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `invite_code` (`invite_code`),
ADD KEY `dept_id` (`dept_id`),
ADD KEY `pid` (`pid`);
@ -5846,7 +5851,7 @@ ALTER TABLE `hg_admin_dept`
-- 使用表AUTO_INCREMENT `hg_admin_member`
--
ALTER TABLE `hg_admin_member`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '管理员ID', AUTO_INCREMENT=10;
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '管理员ID', AUTO_INCREMENT=14;
--
-- 使用表AUTO_INCREMENT `hg_admin_menu`
@ -5894,7 +5899,7 @@ ALTER TABLE `hg_admin_role`
-- 使用表AUTO_INCREMENT `hg_admin_role_casbin`
--
ALTER TABLE `hg_admin_role_casbin`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20237;
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28232;
--
-- 使用表AUTO_INCREMENT `hg_pay_log`
@ -5924,7 +5929,7 @@ ALTER TABLE `hg_sys_addons_install`
-- 使用表AUTO_INCREMENT `hg_sys_attachment`
--
ALTER TABLE `hg_sys_attachment`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '文件ID', AUTO_INCREMENT=55;
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '文件ID', AUTO_INCREMENT=56;
--
-- 使用表AUTO_INCREMENT `hg_sys_blacklist`
@ -5936,7 +5941,7 @@ ALTER TABLE `hg_sys_blacklist`
-- 使用表AUTO_INCREMENT `hg_sys_config`
--
ALTER TABLE `hg_sys_config`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '配置ID', AUTO_INCREMENT=112;
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '配置ID', AUTO_INCREMENT=120;
--
-- 使用表AUTO_INCREMENT `hg_sys_cron`
@ -5990,7 +5995,7 @@ ALTER TABLE `hg_sys_log`
-- 使用表AUTO_INCREMENT `hg_sys_login_log`
--
ALTER TABLE `hg_sys_login_log`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '日志ID', AUTO_INCREMENT=41;
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '日志ID';
--
-- 使用表AUTO_INCREMENT `hg_sys_serve_license`
@ -6008,7 +6013,7 @@ ALTER TABLE `hg_sys_serve_log`
-- 使用表AUTO_INCREMENT `hg_sys_sms_log`
--
ALTER TABLE `hg_sys_sms_log`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', AUTO_INCREMENT=3;
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', AUTO_INCREMENT=6;
--
-- 使用表AUTO_INCREMENT `hg_test_category`

View File

@ -2,10 +2,8 @@
VITE_PORT=8001
# spa-title
VITE_GLOB_APP_TITLE=HG后台管理系统
VITE_GLOB_APP_TITLE=HotGo管理系统
# spa shortname
VITE_GLOB_APP_SHORT_NAME=HG
# 生产环境 开启mock
VITE_GLOB_PROD_MOCK=false

View File

@ -3,9 +3,6 @@
# 网站根目录
VITE_PUBLIC_PATH=/
# 是否开启mock
VITE_USE_MOCK=false
# 网站前缀
VITE_BASE_URL=/

View File

@ -3,9 +3,6 @@
# 网站根目录
VITE_PUBLIC_PATH=/admin
# 是否开启mock
VITE_USE_MOCK=false
# 网站前缀
VITE_BASE_URL=/

View File

@ -4,13 +4,11 @@ import { NaiveUiResolver } from 'unplugin-vue-components/resolvers';
import topLevelAwait from 'vite-plugin-top-level-await';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import { configHtmlPlugin } from './html';
import { configMockPlugin } from './mock';
import { configCompressPlugin } from './compress';
export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean, prodMock) {
const { VITE_USE_MOCK, VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE } = viteEnv;
export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
const { VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE } = viteEnv;
const vitePlugins: (Plugin | Plugin[])[] = [
// have to
@ -36,9 +34,6 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean, prodMock)
// vite-plugin-html
vitePlugins.push(configHtmlPlugin(viteEnv, isBuild));
// vite-plugin-mock
VITE_USE_MOCK && vitePlugins.push(configMockPlugin(isBuild, prodMock));
if (isBuild) {
// rollup-plugin-gzip
vitePlugins.push(

View File

@ -1,19 +0,0 @@
/**
* Mock plugin for development and production.
* https://github.com/anncwb/vite-plugin-mock
*/
import { viteMockServe } from 'vite-plugin-mock';
export function configMockPlugin(isBuild: boolean, prodMock: boolean) {
return viteMockServe({
ignore: /^\_/,
mockPath: 'mock',
localEnabled: !isBuild,
prodEnabled: isBuild && prodMock,
injectCode: `
import { setupProdMockServer } from '../mock/_createProductionServer';
setupProdMockServer();
`,
});
}

View File

@ -1,18 +0,0 @@
import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer';
const modules = import.meta.globEager('./**/*.ts');
const mockModules: any[] = [];
Object.keys(modules).forEach((key) => {
if (key.includes('/_')) {
return;
}
mockModules.push(...modules[key].default);
});
/**
* Used in a production environment. Need to manually import all modules
*/
export function setupProdMockServer() {
createProdMockServer(mockModules);
}

View File

@ -1,73 +0,0 @@
import Mock from 'mockjs';
export function resultSuccess(data, { message = 'ok' } = {}) {
return Mock.mock({
code: 0,
data,
message,
type: 'success',
});
}
export function resultPageSuccess<T = any>(
page: number,
pageSize: number,
list: T[],
{ message = 'ok' } = {}
) {
const pageData = pagination(page, pageSize, list);
return {
...resultSuccess({
page,
pageSize,
pageCount: list.length,
list: pageData,
}),
message,
};
}
export function resultError(message = 'Request failed', { code = -1, result = null } = {}) {
return {
code,
result,
message,
type: 'error',
};
}
export function pagination<T = any>(pageNo: number, pageSize: number, array: T[]): T[] {
const offset = (pageNo - 1) * Number(pageSize);
const ret =
offset + Number(pageSize) >= array.length
? array.slice(offset, array.length)
: array.slice(offset, offset + Number(pageSize));
return ret;
}
/**
* @param {Number} times
* @param {Function} callback
*/
export function doCustomTimes(times: number, callback: any) {
let i = -1;
while (++i < times) {
callback(i);
}
}
export interface requestParams {
method: string;
body: any;
headers?: { token?: string };
query: any;
}
/**
* @description request数据中获取token
*
*/
export function getRequestToken({ headers }: requestParams): string | undefined {
return headers?.token;
}

View File

@ -1,44 +0,0 @@
import { Random } from 'mockjs';
import { resultSuccess } from '../_util';
const consoleInfo = {
//访问量
visits: {
dayVisits: Random.float(10000, 99999, 2, 2),
rise: Random.float(10, 99),
decline: Random.float(10, 99),
amount: Random.float(99999, 999999, 3, 5),
},
//销售额
saleroom: {
weekSaleroom: Random.float(10000, 99999, 2, 2),
amount: Random.float(99999, 999999, 2, 2),
degree: Random.float(10, 99),
},
//订单量
orderLarge: {
weekLarge: Random.float(10000, 99999, 2, 2),
rise: Random.float(10, 99),
decline: Random.float(10, 99),
amount: Random.float(99999, 999999, 2, 2),
},
//成交额度
volume: {
weekLarge: Random.float(10000, 99999, 2, 2),
rise: Random.float(10, 99),
decline: Random.float(10, 99),
amount: Random.float(99999, 999999, 2, 2),
},
};
export default [
//主控台 卡片数据
{
url: '/admin/dashboard/console',
timeout: 1000,
method: 'get',
response: () => {
return resultSuccess(consoleInfo);
},
},
];

View File

@ -1,89 +0,0 @@
import { resultSuccess } from '../_util';
const menuList = () => {
const result: any[] = [
{
label: 'Dashboard',
key: 'dashboard',
type: 1,
subtitle: 'dashboard',
openType: 1,
auth: 'dashboard',
path: '/dashboard',
children: [
{
label: '主控台',
key: 'console',
type: 1,
subtitle: 'console',
openType: 1,
auth: 'console',
path: '/dashboard/console',
},
{
label: '工作台',
key: 'workplace',
type: 1,
subtitle: 'workplace',
openType: 1,
auth: 'workplace',
path: '/dashboard/workplace',
},
],
},
{
label: '表单管理',
key: 'form',
type: 1,
subtitle: 'form',
openType: 1,
auth: 'form',
path: '/form',
children: [
{
label: '基础表单',
key: 'basic-form',
type: 1,
subtitle: 'basic-form',
openType: 1,
auth: 'basic-form',
path: '/form/basic-form',
},
{
label: '分步表单',
key: 'step-form',
type: 1,
subtitle: 'step-form',
openType: 1,
auth: 'step-form',
path: '/form/step-form',
},
{
label: '表单详情',
key: 'detail',
type: 1,
subtitle: 'detail',
openType: 1,
auth: 'detail',
path: '/form/detail',
},
],
},
];
return result;
};
export default [
{
url: '/admin/menu/list',
timeout: 1000,
method: 'get',
response: () => {
const list = menuList();
return resultSuccess({
list,
});
},
},
];

View File

@ -1,46 +0,0 @@
import { doCustomTimes, resultSuccess } from '../_util';
function getMenuKeys() {
const keys = ['dashboard', 'console', 'workplace', 'basic-form', 'step-form', 'detail'];
const newKeys = [];
doCustomTimes(parseInt(Math.random() * 6), () => {
const key = keys[Math.floor(Math.random() * keys.length)];
// @ts-ignore
newKeys.push(key);
});
return Array.from(new Set(newKeys));
}
const roleList = (pageSize) => {
const result: any[] = [];
doCustomTimes(pageSize, () => {
result.push({
id: '@integer(10,100)',
name: '@cname()',
explain: '@cname()',
isDefault: '@boolean()',
menu_keys: getMenuKeys(),
create_date: `@date('yyyy-MM-dd hh:mm:ss')`,
'status|1': ['normal', 'enable', 'disable'],
});
});
return result;
};
export default [
{
url: '/admin/role/list',
timeout: 1000,
method: 'get',
response: ({ query }) => {
const { page = 1, pageSize = 10 } = query;
const list = roleList(Number(pageSize));
return resultSuccess({
page: Number(page),
pageSize: Number(pageSize),
pageCount: 60,
list,
});
},
},
];

View File

@ -1,40 +0,0 @@
import { Random } from 'mockjs';
import { doCustomTimes, resultSuccess } from '../_util';
const tableList = (pageSize) => {
const result: any[] = [];
doCustomTimes(pageSize, () => {
result.push({
id: '@integer(10,999999)',
beginTime: '@datetime',
endTime: '@datetime',
address: '@city()',
name: '@cname()',
avatar: Random.image('400x400', Random.color(), Random.color(), Random.first()),
date: `@date('yyyy-MM-dd')`,
time: `@time('HH:mm')`,
'no|100000-10000000': 100000,
'status|1': [true, false],
});
});
return result;
};
export default [
//表格数据列表
{
url: '/admin/table/list',
timeout: 1000,
method: 'get',
response: ({ query }) => {
const { page = 1, pageSize = 10 } = query;
const list = tableList(Number(pageSize));
return resultSuccess({
page: Number(page),
pageSize: Number(pageSize),
pageCount: 60,
list,
});
},
},
];

View File

@ -1,53 +0,0 @@
import { resultSuccess } from '../_util';
import { ApiEnum } from '@/enums/apiEnum';
const menusList = [
{
path: '/dashboard',
name: 'Dashboard',
component: 'LAYOUT',
redirect: '/dashboard/console',
meta: {
icon: 'DashboardOutlined',
title: 'Dashboard',
},
children: [
{
path: 'console',
name: 'dashboard_console',
component: '/dashboard/console/console',
meta: {
title: '主控台',
},
},
{
path: 'monitor',
name: 'dashboard_monitor',
component: '/dashboard/monitor/monitor',
meta: {
title: '监控页',
},
},
{
path: 'workplace',
name: 'dashboard_workplace',
component: '/dashboard/workplace/workplace',
meta: {
hidden: true,
title: '工作台',
},
},
],
},
];
export default [
{
url: ApiEnum.RoleDynamic,
timeout: 1000,
method: 'get',
response: () => {
return resultSuccess(menusList);
},
},
];

View File

@ -1,60 +0,0 @@
import Mock from 'mockjs';
import { ApiEnum } from '@/enums/apiEnum';
import { resultSuccess } from '../_util';
const Random = Mock.Random;
const token = Random.string('upper', 32, 32);
const adminInfo = {
userId: '1',
username: 'admin',
realName: 'Admin',
avatar: Random.image(),
desc: 'manager',
password: Random.string('upper', 4, 16),
token,
permissions: [
{
label: '主控台',
value: 'dashboard_console',
},
{
label: '监控页',
value: 'dashboard_monitor',
},
{
label: '工作台',
value: 'dashboard_workplace',
},
{
label: '基础列表',
value: 'basic_list',
},
{
label: '基础列表删除',
value: 'basic_list_delete',
},
],
};
export default [
{
url: ApiEnum.SiteLogin,
timeout: 1000,
method: 'post',
response: () => {
return resultSuccess({ token });
},
},
{
url: ApiEnum.MemberInfo, //ApiEnum.Prefix +
timeout: 1000,
method: 'get',
response: () => {
// const token = getRequestToken(request);
// if (!token) return resultError('Invalid token');
return resultSuccess(adminInfo);
},
},
];

View File

@ -1,6 +1,6 @@
{
"name": "hotgo",
"version": "2.6.10",
"version": "2.7.3",
"author": {
"name": "MengShuai",
"email": "133814250@qq.com",
@ -103,7 +103,6 @@
"vite": "^2.9.8",
"vite-plugin-compression": "^0.3.6",
"vite-plugin-html": "^2.1.2",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-require-transform": "^1.0.5",
"vite-plugin-style-import": "^1.4.1",
"vite-plugin-top-level-await": "^1.2.2",

View File

@ -77,6 +77,14 @@ export function SendBindSms() {
});
}
export function SendSms(params) {
return http.request({
url: '/sms/send',
method: 'post',
params,
});
}
export function updateMemberCash(params) {
return http.request({
url: '/member/updateCash',
@ -85,13 +93,55 @@ export function updateMemberCash(params) {
});
}
/**
* @description:
*/
export function getLoginConfig() {
return http.request<BasicResponseModel>({
url: ApiEnum.SiteLoginConfig,
method: 'get',
});
}
/**
* @description:
*/
export function register(params) {
return http.request<BasicResponseModel>(
{
url: ApiEnum.SiteRegister,
method: 'POST',
params,
},
{
isTransformResponse: false,
}
);
}
/**
* @description:
*/
export function login(params) {
return http.request<BasicResponseModel>(
{
url: ApiEnum.SiteLogin,
url: ApiEnum.SiteAccountLogin,
method: 'POST',
params,
},
{
isTransformResponse: false,
}
);
}
/**
* @description:
*/
export function mobileLogin(params) {
return http.request<BasicResponseModel>(
{
url: ApiEnum.SiteMobileLogin,
method: 'POST',
params,
},

View File

@ -1,10 +0,0 @@
import { http } from '@/utils/http/axios';
//获取table
export function getTableList(params) {
return http.request({
url: '/table/list',
method: 'get',
params,
});
}

View File

@ -3,7 +3,10 @@ export enum ApiEnum {
Prefix = '/api',
// 基础
SiteLogin = '/site/login', // 登录
SiteRegister = '/site/register', // 账号注册
SiteAccountLogin = '/site/accountLogin', // 账号登录
SiteMobileLogin = '/site/mobileLogin', // 手机号登录
SiteLoginConfig = '/site/loginConfig', // 登录配置
SiteLogout = '/site/logout', // 注销
SiteConfig = '/site/config', // 配置信息

View File

@ -1,5 +1,4 @@
import type { GlobConfig } from '/#/config';
import { warn } from '@/utils/log';
import { getAppEnvConfig } from '@/utils/env';
@ -10,7 +9,6 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
VITE_GLOB_APP_SHORT_NAME,
VITE_GLOB_API_URL_PREFIX,
VITE_GLOB_UPLOAD_URL,
VITE_GLOB_PROD_MOCK,
VITE_GLOB_IMG_URL,
} = getAppEnvConfig();
@ -27,7 +25,6 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
shortName: VITE_GLOB_APP_SHORT_NAME,
urlPrefix: VITE_GLOB_API_URL_PREFIX,
uploadUrl: VITE_GLOB_UPLOAD_URL,
prodMock: VITE_GLOB_PROD_MOCK,
imgUrl: VITE_GLOB_IMG_URL,
};
return glob as Readonly<GlobConfig>;

View File

@ -1,7 +1,7 @@
<template>
<div class="logo">
<img src="~@/assets/images/logo.png" alt="" :class="{ 'mr-2': !collapsed }" />
<h2 v-show="!collapsed" class="title">HG后台管理系统</h2>
<h2 v-show="!collapsed" class="title">{{ projectName }}</h2>
</div>
</template>
@ -13,6 +13,12 @@
type: Boolean,
},
},
setup() {
const projectName = import.meta.env.VITE_GLOB_APP_TITLE;
return {
projectName,
};
},
};
</script>

View File

@ -18,6 +18,7 @@ export function createRouterGuards(router: Router) {
router.beforeEach(async (to, from, next) => {
const Loading = window['$loading'] || null;
Loading && Loading.start();
if (from.path === LOGIN_PATH && to.name === 'errorPage') {
next(PageEnum.BASE_HOME);
return;
@ -25,6 +26,7 @@ export function createRouterGuards(router: Router) {
// Whitelist can be directly entered
if (whitePathList.includes(to.path as PageEnum)) {
await userStore.LoadLoginConfig();
next();
return;
}
@ -37,6 +39,7 @@ export function createRouterGuards(router: Router) {
next();
return;
}
// redirect login page
const redirectData: { path: string; replace: boolean; query?: Recordable<string> } = {
path: LOGIN_PATH,
@ -75,6 +78,7 @@ export function createRouterGuards(router: Router) {
return;
}
await userStore.LoadLoginConfig();
await userStore.GetConfig();
const routes = await asyncRouteStore.generateRoutes(userInfo);

View File

@ -1,9 +1,22 @@
import { defineStore } from 'pinia';
import { createStorage, storage } from '@/utils/Storage';
import { store } from '@/store';
import { ACCESS_TOKEN, CURRENT_CONFIG, CURRENT_USER, IS_LOCKSCREEN } from '@/store/mutation-types';
import {
ACCESS_TOKEN,
CURRENT_CONFIG,
CURRENT_LOGIN_CONFIG,
CURRENT_USER,
IS_LOCKSCREEN,
} from '@/store/mutation-types';
import { ResultEnum } from '@/enums/httpEnum';
import { getConfig, getUserInfo, login, logout } from '@/api/system/user';
import {
getConfig,
getLoginConfig,
getUserInfo,
login,
logout,
mobileLogin,
} from '@/api/system/user';
const Storage = createStorage({ storage: localStorage });
export interface UserInfoState {
@ -34,6 +47,7 @@ export interface UserInfoState {
lastLoginAt: string;
lastLoginIp: string;
openId: string;
inviteCode: string;
}
export interface ConfigState {
@ -42,6 +56,13 @@ export interface ConfigState {
wsAddr: string;
}
export interface LoginConfigState {
loginRegisterSwitch: number;
loginCaptchaSwitch: number;
loginProtocol: string;
loginPolicy: string;
}
export interface IUserState {
token: string;
username: string;
@ -50,6 +71,7 @@ export interface IUserState {
permissions: any[];
info: UserInfoState | null;
config: ConfigState | null;
loginConfig: LoginConfigState | null;
}
export const useUserStore = defineStore({
@ -62,6 +84,7 @@ export const useUserStore = defineStore({
permissions: [],
info: Storage.get(CURRENT_USER, null),
config: Storage.get(CURRENT_CONFIG, null),
loginConfig: Storage.get(CURRENT_LOGIN_CONFIG, null),
}),
getters: {
getToken(): string {
@ -85,6 +108,9 @@ export const useUserStore = defineStore({
getConfig(): ConfigState | null {
return this.config;
},
getLoginConfig(): LoginConfigState | null {
return this.loginConfig;
},
},
actions: {
setToken(token: string) {
@ -108,10 +134,20 @@ export const useUserStore = defineStore({
setConfig(config: ConfigState | null) {
this.config = config;
},
// 登录
setLoginConfig(config: LoginConfigState | null) {
this.loginConfig = config;
},
// 账号登录
async login(userInfo) {
return await this.handleLogin(login(userInfo));
},
// 手机号登录
async mobileLogin(userInfo) {
return await this.handleLogin(mobileLogin(userInfo));
},
async handleLogin(request: Promise<any>) {
try {
const response = await login(userInfo);
const response = await request;
const { data, code } = response;
if (code === ResultEnum.SUCCESS) {
const ex = 30 * 24 * 60 * 60 * 1000;
@ -150,7 +186,7 @@ export const useUserStore = defineStore({
});
});
},
// 获取用户配置
// 获取基础配置
GetConfig() {
const that = this;
return new Promise((resolve, reject) => {
@ -166,6 +202,22 @@ export const useUserStore = defineStore({
});
});
},
// 获取登录配置
LoadLoginConfig: function () {
const that = this;
return new Promise((resolve, reject) => {
getLoginConfig()
.then((res) => {
const result = res as unknown as LoginConfigState;
that.setLoginConfig(result);
storage.set(CURRENT_LOGIN_CONFIG, result);
resolve(res);
})
.catch((error) => {
reject(error);
});
});
},
// 登出
async logout() {
try {

View File

@ -1,5 +1,6 @@
export const ACCESS_TOKEN = 'ACCESS-TOKEN'; // 用户token
export const CURRENT_USER = 'CURRENT-USER'; // 当前用户信息
export const CURRENT_CONFIG = 'CURRENT-CONFIG'; // 当前用户信息
export const CURRENT_CONFIG = 'CURRENT-CONFIG'; // 当前基础配置
export const CURRENT_LOGIN_CONFIG = 'CURRENT-LOGIN-CONFIG'; // 当前登录配置
export const IS_LOCKSCREEN = 'IS-LOCKSCREEN'; // 是否锁屏
export const TABS_ROUTES = 'TABS-ROUTES'; // 标签页

View File

@ -28,7 +28,6 @@ export function getAppEnvConfig() {
VITE_GLOB_APP_SHORT_NAME,
VITE_GLOB_API_URL_PREFIX,
VITE_GLOB_UPLOAD_URL,
VITE_GLOB_PROD_MOCK,
VITE_GLOB_IMG_URL,
} = ENV;
@ -44,7 +43,6 @@ export function getAppEnvConfig() {
VITE_GLOB_APP_SHORT_NAME,
VITE_GLOB_API_URL_PREFIX,
VITE_GLOB_UPLOAD_URL,
VITE_GLOB_PROD_MOCK,
VITE_GLOB_IMG_URL,
};
}

View File

@ -174,4 +174,4 @@
);
</script>
<style lang="less"></style>
<style lang="less"></style>

View File

@ -0,0 +1,64 @@
<template>
<n-form-item class="default-color">
<div class="flex view-account-other">
<div class="flex-initial">
<span>其它登录方式</span>
</div>
<div class="flex-initial mx-2">
<a @click="handleLoginWechat">
<n-icon size="24" color="rgb(24, 160, 88)">
<LogoWechat />
</n-icon>
</a>
</div>
<div class="flex-initial mx-2">
<a @click="handleLogoTiktok">
<n-icon size="24" color="rgba(25, 28, 34, 0.88)">
<LogoTiktok />
</n-icon>
</a>
</div>
<div class="flex-initial" style="margin-left: auto" v-if="userStore.loginConfig?.loginRegisterSwitch === 1">
<a @click="updateActiveModule(moduleKey)">{{ tag }}</a>
</div>
</div>
</n-form-item>
</template>
<script lang="ts" setup>
import { LogoWechat, LogoTiktok } from '@vicons/ionicons5';
import { useUserStore } from '@/store/modules/user';
import {useMessage} from "naive-ui";
const userStore = useUserStore();
interface Props {
moduleKey: string;
tag: string;
}
withDefaults(defineProps<Props>(), {
moduleKey: 'register',
tag: '注册账号',
});
const message = useMessage();
const emit = defineEmits(['updateActiveModule']);
function updateActiveModule(key: string) {
emit('updateActiveModule', key);
}
function handleLogoTiktok() {
console.log('handleLogoTiktok...');
message.info('暂未开放');
}
function handleLoginWechat() {
console.log('handleLoginWechat...');
message.info('暂未开放');
}
</script>
<style scoped></style>

View File

@ -0,0 +1,68 @@
.view-account {
display: flex;
flex-direction: column;
height: 100vh;
overflow: auto;
&-container {
flex: 1;
padding: 32px 12px;
max-width: 384px;
min-width: 320px;
margin: 0 auto;
}
&-top {
padding: 32px 0;
text-align: center;
&-desc {
font-size: 14px;
color: #808695;
}
}
&-other {
width: 100%;
}
.default-color {
color: #515a6e;
.ant-checkbox-wrapper {
color: #515a6e;
}
}
}
@media (min-width: 768px) {
.view-account {
background-image: url('~@/assets/images/login.svg');
background-repeat: no-repeat;
background-position: 50%;
background-size: 100%;
}
.page-account-container {
padding: 32px 0 24px 0;
}
}
// ...
.justify-between {
justify-content: space-between;
}
.flex-y-center {
display: flex;
align-items: center;
}
.w-300px {
width: 300px;
}
.w-12px {
width: 12px;
}

View File

@ -1,224 +1,96 @@
<template>
<div class="view-account">
<div class="view-account-header"></div>
<div class="view-account-container">
<div class="view-account-top">
<div class="view-account-top-logo">
<img src="~@/assets/images/account-logo.png" alt="" />
</div>
<div class="view-account-top-desc">HotGo 后台管理系统</div>
</div>
<div class="view-account-form">
<n-form
ref="formRef"
label-placement="left"
size="large"
:model="formInline"
:rules="rules"
>
<n-form-item path="username">
<n-input
@keyup.enter="handleSubmit"
v-model:value="formInline.username"
placeholder="请输入用户名"
>
<template #prefix>
<n-icon size="18" color="#808695">
<PersonOutline />
</n-icon>
</template>
</n-input>
</n-form-item>
<n-form-item path="pass">
<n-input
@keyup.enter="handleSubmit"
v-model:value="formInline.pass"
type="password"
showpassOn="click"
placeholder="请输入密码"
>
<template #prefix>
<n-icon size="18" color="#808695">
<LockClosedOutline />
</n-icon>
</template>
</n-input>
</n-form-item>
<n-form-item path="code" v-show="codeBase64 !== ''">
<n-input-group>
<n-input
:style="{ width: '100%' }"
placeholder="验证码"
@keyup.enter="handleSubmit"
v-model:value="formInline.code"
>
<template #prefix>
<n-icon size="18" color="#808695" :component="SafetyCertificateOutlined" />
</template>
<template #suffix> </template>
</n-input>
<n-loading-bar-provider
:to="loadingBarTargetRef"
container-style="position: absolute;"
>
<img
ref="loadingBarTargetRef"
style="width: 100px"
:src="codeBase64"
@click="refreshCode"
loading="lazy"
alt="点击获取"
/>
<loading-bar-trigger />
</n-loading-bar-provider>
</n-input-group>
</n-form-item>
<n-form-item class="default-color">
<div class="flex justify-between">
<div class="flex-initial">
<n-checkbox v-model:checked="autoLogin">自动登录</n-checkbox>
</div>
<div class="flex-initial order-last">
<a href="javascript:">忘记密码</a>
</div>
</div>
</n-form-item>
<n-form-item>
<n-button type="primary" @click="handleSubmit" size="large" :loading="loading" block>
登录
</n-button>
</n-form-item>
<n-form-item class="default-color">
<div class="flex view-account-other">
<div class="flex-initial">
<span>其它登录方式</span>
</div>
<div class="flex-initial mx-2">
<a href="javascript:">
<n-icon size="24" color="#2d8cf0">
<LogoWechat />
</n-icon>
</a>
</div>
<div class="flex-initial mx-2">
<a href="javascript:">
<n-icon size="24" color="#2d8cf0">
<LogoTiktok />
</n-icon>
</a>
</div>
<div class="flex-initial" style="margin-left: auto">
<a @click="handleRegister">注册账号</a>
</div>
</div>
</n-form-item>
</n-form>
</div>
<div :style="containerCSS">
<n-card :bordered="false">
<header class="justify-between">
<n-space justify="center">
<div></div>
<img src="~@/assets/images/logo.png" class="account-logo" alt="" />
<n-gradient-text type="primary" :size="26">{{ projectName }}</n-gradient-text>
<div></div>
</n-space>
</header>
<main class="pt-24px">
<div class="pt-18px">
<transition name="fade-slide" appear>
<component
:is="activeModule.component"
@updateActiveModule="handleUpdateActiveModule"
/>
</transition>
</div>
</main>
</n-card>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { ref, computed, onMounted } from 'vue';
import type { Component } from 'vue';
import LoginFrom from './login/index.vue';
import RegisterFrom from './register/index.vue';
import { useRouter } from 'vue-router';
import { useUserStore } from '@/store/modules/user';
import { useMessage, useLoadingBar } from 'naive-ui';
import { ResultEnum } from '@/enums/httpEnum';
import { PersonOutline, LockClosedOutline, LogoWechat, LogoTiktok } from '@vicons/ionicons5';
import { PageEnum } from '@/enums/pageEnum';
import { SafetyCertificateOutlined } from '@vicons/antd';
import { GetCaptcha } from '@/api/base';
import { aesEcb } from '@/utils/encrypt';
interface FormState {
username: string;
pass: string;
cid: string;
code: string;
password: string;
}
const formRef = ref();
const message = useMessage();
const loading = ref(false);
const autoLogin = ref(true);
const codeBase64 = ref('');
const loadingBar = useLoadingBar();
const loadingBarTargetRef = ref<undefined | HTMLElement>(undefined);
const LOGIN_NAME = PageEnum.BASE_LOGIN_NAME;
const formInline = ref<FormState>({
username: '',
pass: '',
cid: '',
code: '',
password: '',
});
const rules = {
username: { required: true, message: '请输入用户名', trigger: 'blur' },
pass: { required: true, message: '请输入密码', trigger: 'blur' },
code: { required: true, message: '请输入验证码', trigger: 'blur' },
};
const userStore = useUserStore();
const projectName = import.meta.env.VITE_GLOB_APP_TITLE;
interface LoginModule {
key: string;
label: string;
component: Component;
}
const router = useRouter();
const route = useRoute();
const activeModule = ref<LoginModule>({
key: 'login',
label: '账号登录',
component: LoginFrom,
});
const handleSubmit = (e) => {
e.preventDefault();
formRef.value.validate(async (errors) => {
if (!errors) {
message.loading('登录中...');
loading.value = true;
try {
const { code, message: msg } = await userStore.login({
username: formInline.value.username,
password: aesEcb.encrypt(formInline.value.pass),
cid: formInline.value.cid,
code: formInline.value.code,
});
message.destroyAll();
if (code == ResultEnum.SUCCESS) {
const toPath = decodeURIComponent((route.query?.redirect || '/') as string);
message.success('登录成功,即将进入系统');
if (route.name === LOGIN_NAME) {
await router.replace('/');
} else await router.replace(toPath);
} else {
message.info(msg || '登录失败');
await refreshCode();
}
} finally {
loading.value = false;
}
} else {
message.error('请填写完整信息,并且进行验证码校验');
}
});
};
const modules: LoginModule[] = [
{ key: 'login', label: '账号登录', component: LoginFrom },
// { key: 'register', label: '', component: RegisterFrom },
// { key: 'reset-pwd', label: '', component: ResetPwd },
// { key: 'bind-wechat', label: '', component: BindWechat }
];
async function refreshCode() {
loadingBar.start();
const data = await GetCaptcha();
codeBase64.value = data.base64;
formInline.value.cid = data.cid;
formInline.value.code = '';
loadingBar.finish();
const containerCSS = computed(() => {
const val = document.body.clientWidth;
return val <= 720
? {}
: {
flex: `1`,
padding: `62px 12px`,
'max-width': `484px`,
'min-width': '320px',
margin: '0 auto',
};
});
function handleUpdateActiveModule(key: string) {
const findItem = modules.find((item) => item.key === key);
if (findItem) {
activeModule.value = findItem;
}
}
onMounted(() => {
setTimeout(function () {
refreshCode();
});
console.log('window.location.href',route.path);
});
//
if (userStore.loginConfig?.loginRegisterSwitch === 1) {
const findItem = modules.find((item) => item.key === 'register');
if (!findItem) {
modules.push({ key: 'register', label: '注册账号', component: RegisterFrom });
}
}
function handleRegister() {
message.success('即将开放,请稍后');
return;
}
const key = router.currentRoute.value.query?.scope as string;
if (key) {
handleUpdateActiveModule(key);
}
});
</script>
<style lang="less" scoped>
@ -228,14 +100,6 @@
height: 100vh;
overflow: auto;
&-container {
flex: 1;
padding: 32px 12px;
max-width: 384px;
min-width: 320px;
margin: 0 auto;
}
&-top {
padding: 32px 0;
text-align: center;
@ -271,4 +135,40 @@
padding: 32px 0 24px 0;
}
}
.card-tabs .n-tabs-nav--bar-type {
padding-left: 4px;
}
.pt-24px {
padding-top: 24px;
}
.pt-18px {
padding-top: 18px;
}
.text-18px {
font-size: 18px;
}
.ease-in-out {
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
.duration-300 {
transition-duration: 0.3s;
}
.transition {
transition-property: color, background-color, border-color, outline-color, text-decoration-color,
fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 0.15s;
}
.account-logo {
width: 42px;
height: 42px;
}
</style>

View File

@ -0,0 +1,47 @@
<template>
<n-space :vertical="true">
<n-divider>演示角色登录</n-divider>
<n-space justify="center">
<n-button
v-for="item in accounts"
:key="item.username"
type="primary"
@click="login(item.username, item.password)"
>
{{ item.label }}
</n-button>
</n-space>
</n-space>
</template>
<script lang="ts" setup>
interface Emits {
(e: 'login', param: { username: string; password: string }): void;
}
const emit = defineEmits<Emits>();
const accounts = [
{
label: '超级管理员',
username: 'admin',
password: '123456',
},
{
label: '管理员',
username: 'test',
password: '123456',
},
{
label: '普通用户',
username: 'ameng',
password: '123456',
},
];
function login(username: string, password: string) {
emit('login', { username, password });
}
</script>
<style scoped></style>

View File

@ -0,0 +1,311 @@
<template>
<n-form
ref="formRef"
label-placement="left"
size="large"
:model="mode === 'account' ? formInline : formMobile"
:rules="mode === 'account' ? rules : mobileRules"
>
<template v-if="mode === 'account'">
<n-form-item path="username">
<n-input
@keyup.enter="handleSubmit"
v-model:value="formInline.username"
placeholder="请输入用户名"
>
<template #prefix>
<n-icon size="18" color="#808695">
<PersonOutline />
</n-icon>
</template>
</n-input>
</n-form-item>
<n-form-item path="pass">
<n-input
@keyup.enter="handleSubmit"
v-model:value="formInline.pass"
type="password"
show-password-on="click"
placeholder="请输入密码"
>
<template #prefix>
<n-icon size="18" color="#808695">
<LockClosedOutline />
</n-icon>
</template>
</n-input>
</n-form-item>
<n-form-item path="code" v-show="codeBase64 !== ''">
<n-input-group>
<n-input
:style="{ width: '100%' }"
placeholder="验证码"
@keyup.enter="handleSubmit"
v-model:value="formInline.code"
>
<template #prefix>
<n-icon size="18" color="#808695" :component="SafetyCertificateOutlined" />
</template>
<template #suffix> </template>
</n-input>
<n-loading-bar-provider :to="loadingBarTargetRef" container-style="position: absolute;">
<img
ref="loadingBarTargetRef"
style="width: 100px"
:src="codeBase64"
@click="refreshCode"
loading="lazy"
alt="点击获取"
/>
<loading-bar-trigger />
</n-loading-bar-provider>
</n-input-group>
</n-form-item>
</template>
<template v-if="mode === 'mobile'">
<n-form-item path="mobile">
<n-input
@keyup.enter="handleMobileSubmit"
v-model:value="formMobile.mobile"
placeholder="请输入手机号码"
>
<template #prefix>
<n-icon size="18" color="#808695">
<MobileOutlined />
</n-icon>
</template>
</n-input>
</n-form-item>
<n-form-item path="code">
<n-input-group>
<n-input
@keyup.enter="handleMobileSubmit"
v-model:value="formMobile.code"
placeholder="请输入验证码"
>
<template #prefix>
<n-icon size="18" color="#808695" :component="SafetyCertificateOutlined" />
</template>
</n-input>
<n-button
type="primary"
ghost
@click="sendMobileCode"
:disabled="isCounting"
:loading="sendLoading"
>
{{ sendLabel }}
</n-button>
</n-input-group>
</n-form-item>
</template>
<n-space :vertical="true" :size="24">
<div class="flex-y-center justify-between">
<n-checkbox v-model:checked="autoLogin">自动登录</n-checkbox>
<n-button :text="true" @click="handleResetPassword">忘记密码</n-button>
</div>
<n-button type="primary" size="large" :block="true" :loading="loading" @click="handleLogin">
确定
</n-button>
<FormOther moduleKey="register" tag="注册账号" @updateActiveModule="updateActiveModule" />
</n-space>
<DemoAccount @login="handleDemoAccountLogin" />
</n-form>
</template>
<script lang="ts" setup>
import '../components/style.less';
import { ref, onMounted } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useUserStore } from '@/store/modules/user';
import { useMessage, useLoadingBar } from 'naive-ui';
import { ResultEnum } from '@/enums/httpEnum';
import { PersonOutline, LockClosedOutline } from '@vicons/ionicons5';
import { PageEnum } from '@/enums/pageEnum';
import { SafetyCertificateOutlined, MobileOutlined } from '@vicons/antd';
import { GetCaptcha } from '@/api/base';
import { aesEcb } from '@/utils/encrypt';
import DemoAccount from './demo-account.vue';
import FormOther from '../components/form-other.vue';
import { useSendCode } from '@/hooks/common';
import { SendSms } from '@/api/system/user';
import { validate } from '@/utils/validateUtil';
interface Props {
mode: string;
}
const props = withDefaults(defineProps<Props>(), {
mode: 'account',
});
interface FormState {
username: string;
pass: string;
cid: string;
code: string;
password: string;
}
interface FormMobileState {
mobile: string;
code: string;
}
const formRef = ref();
const message = useMessage();
const loading = ref(false);
const autoLogin = ref(true);
const codeBase64 = ref('');
const loadingBar = useLoadingBar();
const loadingBarTargetRef = ref<undefined | HTMLElement>(undefined);
const userStore = useUserStore();
const router = useRouter();
const route = useRoute();
const { sendLabel, isCounting, loading: sendLoading, activateSend } = useSendCode();
const emit = defineEmits(['updateActiveModule']);
const LOGIN_NAME = PageEnum.BASE_LOGIN_NAME;
const formInline = ref<FormState>({
username: '',
pass: '',
cid: '',
code: '',
password: '',
});
const formMobile = ref<FormMobileState>({
mobile: '',
code: '',
});
const rules = {
username: { required: true, message: '请输入用户名', trigger: 'blur' },
pass: { required: true, message: '请输入密码', trigger: 'blur' },
};
const mobileRules = {
mobile: { required: true, message: '请输入手机号码', trigger: 'blur' },
code: { required: true, message: '请输入验证码', trigger: 'blur' },
};
const handleSubmit = (e) => {
e.preventDefault();
formRef.value.validate(async (errors) => {
if (!errors) {
if (userStore.loginConfig?.loginCaptchaSwitch === 1 && formInline.value.code === '') {
message.error('请输入验证码');
return;
}
const params = {
username: formInline.value.username,
password: aesEcb.encrypt(formInline.value.pass),
cid: formInline.value.cid,
code: formInline.value.code,
};
await handleLoginResp(userStore.login(params));
} else {
message.error('请填写完整信息,并且进行验证码校验');
}
});
};
async function refreshCode() {
if (userStore.loginConfig?.loginCaptchaSwitch !== 1) {
return;
}
loadingBar.start();
const data = await GetCaptcha();
codeBase64.value = data.base64;
formInline.value.cid = data.cid;
formInline.value.code = '';
loadingBar.finish();
}
async function handleDemoAccountLogin(user: { username: string; password: string }) {
const params = {
username: user.username,
password: aesEcb.encrypt(user.password),
isLock: true,
};
await handleLoginResp(userStore.login(params));
}
const handleMobileSubmit = (e) => {
e.preventDefault();
formRef.value.validate(async (errors) => {
if (!errors) {
const params = {
mobile: formMobile.value.mobile,
code: formMobile.value.code,
};
await handleLoginResp(userStore.mobileLogin(params));
} else {
message.error('请填写完整信息,并且进行验证码校验');
}
});
};
function updateActiveModule(key: string) {
emit('updateActiveModule', key);
}
function sendMobileCode() {
validate.phone(mobileRules.mobile, formMobile.value.mobile, function (error?: Error) {
if (error === undefined) {
activateSend(SendSms({ mobile: formMobile.value.mobile, event: 'login' }));
return;
}
message.error(error.message);
});
}
function handleResetPassword() {
message.info('如果你忘记了密码,请联系管理员找回');
}
function handleLogin(e) {
if (props.mode === 'account') {
handleSubmit(e);
return;
}
handleMobileSubmit(e);
}
async function handleLoginResp(request: Promise<any>) {
message.loading('登录中...');
loading.value = true;
try {
const { code, message: msg } = await request;
message.destroyAll();
if (code == ResultEnum.SUCCESS) {
const toPath = decodeURIComponent((route.query?.redirect || '/') as string);
message.success('登录成功,即将进入系统');
if (route.name === LOGIN_NAME) {
await router.replace('/');
} else await router.replace(toPath);
} else {
message.destroyAll();
message.info(msg || '登录失败');
await refreshCode();
}
} finally {
loading.value = false;
}
}
onMounted(() => {
setTimeout(function () {
refreshCode();
});
});
</script>

View File

@ -0,0 +1,22 @@
<template>
<n-tabs type="segment" justify-content="space-evenly">
<n-tab-pane name="account" tab="账号登录">
<Form @updateActiveModule="updateActiveModule" mode="account" />
</n-tab-pane>
<n-tab-pane name="mobile" tab="手机号登录">
<Form @updateActiveModule="updateActiveModule" mode="mobile" />
</n-tab-pane>
</n-tabs>
</template>
<script lang="ts" setup>
import Form from './form.vue';
const emit = defineEmits(['updateActiveModule']);
function updateActiveModule(key: string) {
emit('updateActiveModule', key);
}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,53 @@
<template>
<div>
<n-checkbox v-model:checked="checked" class="text-14px">我已阅读并接受</n-checkbox>
<n-button :text="true" type="primary" @click="handleClickProtocol" class="text-13px"
>用户协议</n-button
>
<n-button :text="true" type="primary" @click="handleClickPolicy" class="text-13px"
>隐私权政策</n-button
>
</div>
</template>
<script setup lang="ts">
import { computed } from 'vue';
interface Props {
value?: boolean;
}
const props = withDefaults(defineProps<Props>(), {
value: true,
});
interface Emits {
(e: 'update:value', value: boolean): void;
(e: 'click-protocol'): void;
(e: 'click-policy'): void;
}
const emit = defineEmits<Emits>();
const checked = computed({
get() {
return props.value;
},
set(newValue: boolean) {
emit('update:value', newValue);
},
});
function handleClickProtocol() {
emit('click-protocol');
}
function handleClickPolicy() {
emit('click-policy');
}
</script>
<style scoped>
.text-14px {
font-size: 14px;
}
</style>

Some files were not shown because too many files have changed in this diff Show More