Browse Source

Logout action to standalone file

Vova Tkach 6 years ago
parent
commit
f8d81933a9
2 changed files with 19 additions and 14 deletions
  1. 0 14
      modules/module_index.go
  2. 19 0
      modules/module_index_act_logout.go

+ 0 - 14
modules/module_index.go

@@ -430,20 +430,6 @@ func (this *Modules) RegisterAction_IndexDelete() *Action {
 	})
 	})
 }
 }
 
 
-func (this *Modules) RegisterAction_IndexUserLogout() *Action {
-	return this.newAction(AInfo{
-		WantDB:   true,
-		Mount:    "index-user-logout",
-		WantUser: true,
-	}, func(wrap *wrapper.Wrapper) {
-		// Reset session var
-		wrap.S.SetInt("UserId", 0)
-
-		// Reload current page
-		wrap.Write(`window.location.reload(false);`)
-	})
-}
-
 func (this *Modules) RegisterAction_IndexUserUpdateProfile() *Action {
 func (this *Modules) RegisterAction_IndexUserUpdateProfile() *Action {
 	return this.newAction(AInfo{
 	return this.newAction(AInfo{
 		WantDB:   true,
 		WantDB:   true,

+ 19 - 0
modules/module_index_act_logout.go

@@ -0,0 +1,19 @@
+package modules
+
+import (
+	"golang-fave/engine/wrapper"
+)
+
+func (this *Modules) RegisterAction_IndexUserLogout() *Action {
+	return this.newAction(AInfo{
+		WantDB:   true,
+		Mount:    "index-user-logout",
+		WantUser: true,
+	}, func(wrap *wrapper.Wrapper) {
+		// Reset session var
+		wrap.S.SetInt("UserId", 0)
+
+		// Reload current page
+		wrap.Write(`window.location.reload(false);`)
+	})
+}