mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-09 19:42:47 +08:00
优化用户模型;提供更多js操作;
This commit is contained in:
@@ -16,9 +16,10 @@ class User extends Model
|
|||||||
|
|
||||||
protected $defaultSoftDelete = 0;
|
protected $defaultSoftDelete = 0;
|
||||||
|
|
||||||
public function getAvatarAttr($value)
|
public function getAvatarSrcAttr()
|
||||||
{
|
{
|
||||||
if(empty($value)){
|
$value = $this->getAttr('avatar');
|
||||||
|
if (empty($value)) {
|
||||||
return '/static/images/avatar.png';
|
return '/static/images/avatar.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -154,8 +154,27 @@ function isPC() {
|
|||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
top.onbeforeunload = function (e) {
|
$.upost = function (url, data, callback) {
|
||||||
setTimeout(() => {
|
|
||||||
loading.show()
|
if (typeof data == 'function') {
|
||||||
}, 2000);
|
callback = data;
|
||||||
}
|
data = {};
|
||||||
|
}
|
||||||
|
loading.show();
|
||||||
|
$.post(url, data, function (result) {
|
||||||
|
|
||||||
|
if (result.code == 500) {
|
||||||
|
|
||||||
|
loading.hide();
|
||||||
|
|
||||||
|
layer.msg(result.msg)
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
callback(result)
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user