修改自动生成头像在php严格模式下的bug
This commit is contained in:
parent
356d0df745
commit
c3f8bbc9c9
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
declare (strict_types = 1);
|
||||||
namespace app\admin\model;
|
namespace app\admin\model;
|
||||||
|
|
||||||
use think\Model;
|
use think\Model;
|
||||||
@ -47,7 +48,7 @@ class AdminLog extends Model
|
|||||||
'Article/post_submit' => '文章',
|
'Article/post_submit' => '文章',
|
||||||
'Article/delete' => '文章',
|
'Article/delete' => '文章',
|
||||||
'Api/upload' => '附件',
|
'Api/upload' => '附件',
|
||||||
'Login/login_submit'=>'系统'
|
'Login/login_submit' => '系统',
|
||||||
];
|
];
|
||||||
if (!empty($type_array[$type])) {
|
if (!empty($type_array[$type])) {
|
||||||
return $type_array[$type];
|
return $type_array[$type];
|
||||||
@ -65,8 +66,7 @@ class AdminLog extends Model
|
|||||||
if (!empty($controller_array[$controller])) {
|
if (!empty($controller_array[$controller])) {
|
||||||
if ($fun == 'cate_post_submit') {
|
if ($fun == 'cate_post_submit') {
|
||||||
return '文章分类';
|
return '文章分类';
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return $controller_array[$controller];
|
return $controller_array[$controller];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -129,7 +129,7 @@ class Login
|
|||||||
$param['headimgurl'] = $this->to_avatars($char);
|
$param['headimgurl'] = $this->to_avatars($char);
|
||||||
$uid = Db::name('User')->strict(false)->field(true)->insertGetId($param);
|
$uid = Db::name('User')->strict(false)->field(true)->insertGetId($param);
|
||||||
add_user_log('reg', $uid, $param);
|
add_user_log('reg', $uid, $param);
|
||||||
return to_assign(1, '注册成功', $uid);
|
return to_assign(1, '注册成功,请登录', $uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@
|
|||||||
if (res.code === 1) {
|
if (res.code === 1) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
window.location.href="{:url('/home/login/index')}";
|
window.location.href="{:url('/home/login/index')}";
|
||||||
}, 1500);
|
}, 2000);
|
||||||
} else {
|
} else {
|
||||||
$('[alt="captcha"]').click();
|
$('[alt="captcha"]').click();
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
* Material-Design-Avatars
|
||||||
|
* https://github.com/lincanbin/Material-Design-Avatars
|
||||||
|
*
|
||||||
|
* Copyright 2015 Canbin Lin (lincanbin@hotmail.com)
|
||||||
|
* http://www.94cb.com/
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0:
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Create material deisgn avatars for users just like Gmail or Messager in Android.
|
||||||
|
*/
|
||||||
|
declare (strict_types = 1);
|
||||||
namespace avatars;
|
namespace avatars;
|
||||||
|
|
||||||
class MDAvatars
|
class MDAvatars
|
||||||
@ -339,15 +351,7 @@ class MDAvatars
|
|||||||
$Y = $Height - $Padding - (13 / 196) * $FontSize;
|
$Y = $Height - $Padding - (13 / 196) * $FontSize;
|
||||||
}
|
}
|
||||||
// 在圆正中央填入字符
|
// 在圆正中央填入字符
|
||||||
imagettftext($this->Avatar,
|
imagettftext($this->Avatar, $FontSize,0,intval($X), intval($Y),$FontColor,$this->FontFile, $this->Char);
|
||||||
$FontSize,
|
|
||||||
0,
|
|
||||||
$X,
|
|
||||||
$Y,
|
|
||||||
$FontColor,
|
|
||||||
$this->FontFile,
|
|
||||||
$this->Char
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function Resize($TargetSize)
|
private function Resize($TargetSize)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user