mirror of
https://github.com/kuaifan/dootask.git
synced 2026-04-04 19:50:09 +00:00
no message
This commit is contained in:
parent
d73239b274
commit
2a25917e41
@ -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);
|
||||
|
||||
@ -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':
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user