mirror of
https://github.com/kongyuebin1/dongfeng-pay.git
synced 2024-11-23 02:39:26 +08:00
30 lines
571 B
Go
30 lines
571 B
Go
package controllers
|
|
|
|
import (
|
|
"github.com/beego/beego/v2/core/logs"
|
|
"github.com/beego/beego/v2/server/web"
|
|
)
|
|
|
|
type LogoutController struct {
|
|
web.Controller
|
|
}
|
|
|
|
func (c *LogoutController) Logout() {
|
|
if err := c.DelSession("username"); err != nil {
|
|
logs.Error("用户退出登录出错,错误信息:", err)
|
|
}
|
|
c.Redirect("/login.html", 302)
|
|
}
|
|
|
|
/**
|
|
** 切换用户登录
|
|
*/
|
|
func (c *LogoutController) SwitchLogin() {
|
|
err := c.DelSession("username")
|
|
if err != nil {
|
|
logs.Error("切换账号失败,错误信息:", err)
|
|
}
|
|
|
|
c.Redirect("/login.html", 302)
|
|
}
|