Git Product home page Git Product logo

micro-todolist's Introduction

micro-todolist's People

Contributors

3927o avatar cocainecong avatar fleezesd avatar fodesu avatar palp1tate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

micro-todolist's Issues

JWT UserInfo 缓存问题

作者这里的的缓存 InitUserInfo() 方法有问题吧

如果用 user_key 作为缓存的 key :

  1. 第二帐户登录的时候,缓存会覆盖。
  2. 如果这时候,第一个帐户的 token没有过期,然后在 task 中调用 GetUserInfo() , 拿到的是第二个用户的信息。

var userKey string = "user_key"
type UserInfo struct {
Id uint `json:"id"`
}
func InitUserInfo(ctx context.Context, user *UserInfo) error {
cachedUser, err := GetUserInfo(ctx)
if err != nil {
return err
}
// 如果缓存中存在用户信息,直接返回
if cachedUser != nil {
return nil
}
// 如果缓存中不存在用户信息,将用户信息存储到缓存中
if err := SetUserInCache(ctx, user, cache.RedisClient); err != nil {
return err
}
return nil
}

通道问题

在app/task/repository/mq/task文件下的task_sync.go 中关于forever通道只使用了var声明,而最后直接取值,这部分有问题吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.