You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dongfeng-pay/legend/controllers/base/baseController.go

29 lines
604 B
Go

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package base
import (
"github.com/beego/beego/v2/core/logs"
"github.com/beego/beego/v2/server/web"
"legend/models/fast"
)
/**
** 基础controller插件重写一些公共的方法
*/
type BasicController struct {
web.Controller
}
func (c *BasicController) Prepare() {
userName, ok := c.GetSession("userName").(string)
if ok {
logs.Info("该用户已经登录, userName", userName)
userInfo := fast.GetMerchantInfoByUserName(userName)
if userInfo.LoginAccount != "" {
c.Data["nickName"] = userInfo.MerchantName
c.Data["merchantUid"] = userInfo.MerchantUid
}
} else {
}
}