修改微信图文

This commit is contained in:
Anyon 2019-12-20 14:11:52 +08:00
parent d484a8cccf
commit adf29036b6
2 changed files with 36 additions and 40 deletions

View File

@ -45,7 +45,7 @@ class Login extends Controller
$this->devmode = SystemService::instance()->checkRunMode('dev'); $this->devmode = SystemService::instance()->checkRunMode('dev');
$this->fetch(); $this->fetch();
} }
} } else {
$data = $this->_vali([ $data = $this->_vali([
'username.require' => '登录账号不能为空!', 'username.require' => '登录账号不能为空!',
'username.min:4' => '登录账号长度不能少于4位有效字符', 'username.min:4' => '登录账号长度不能少于4位有效字符',
@ -78,6 +78,7 @@ class Login extends Controller
sysoplog('用户登录', "用户登录系统后台成功"); sysoplog('用户登录', "用户登录系统后台成功");
$this->success('登录成功', url('@admin')->build()); $this->success('登录成功', url('@admin')->build());
} }
}
/** /**
* 生成验证码 * 生成验证码

View File

@ -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 () {