Ready to release 3.0.2
This commit is contained in:
@ -52,6 +52,13 @@ b. 上传 tank-x.x.x.windows-x86_64.zip 到蓝眼云盘
|
|||||||
c. 在github上发布新版本。
|
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
|
2019-05-23
|
||||||
tank-3.0.0
|
tank-3.0.0
|
||||||
1. 分享文件夹
|
1. 分享文件夹
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
[English Version](./README_EN.md)
|
[English Version](./README_EN.md)
|
||||||
|
|
||||||
# 蓝眼云盘(3.0.0)
|
# 蓝眼云盘(3.0.2)
|
||||||
|
|
||||||
[在线Demo](https://tank.eyeblue.cn) (体验账号: demo 密码:123456)
|
[在线Demo](https://tank.eyeblue.cn) (体验账号: demo 密码:123456)
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -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>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
11
build/html/js/app.5778b328.js
Normal file
11
build/html/js/app.5778b328.js
Normal file
File diff suppressed because one or more lines are too long
1
build/html/js/app.5778b328.js.map
Normal file
1
build/html/js/app.5778b328.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -11,7 +11,7 @@
|
|||||||
@REM prepare the variables.
|
@REM prepare the variables.
|
||||||
|
|
||||||
@REM version name
|
@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
|
@REM assign variable like Linux GOARCH=$(go env GOARCH) eg. amd64
|
||||||
FOR /f %%i IN ('go env GOARCH') DO SET GOARCH=%%i
|
FOR /f %%i IN ('go env GOARCH') DO SET GOARCH=%%i
|
||||||
ECHO GOARCH: %GOARCH%
|
ECHO GOARCH: %GOARCH%
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#prepare the variables.
|
#prepare the variables.
|
||||||
|
|
||||||
# version name
|
# version name
|
||||||
VERSION_NAME=tank-3.0.0
|
VERSION_NAME=tank-3.0.2
|
||||||
echo "VERSION_NAME: ${VERSION_NAME}"
|
echo "VERSION_NAME: ${VERSION_NAME}"
|
||||||
# eg. amd64
|
# eg. amd64
|
||||||
GOARCH=$(go env GOARCH)
|
GOARCH=$(go env GOARCH)
|
||||||
|
@ -12,7 +12,7 @@ const (
|
|||||||
//db table's prefix. tank30_ means current version is tank:3.0.x
|
//db table's prefix. tank30_ means current version is tank:3.0.x
|
||||||
TABLE_PREFIX = "tank30_"
|
TABLE_PREFIX = "tank30_"
|
||||||
|
|
||||||
VERSION = "3.0.0"
|
VERSION = "3.0.2"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config interface {
|
type Config interface {
|
||||||
|
@ -15,6 +15,7 @@ import (
|
|||||||
type UserController struct {
|
type UserController struct {
|
||||||
BaseController
|
BaseController
|
||||||
preferenceService *PreferenceService
|
preferenceService *PreferenceService
|
||||||
|
userService *UserService
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *UserController) Init() {
|
func (this *UserController) Init() {
|
||||||
@ -24,6 +25,12 @@ func (this *UserController) Init() {
|
|||||||
if b, ok := b.(*PreferenceService); ok {
|
if b, ok := b.(*PreferenceService); ok {
|
||||||
this.preferenceService = b
|
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) {
|
func (this *UserController) RegisterRoutes() map[string]func(writer http.ResponseWriter, request *http.Request) {
|
||||||
@ -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 {
|
func (this *UserController) Logout(writer http.ResponseWriter, request *http.Request) *result.WebResult {
|
||||||
|
|
||||||
//expire session.
|
//try to find from SessionCache.
|
||||||
sessionCookie, err := request.Cookie(core.COOKIE_AUTH_KEY)
|
sessionId := util.GetSessionUuidFromRequest(request, core.COOKIE_AUTH_KEY)
|
||||||
if err != nil {
|
if sessionId == "" {
|
||||||
return this.Success("OK")
|
return nil
|
||||||
}
|
}
|
||||||
sessionId := sessionCookie.Value
|
|
||||||
|
|
||||||
user := this.findUser(request)
|
user := this.findUser(request)
|
||||||
if user != nil {
|
if user != nil {
|
||||||
@ -241,7 +247,7 @@ func (this *UserController) Logout(writer http.ResponseWriter, request *http.Req
|
|||||||
}
|
}
|
||||||
|
|
||||||
//delete session.
|
//delete session.
|
||||||
_, err = core.CONTEXT.GetSessionCache().Delete(sessionId)
|
_, err := core.CONTEXT.GetSessionCache().Delete(sessionId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.logger.Error("error while deleting session.")
|
this.logger.Error("error while deleting session.")
|
||||||
}
|
}
|
||||||
@ -327,6 +333,12 @@ func (this *UserController) ToggleStatus(writer http.ResponseWriter, request *ht
|
|||||||
|
|
||||||
currentUser = this.userDao.Save(currentUser)
|
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)
|
return this.Success(currentUser)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user