Skip to content

Commit

Permalink
Ready to release 3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zicla committed May 26, 2019
1 parent ddf67be commit af41e89
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 24 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ b. 上传 tank-x.x.x.windows-x86_64.zip 到蓝眼云盘
c. 在github上发布新版本。


2019-05-27
tank-3.0.2
1. fix https://github.com/eyebluecn/tank/issues/51
2. fix https://github.com/eyebluecn/tank/issues/52
3. fix i18n issue for moving files.


2019-05-23
tank-3.0.0
1. 分享文件夹
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[English Version](./README_EN.md)

# 蓝眼云盘(3.0.0
# 蓝眼云盘(3.0.2

[在线Demo](https://tank.eyeblue.cn) (体验账号: demo 密码:123456)

Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/html/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>tank-front-tmp</title><link href=/css/app.a576a8d2.css rel=preload as=style><link href=/css/chunk-vendors.cb22afd2.css rel=preload as=style><link href=/js/app.24a25fb1.js rel=preload as=script><link href=/js/chunk-vendors.220ccae9.js rel=preload as=script><link href=/css/chunk-vendors.cb22afd2.css rel=stylesheet><link href=/css/app.a576a8d2.css rel=stylesheet></head><body><noscript><strong>We're sorry but tank-front-tmp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.220ccae9.js></script><script src=/js/app.24a25fb1.js></script></body></html>
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>EyeblueTank</title><link href=/css/app.b8a22cc6.css rel=preload as=style><link href=/css/chunk-vendors.cb22afd2.css rel=preload as=style><link href=/js/app.5778b328.js rel=preload as=script><link href=/js/chunk-vendors.220ccae9.js rel=preload as=script><link href=/css/chunk-vendors.cb22afd2.css rel=stylesheet><link href=/css/app.b8a22cc6.css rel=stylesheet></head><body><noscript><strong>We're sorry but tank-front-tmp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.220ccae9.js></script><script src=/js/app.5778b328.js></script></body></html>
11 changes: 0 additions & 11 deletions build/html/js/app.24a25fb1.js

This file was deleted.

1 change: 0 additions & 1 deletion build/html/js/app.24a25fb1.js.map

This file was deleted.

11 changes: 11 additions & 0 deletions build/html/js/app.5778b328.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/html/js/app.5778b328.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/pack/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@REM prepare the variables.

@REM version name
SET VERSION_NAME=tank-3.0.0
SET VERSION_NAME=tank-3.0.2
@REM assign variable like Linux GOARCH=$(go env GOARCH) eg. amd64
FOR /f %%i IN ('go env GOARCH') DO SET GOARCH=%%i
ECHO GOARCH: %GOARCH%
Expand Down
2 changes: 1 addition & 1 deletion build/pack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#prepare the variables.

# version name
VERSION_NAME=tank-3.0.0
VERSION_NAME=tank-3.0.2
echo "VERSION_NAME: ${VERSION_NAME}"
# eg. amd64
GOARCH=$(go env GOARCH)
Expand Down
2 changes: 1 addition & 1 deletion code/core/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const (
//db table's prefix. tank30_ means current version is tank:3.0.x
TABLE_PREFIX = "tank30_"

VERSION = "3.0.0"
VERSION = "3.0.2"
)

type Config interface {
Expand Down
24 changes: 18 additions & 6 deletions code/rest/user_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
type UserController struct {
BaseController
preferenceService *PreferenceService
userService *UserService
}

func (this *UserController) Init() {
Expand All @@ -24,6 +25,12 @@ func (this *UserController) Init() {
if b, ok := b.(*PreferenceService); ok {
this.preferenceService = b
}

b = core.CONTEXT.GetBean(this.userService)
if b, ok := b.(*UserService); ok {
this.userService = b
}

}

func (this *UserController) RegisterRoutes() map[string]func(writer http.ResponseWriter, request *http.Request) {
Expand Down Expand Up @@ -226,12 +233,11 @@ func (this *UserController) Detail(writer http.ResponseWriter, request *http.Req

func (this *UserController) Logout(writer http.ResponseWriter, request *http.Request) *result.WebResult {

//expire session.
sessionCookie, err := request.Cookie(core.COOKIE_AUTH_KEY)
if err != nil {
return this.Success("OK")
//try to find from SessionCache.
sessionId := util.GetSessionUuidFromRequest(request, core.COOKIE_AUTH_KEY)
if sessionId == "" {
return nil
}
sessionId := sessionCookie.Value

user := this.findUser(request)
if user != nil {
Expand All @@ -241,7 +247,7 @@ func (this *UserController) Logout(writer http.ResponseWriter, request *http.Req
}

//delete session.
_, err = core.CONTEXT.GetSessionCache().Delete(sessionId)
_, err := core.CONTEXT.GetSessionCache().Delete(sessionId)
if err != nil {
this.logger.Error("error while deleting session.")
}
Expand Down Expand Up @@ -327,6 +333,12 @@ func (this *UserController) ToggleStatus(writer http.ResponseWriter, request *ht

currentUser = this.userDao.Save(currentUser)

cacheUsers := this.userService.FindCacheUsersByUuid(currentUser.Uuid)
this.logger.Info("find %d cache users", len(cacheUsers))
for _, u := range cacheUsers {
u.Status = currentUser.Status
}

return this.Success(currentUser)

}
Expand Down
22 changes: 22 additions & 0 deletions code/rest/user_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,25 @@ func (this *UserService) PreHandle(writer http.ResponseWriter, request *http.Req
}

}

//find a cache user by its userUuid
func (this *UserService) FindCacheUsersByUuid(userUuid string) []*User {

var users []*User
//let session user work.
core.CONTEXT.GetSessionCache().Foreach(func(key interface{}, cacheItem *cache.Item) {
if cacheItem == nil || cacheItem.Data() == nil {
return
}
if value, ok := cacheItem.Data().(*User); ok {
var user = value
if user.Uuid == userUuid {
users = append(users, user)
}
} else {
this.logger.Error("cache item not store the *User")
}
})

return users
}

0 comments on commit af41e89

Please sign in to comment.