fixed
This commit is contained in:
34
front/application/api/controller/BaseWssApi.php
Normal file
34
front/application/api/controller/BaseWssApi.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/*
|
||||
* description:
|
||||
* author:wh
|
||||
* email:
|
||||
* createTime:{2024/4/5} {19:55}
|
||||
*/
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
|
||||
class BaseWssApi extends BaseCommonController
|
||||
{
|
||||
|
||||
/**
|
||||
* desc:socket专用json格式
|
||||
*
|
||||
* author:wh
|
||||
* @param $action
|
||||
* @param string $msg
|
||||
* @param array $items
|
||||
* @param string $method
|
||||
* @return false|string
|
||||
*/
|
||||
static function json_wss($action,$msg='', $items=[], $method='response'){
|
||||
$json = [
|
||||
'action'=>$action,
|
||||
'method'=>$method,
|
||||
'msg'=>$msg,
|
||||
'items'=>$items
|
||||
];
|
||||
return json_encode($json, JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user