作者 唐旭辉

..

... ... @@ -142,13 +142,14 @@ func (c *AuthController) Me() {
}
const (
captchaID = "48a6ebac4ebc6642d68c217fca33eb4d"
privateKey = "4f1c085290bec5afdc54df73535fc361"
captchaID = "33a2abf9c5df0d6bc3b89fb39280114b"
privateKey = "13320fd2b10199e9a2440a4fbb4d46f7"
)
func (c *AuthController) RegisterGeetest() {
geetest := geetest.NewGeetestLib(captchaID, privateKey, 2*time.Second)
status, responseBt := geetest.PreProcess("", "")
userip := c.Ctx.Input.IP()
status, responseBt := geetest.PreProcess("", userip)
c.SetSession("geetest_status", status)
c.Ctx.Output.Body(responseBt)
return
... ...
... ... @@ -59,6 +59,7 @@ func saveFile(fileData *multipart.FileHeader, fileType string) (hostpath string,
subfix := path.Ext(fileData.Filename)
mfileName := fmt.Sprint(utils.GenerateIDBySonyflake())
mfileName = fmt.Sprintf("%d_%s%s", time.Now().Unix(), mfileName, subfix)
log.Debug("文件保存地址%s", filepath.Join(savepath, mfileName))
dst, err := os.Create(filepath.Join(savepath, mfileName))
defer dst.Close()
if err != nil {
... ...