|
@@ -17,6 +17,7 @@ namespace app\workerapi\controller;
|
|
|
use app\common\enum\notice\NoticeEnum;
|
|
use app\common\enum\notice\NoticeEnum;
|
|
|
use app\common\model\master_worker\MasterWorker;
|
|
use app\common\model\master_worker\MasterWorker;
|
|
|
use app\common\model\notice\NoticeSetting;
|
|
use app\common\model\notice\NoticeSetting;
|
|
|
|
|
+use app\common\service\wechat\WeChatOaService;
|
|
|
use app\workerapi\logic\LoginLogic;
|
|
use app\workerapi\logic\LoginLogic;
|
|
|
use app\workerapi\validate\LoginAccountValidate;
|
|
use app\workerapi\validate\LoginAccountValidate;
|
|
|
use app\workerapi\validate\RegisterValidate;
|
|
use app\workerapi\validate\RegisterValidate;
|
|
@@ -30,7 +31,7 @@ use app\workerapi\validate\RegisterValidate;
|
|
|
class LoginController extends BaseApiController
|
|
class LoginController extends BaseApiController
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
- public array $notNeedLogin = ['register', 'account', 'logout'];
|
|
|
|
|
|
|
+ public array $notNeedLogin = ['register', 'account', 'logout','testWeChat'];
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -104,5 +105,26 @@ class LoginController extends BaseApiController
|
|
|
LoginLogic::logout($this->userInfo);
|
|
LoginLogic::logout($this->userInfo);
|
|
|
return $this->success();
|
|
return $this->success();
|
|
|
}
|
|
}
|
|
|
|
|
+ public function testWeChat()
|
|
|
|
|
+ {
|
|
|
|
|
+ // 发送通知给平台配置的审核人
|
|
|
|
|
+ $noticeSetting = NoticeSetting::where('scene_id', NoticeEnum::WORKER_EXAMINE)->findOrEmpty()->toArray();
|
|
|
|
|
+ if($noticeSetting['oa_notice']['designated_user']??0 && $noticeSetting['oa_notice']['designated_user']){
|
|
|
|
|
|
|
|
|
|
+ (new WeChatOaService())->sendTemplateMessage([
|
|
|
|
|
+ 'scene_id' => NoticeEnum::WORKER_EXAMINE,
|
|
|
|
|
+ 'params' => [
|
|
|
|
|
+ 'user_id' => 0,
|
|
|
|
|
+ 'openid' => $noticeSetting['oa_notice']['designated_user'],
|
|
|
|
|
+ ]
|
|
|
|
|
+ ]);
|
|
|
|
|
+ /*event('Notice', [
|
|
|
|
|
+ 'scene_id' => NoticeEnum::WORKER_EXAMINE,
|
|
|
|
|
+ 'params' => [
|
|
|
|
|
+ 'user_id' => 0,
|
|
|
|
|
+ 'openid' => $noticeSetting['oa_notice']['designated_user'],
|
|
|
|
|
+ ]
|
|
|
|
|
+ ]);*/
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|