支持k8s登录&优化任务列表页操作
This commit is contained in:
@@ -67,7 +67,8 @@ func (self *BaseController) Auth() {
|
|||||||
if userId > 0 {
|
if userId > 0 {
|
||||||
user, err := models.AdminGetById(userId)
|
user, err := models.AdminGetById(userId)
|
||||||
|
|
||||||
if err == nil && password == libs.Md5([]byte(self.getClientIp()+"|"+user.Password+user.Salt)) {
|
//if err == nil && password == libs.Md5([]byte(self.getClientIp()+"|"+user.Password+user.Salt)) {
|
||||||
|
if err == nil && password == libs.Md5([]byte(user.Password+user.Salt)){
|
||||||
self.userId = user.Id
|
self.userId = user.Id
|
||||||
self.loginName = user.LoginName
|
self.loginName = user.LoginName
|
||||||
self.userName = user.RealName
|
self.userName = user.RealName
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ func (self *LoginController) LoginIn() {
|
|||||||
user.LastIp = self.getClientIp()
|
user.LastIp = self.getClientIp()
|
||||||
user.LastLogin = time.Now().Unix()
|
user.LastLogin = time.Now().Unix()
|
||||||
user.Update()
|
user.Update()
|
||||||
authkey := libs.Md5([]byte(self.getClientIp() + "|" + user.Password + user.Salt))
|
authkey := libs.Md5([]byte(user.Password + user.Salt))
|
||||||
self.Ctx.SetCookie("auth", strconv.Itoa(user.Id)+"|"+authkey, 7*86400)
|
self.Ctx.SetCookie("auth", strconv.Itoa(user.Id)+"|"+authkey, 7*86400)
|
||||||
|
|
||||||
self.ajaxMsg("登录成功", MSG_OK)
|
self.ajaxMsg("登录成功", MSG_OK)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<button class="layui-btn" data-type="reload" id="reload"><i class="fa fa-search"></i>查询</button>
|
<button class="layui-btn" data-type="reload" id="search"><i class="fa fa-search"></i>查询</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
$.post('/task/ajax'+action, {"ids":ids}, function (out) {
|
$.post('/task/ajax'+action, {"ids":ids}, function (out) {
|
||||||
if (out.status == 0) {
|
if (out.status == 0) {
|
||||||
layer.msg("操作成功",{icon: 1,shade:0.3,time:1000},function () {
|
layer.msg("操作成功",{icon: 1,shade:0.3,time:1000},function () {
|
||||||
$('#reload').click();
|
$('#search').click();
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
layer.msg(out.message)
|
layer.msg(out.message)
|
||||||
|
|||||||
Reference in New Issue
Block a user