Ver código fonte

update

add_mode
DengBiao 1 ano atrás
pai
commit
c66b1ef20a
5 arquivos alterados com 18 adições e 2 exclusões
  1. +11
    -0
      app/admin/hdl/hdl_demo.go
  2. +1
    -0
      app/admin/md/md_enterprise_manage.go
  3. +1
    -0
      app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go
  4. +3
    -0
      app/customer/mw/mw_customer_auth.go
  5. +2
    -2
      app/router/admin_router.go

+ 11
- 0
app/admin/hdl/hdl_demo.go Ver arquivo

@@ -3,7 +3,9 @@ package hdl
import (
"applet/app/db"
"applet/app/e"
"fmt"
"github.com/gin-gonic/gin"
"time"
)

// Demo 测试
@@ -16,4 +18,13 @@ func Demo(c *gin.Context) {
return
}
e.OutSuc(c, data, nil)
go GoOnExecuting()
return
}

func GoOnExecuting() {
for i := 0; i < 20; i++ {
time.Sleep(1 * time.Second)
fmt.Println(i)
}
}

+ 1
- 0
app/admin/md/md_enterprise_manage.go Ver arquivo

@@ -226,6 +226,7 @@ type CentralKitchenForSchoolReserveListReq struct {
}

type CentralKitchenForSchoolReserveListResp struct {
Id int `json:"id" `
EnterpriseId int `json:"enterprise_id" `
EnterpriseName string `json:"enterprise_name" `
Uid int `json:"uid" `


+ 1
- 0
app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go Ver arquivo

@@ -561,6 +561,7 @@ func CentralKitchenForSchoolReserveList(req md.CentralKitchenForSchoolReserveLis

for _, v := range m {
resp = append(resp, md.CentralKitchenForSchoolReserveListResp{
Id: v.CentralKitchenForSchoolPackageOrdForReserve.Id,
EnterpriseId: v.UserIdentity.EnterpriseId,
EnterpriseName: v.Enterprise.Name,
Uid: v.UserIdentity.Uid,


+ 3
- 0
app/customer/mw/mw_customer_auth.go Ver arquivo

@@ -3,12 +3,15 @@ package mw
import (
"applet/app/customer/svc"
"applet/app/e"
"fmt"
"github.com/gin-gonic/gin"
)

// 检查权限, 签名等等
func Auth(c *gin.Context) {
user, err := svc.CheckUser(c)
fmt.Println("user>>>>>>>>>", user)
fmt.Println("err>>>>>>>>>", err)
if err != nil {
switch err.(type) {
case e.E:


+ 2
- 2
app/router/admin_router.go Ver arquivo

@@ -186,11 +186,11 @@ func rRole(r *gin.RouterGroup) {
}

func AdminRoute(r *gin.RouterGroup) {
r.GET("/demo", hdl2.Demo)

r.POST("/login", hdl2.Login)

r.Use(mw.Auth) //检测登录状态
r.GET("/demo", hdl2.Demo)
r.Use(mw.Auth) //检测登录状态
r.GET("/userInfo", hdl2.UserInfo) //用户信息
r.Any("/changePwd", hdl2.Demo) //修改密码
r.GET("/sysCfg", hdl2.GetSysCfg) //基础配置-获取


Carregando…
Cancelar
Salvar