26 lines
422 B
Go
26 lines
422 B
Go
package common
|
|
|
|
import (
|
|
"context"
|
|
"kami/internal/service"
|
|
|
|
"kami/api/common/v1"
|
|
)
|
|
|
|
func (c *ControllerV1) GetCaptcha(ctx context.Context, req *v1.GetCaptchaReq) (res *v1.GetCaptchaRes, err error) {
|
|
var (
|
|
idKeyC, base64stringC string
|
|
)
|
|
idKeyC, base64stringC, err = service.Captcha().GetVerifyImgString(ctx)
|
|
|
|
if err != nil {
|
|
return
|
|
}
|
|
|
|
res = &v1.GetCaptchaRes{
|
|
Key: idKeyC,
|
|
Img: base64stringC,
|
|
}
|
|
return
|
|
}
|
