1 Star 1 Fork 1

xiaoyutab / xgotool

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
unbind.go 548 Bytes
一键复制 编辑 原始数据 按行查看 历史
xiaoyutab 提交于 2024-04-30 10:12 . 调整xcron和xcache的目录结构
package xlogin
import (
"errors"
"gitee.com/xiaoyutab/xgotool/individual/xcache"
)
// Openid解绑
//
// openid 三方唯一标识
// typ 所属三方
func UnBind(openid string, typ uint8) error {
info, err := Openid2info(openid, typ)
if err != nil {
return err
}
if info.UserId == 0 {
return errors.New("该三方标识已解绑")
}
info.UserId = 0
// 入库
err = _default.DB.Save(info).Error
if err != nil {
return err
}
// 入缓存
xcache.SetStruct(xcache.Key("xlogin.openid2info-v1", openid, typ), info)
return nil
}
Go
1
https://gitee.com/xiaoyutab/xgotool.git
git@gitee.com:xiaoyutab/xgotool.git
xiaoyutab
xgotool
xgotool
v0.3.9

搜索帮助