mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改微信图文
This commit is contained in:
parent
d484a8cccf
commit
adf29036b6
@ -45,38 +45,39 @@ class Login extends Controller
|
|||||||
$this->devmode = SystemService::instance()->checkRunMode('dev');
|
$this->devmode = SystemService::instance()->checkRunMode('dev');
|
||||||
$this->fetch();
|
$this->fetch();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$data = $this->_vali([
|
||||||
|
'username.require' => '登录账号不能为空!',
|
||||||
|
'username.min:4' => '登录账号长度不能少于4位有效字符!',
|
||||||
|
'password.require' => '登录密码不能为空!',
|
||||||
|
'password.min:4' => '登录密码长度不能少于4位有效字符!',
|
||||||
|
'verify.require' => '图形验证码不能为空!',
|
||||||
|
'uniqid.require' => '图形验证标识不能为空!'
|
||||||
|
]);
|
||||||
|
if (!CaptchaService::instance()->check($data['verify'], $data['uniqid'])) {
|
||||||
|
$this->error('图形验证码验证失败,请重新输入!');
|
||||||
|
}
|
||||||
|
// 用户信息验证
|
||||||
|
$map = ['username' => $data['username'], 'is_deleted' => '0'];
|
||||||
|
$user = $this->app->db->name('SystemUser')->where($map)->order('id desc')->find();
|
||||||
|
if (empty($user)) {
|
||||||
|
$this->error('登录账号或密码错误,请重新输入!');
|
||||||
|
}
|
||||||
|
if (md5("{$user['password']}{$data['uniqid']}") !== $data['password']) {
|
||||||
|
$this->error('登录账号或密码错误,请重新输入!');
|
||||||
|
}
|
||||||
|
if (empty($user['status'])) {
|
||||||
|
$this->error('账号已经被禁用,请联系管理员!');
|
||||||
|
}
|
||||||
|
$this->app->db->name('SystemUser')->where(['id' => $user['id']])->update([
|
||||||
|
'login_ip' => $this->app->request->ip(),
|
||||||
|
'login_at' => $this->app->db->raw('now()'),
|
||||||
|
'login_num' => $this->app->db->raw('login_num+1'),
|
||||||
|
]);
|
||||||
|
$this->app->session->set('user', $user);
|
||||||
|
sysoplog('用户登录', "用户登录系统后台成功");
|
||||||
|
$this->success('登录成功', url('@admin')->build());
|
||||||
}
|
}
|
||||||
$data = $this->_vali([
|
|
||||||
'username.require' => '登录账号不能为空!',
|
|
||||||
'username.min:4' => '登录账号长度不能少于4位有效字符!',
|
|
||||||
'password.require' => '登录密码不能为空!',
|
|
||||||
'password.min:4' => '登录密码长度不能少于4位有效字符!',
|
|
||||||
'verify.require' => '图形验证码不能为空!',
|
|
||||||
'uniqid.require' => '图形验证标识不能为空!'
|
|
||||||
]);
|
|
||||||
if (!CaptchaService::instance()->check($data['verify'], $data['uniqid'])) {
|
|
||||||
$this->error('图形验证码验证失败,请重新输入!');
|
|
||||||
}
|
|
||||||
// 用户信息验证
|
|
||||||
$map = ['username' => $data['username'], 'is_deleted' => '0'];
|
|
||||||
$user = $this->app->db->name('SystemUser')->where($map)->order('id desc')->find();
|
|
||||||
if (empty($user)) {
|
|
||||||
$this->error('登录账号或密码错误,请重新输入!');
|
|
||||||
}
|
|
||||||
if (md5("{$user['password']}{$data['uniqid']}") !== $data['password']) {
|
|
||||||
$this->error('登录账号或密码错误,请重新输入!');
|
|
||||||
}
|
|
||||||
if (empty($user['status'])) {
|
|
||||||
$this->error('账号已经被禁用,请联系管理员!');
|
|
||||||
}
|
|
||||||
$this->app->db->name('SystemUser')->where(['id' => $user['id']])->update([
|
|
||||||
'login_ip' => $this->app->request->ip(),
|
|
||||||
'login_at' => $this->app->db->raw('now()'),
|
|
||||||
'login_num' => $this->app->db->raw('login_num+1'),
|
|
||||||
]);
|
|
||||||
$this->app->session->set('user', $user);
|
|
||||||
sysoplog('用户登录', "用户登录系统后台成功");
|
|
||||||
$this->success('登录成功', url('@admin')->build());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -99,7 +99,8 @@
|
|||||||
|
|
||||||
function apply(list) {
|
function apply(list) {
|
||||||
if (list.length < 1) list.push({
|
if (list.length < 1) list.push({
|
||||||
title: '新建图文', author: '管理员', content: '文章内容', read_num: 0, local_url: '__ROOT__/static/theme/img/image.png',
|
title: '新建图文', author: '管理员', content: '文章内容',
|
||||||
|
read_num: 0, local_url: '__ROOT__/static/theme/img/image.png',
|
||||||
});
|
});
|
||||||
for (var i in list) {
|
for (var i in list) {
|
||||||
list[i].active = false;
|
list[i].active = false;
|
||||||
@ -110,10 +111,11 @@
|
|||||||
$rootScope.setItemValue('active', true);
|
$rootScope.setItemValue('active', true);
|
||||||
$('.layui-card-body.layui-hide').removeClass('layui-hide');
|
$('.layui-card-body.layui-hide').removeClass('layui-hide');
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
if (editor) editor.destroy();
|
||||||
editor = window.createEditor('[name="content"]');
|
editor = window.createEditor('[name="content"]');
|
||||||
editor.setData($rootScope.item.content);
|
editor.setData($rootScope.item.content);
|
||||||
$vali.checkAllInput();
|
$vali.checkAllInput();
|
||||||
}, 200);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
$rootScope.upItem = function (index, $event) {
|
$rootScope.upItem = function (index, $event) {
|
||||||
@ -126,7 +128,6 @@
|
|||||||
}
|
}
|
||||||
apply(tmp);
|
apply(tmp);
|
||||||
};
|
};
|
||||||
|
|
||||||
$rootScope.dnItem = function (index, $event) {
|
$rootScope.dnItem = function (index, $event) {
|
||||||
$event.stopPropagation();
|
$event.stopPropagation();
|
||||||
var tmp = [], cur = $rootScope.list[index];
|
var tmp = [], cur = $rootScope.list[index];
|
||||||
@ -137,14 +138,12 @@
|
|||||||
}
|
}
|
||||||
apply(tmp);
|
apply(tmp);
|
||||||
};
|
};
|
||||||
|
|
||||||
$rootScope.delItem = function (index, $event) {
|
$rootScope.delItem = function (index, $event) {
|
||||||
$event.stopPropagation();
|
$event.stopPropagation();
|
||||||
var list = $rootScope.list, temp = [];
|
var list = $rootScope.list, temp = [];
|
||||||
for (var i in list) (parseInt(i) !== parseInt(index)) && temp.push(list[i]);
|
for (var i in list) (parseInt(i) !== parseInt(index)) && temp.push(list[i]);
|
||||||
apply(temp);
|
apply(temp);
|
||||||
};
|
};
|
||||||
|
|
||||||
$rootScope.setItem = function (index, $event) {
|
$rootScope.setItem = function (index, $event) {
|
||||||
$event.stopPropagation();
|
$event.stopPropagation();
|
||||||
$vali.checkAllInput();
|
$vali.checkAllInput();
|
||||||
@ -161,12 +160,10 @@
|
|||||||
$rootScope.setItemValue('active', true);
|
$rootScope.setItemValue('active', true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$rootScope.setItemValue = function (name, value) {
|
$rootScope.setItemValue = function (name, value) {
|
||||||
$rootScope.item[name] = value;
|
$rootScope.item[name] = value;
|
||||||
$rootScope.item.style = "background-image:url('" + $rootScope.item.local_url + "')";
|
$rootScope.item.style = "background-image:url('" + $rootScope.item.local_url + "')";
|
||||||
};
|
};
|
||||||
|
|
||||||
$rootScope.addItem = function () {
|
$rootScope.addItem = function () {
|
||||||
if ($rootScope.list.length > 7) {
|
if ($rootScope.list.length > 7) {
|
||||||
return $.msg.tips('最多允许增加7篇文章哦!');
|
return $.msg.tips('最多允许增加7篇文章哦!');
|
||||||
@ -180,7 +177,6 @@
|
|||||||
style: "background-image:url('__ROOT__/static/theme/img/image.png')"
|
style: "background-image:url('__ROOT__/static/theme/img/image.png')"
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$rootScope.submit = function () {
|
$rootScope.submit = function () {
|
||||||
$vali.checkAllInput();
|
$vali.checkAllInput();
|
||||||
if ($form.find('.validate-error').size() > 0) {
|
if ($form.find('.validate-error').size() > 0) {
|
||||||
@ -201,7 +197,6 @@
|
|||||||
});
|
});
|
||||||
$.form.load('{:request()->url()}', {data: data}, "post");
|
$.form.load('{:request()->url()}', {data: data}, "post");
|
||||||
};
|
};
|
||||||
|
|
||||||
$('[name="local_url"]').on('change', function (value) {
|
$('[name="local_url"]').on('change', function (value) {
|
||||||
value = this.value;
|
value = this.value;
|
||||||
$rootScope.$apply(function () {
|
$rootScope.$apply(function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user