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

View File

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

View File

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