package controllers import ( "AIOTCOER/lib" "AIOTCOER/models/Product" beego "github.com/beego/beego/v2/server/web" ) type UpFileController struct { beego.Controller } // 列表 - func (c *UpFileController) UpFileToken() { ProductTyper := Product.ProductType{ T_ProductID:c.GetString("T_ProductID"), } if !ProductTyper.Read() { c.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "ProductID E!"} c.ServeJSON() return } // 验证 T_uuid T_uuid := lib.Take_one(c.Ctx.GetCookie("T_uuid"), c.GetString("T_uuid")) if ProductTyper.T_uuid != T_uuid { c.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "T_uuid!"} c.ServeJSON() return } c.Data["json"] = lib.JSONR{Code: 200, Msg: "ok!", Data: lib.UploadToken(c.GetString("T_suffix"))} c.ServeJSON() return }