no message

This commit is contained in:
kuaifan 2025-05-26 23:04:00 +08:00
parent d73239b274
commit 2a25917e41
3 changed files with 29 additions and 27 deletions

View File

@ -1529,6 +1529,7 @@ class SystemController extends AbstractController
}
// 添加office资源
$officePath = '';
if (Apps::isInstalled('office')) {
$officeApi = 'http://office/web-apps/apps/api/documents/api.js';
$content = @file_get_contents($officeApi);
if ($content) {
@ -1536,6 +1537,7 @@ class SystemController extends AbstractController
$officePath = $matches[1];
}
}
}
if ($officePath) {
$array = array_map(function($item) use ($officePath) {
if (str_starts_with($item, 'office/{path}/')) {
@ -1549,6 +1551,7 @@ class SystemController extends AbstractController
});
}
// 添加OKR资源
if (Apps::isInstalled('okr')) {
$okrContent = @file_get_contents("http://nginx/apps/okr/");
preg_match_all('/<script[^>]*src=["\']([^"\']+)["\'][^>]*>/i', $okrContent, $scriptMatches);
foreach ($scriptMatches[1] as $src) {
@ -1559,6 +1562,7 @@ class SystemController extends AbstractController
$array[] = $href;
}
}
}
return array_map(function($item) use ($version) {
$url = trim($item);

View File

@ -942,8 +942,7 @@ class UsersController extends AbstractController
return UserCheckinMac::saveMac($userInfo->userid, $array);
case 'checkin_face':
$faceimg = $data['checkin_face'] ? $data['checkin_face'] : '';
$faceimg = $data['checkin_face'] ?: '';
return UserCheckinFace::saveFace($userInfo->userid, $userInfo->nickname, $faceimg, "管理员上传");
case 'department':

View File

@ -3,6 +3,7 @@
namespace App\Models;
use App\Exceptions\ApiException;
use App\Module\Apps;
use App\Module\Base;
use App\Module\Ihttp;
@ -39,6 +40,7 @@ class UserCheckinFace extends AbstractModel
public static function saveFace($userid, $nickname, $faceimg, $remark = '')
{
Apps::isInstalledThrow('face');
// 取上传图片的URL
$faceimg = Base::unFillUrl($faceimg);
$record = "";
@ -82,16 +84,14 @@ class UserCheckinFace extends AbstractModel
$checkinFace->save();
}
if ($faceimg == '') {
$res = UserCheckinFace::deleteDeviceUser($userid);
if ($res) {
return $res;
}
UserCheckinFace::deleteDeviceUser($userid);
}
return Base::retSuccess('设置成功');
});
}
public static function deleteDeviceUser($userid) {
private static function deleteDeviceUser($userid)
{
$url = "http://face:7788/user/delete";
$data = [
'enrollid' => $userid,
@ -102,7 +102,6 @@ class UserCheckinFace extends AbstractModel
if ($res['data'] && $data = json_decode($res['data'])) {
if ($data->ret != 1 && $data->msg) {
throw new ApiException($data->msg);
// return Base::retError($data->msg);
}
}
}