-
diff --git a/admin/application/api/controller/Firmemployee.php b/admin/application/api/controller/Worker.php
similarity index 91%
rename from admin/application/api/controller/Firmemployee.php
rename to admin/application/api/controller/Worker.php
index 61e3169..15f869a 100644
--- a/admin/application/api/controller/Firmemployee.php
+++ b/admin/application/api/controller/Worker.php
@@ -14,13 +14,12 @@ use think\Db;
use wanghua\general_utility_tools_php\Mmodel;
use wanghua\general_utility_tools_php\tool\Tools;
-class Firmemployee extends BaseApiAuthController
+class Worker extends BaseApiAuthController
{
/**
* desc:获取工作人员列表
*
- * /api/firmemployee/getList
* author:wh
*/
function getList(){
diff --git a/admin/application/api/controller/Wxgroup.php b/admin/application/api/controller/Wxgroup.php
new file mode 100644
index 0000000..2bee7ee
--- /dev/null
+++ b/admin/application/api/controller/Wxgroup.php
@@ -0,0 +1,39 @@
+where('rel_group',$chatroom_id)
+ ->value('rel_group');
+
+ return Tools::set_ok('ok',[
+ 'emergency_contact_wxid'=>$rel_group
+ ]);
+ });
+ }
+}
\ No newline at end of file
diff --git a/admin/application/common/model/BaseModel.php b/admin/application/common/model/BaseModel.php
new file mode 100644
index 0000000..7261c79
--- /dev/null
+++ b/admin/application/common/model/BaseModel.php
@@ -0,0 +1,31 @@
+assign('index_msg',cache('index_msg_alert_cache_time'));
+
+ //线上环境加载微信授权
+ if(config('sys_env') == 'PROD'){
+ $wx_user_info = session('wx_user_info');
+ if(empty($wx_user_info['openid'])) {
+ //重定向之前,保存当前url, 在获取授权信息之后,回跳到授权之前的网页地址
+ session('redirect_before_url_session',request()->url(true));
+ //没有则重定向去授权
+ return $this->redirect(url('Wexinauth/usrAuth','',301,true));
+ }
+
+ $this->saveWechatUser($wx_user_info);
+ }
+
+
+ //校验系统维护状态 start
+ $chm = $this->checkMaintain();
+ if($chm['is_maintain']){
+ if($chm['openid']){
+ //解析openid
+ if(!in_array(index_user_openid(), explode(',',$chm['openid']))){
+ //白名单之外维护中
+ //Tools::log_to_write_txt([
+ // '维护测试'=>$chm['openid'],
+ // 'my'=>index_user_openid()
+ //]);
+ return $this->error($chm['msg']);
+ }
+ }else{
+ //不存在,直接维护中
+ return $this->error($chm['msg'].'!');
+ }
+ }
+ //校验系统维护状态 end
+
+
+ }
+
+
+
+
+ /**
+ * desc:
+ * author:wh
+ * @param $wx_user_info
+ */
+ private function saveWechatUser($wx_user_info){
+ try {
+ $wechat_user = WechatUserModel::getWxUserByOpenid($wx_user_info['openid']);
+ if(empty($wechat_user)){
+ return WechatUserModel::insertInfo($wx_user_info);
+ }
+ //扩展,按周期更新,而不是不更新
+ if(empty($wechat_user['update_time']) || time()-strtotime($wechat_user['update_time'])>5*3600){
+
+ return WechatUserModel::updateUser($wx_user_info);
+ }
+
+
+ }catch (\Exception $e){
+ Tools::log_to_write_txt([
+ 'error'=>'存储异常.'.$e->getMessage(),
+ 'wx_user_info'=>$wx_user_info,
+ 'error_info'=>$e->getTraceAsString()
+ ],LogDir::WECHAT_USER_INFO_LOG);
+ }
+ }
+}
\ No newline at end of file
diff --git a/admin/application/index/controller/BaseCommonController.php b/admin/application/index/controller/BaseCommonController.php
new file mode 100644
index 0000000..e28c4a2
--- /dev/null
+++ b/admin/application/index/controller/BaseCommonController.php
@@ -0,0 +1,29 @@
+checkMaintain();
+ if($chm['is_maintain']){
+ if($chm['openid']){
+ //解析openid
+ if(!in_array(index_user_openid(), explode(',',$chm['openid']))){
+ //白名单之外维护中
+ //Tools::log_to_write_txt([
+ // '维护测试'=>$chm['openid'],
+ // 'my'=>index_user_openid()
+ //]);
+ return $this->error($chm['msg']);
+ }
+ }else{
+ //不存在,直接维护中
+ return $this->error($chm['msg'].'!');
+ }
+ }
+ //校验系统维护状态 end
+
+ }
+}
\ No newline at end of file
diff --git a/admin/application/index/controller/Test.php b/admin/application/index/controller/Test.php
new file mode 100644
index 0000000..4b43c2b
--- /dev/null
+++ b/admin/application/index/controller/Test.php
@@ -0,0 +1,137 @@
+addTemplate();
+ //die;
+ $res = $obj->send('18290416033',json_encode(['code'=>1223]));
+ dump($res);
+ die;
+
+ $api_cache_arr['aaa'][] = ['api_name'=>111,'doc_txt'=>222];
+ $api_cache_arr['bb'][] = ['api_name'=>777,'doc_txt'=>777];
+ $api_cache_arr['aaa'][] = ['api_name'=>666,'doc_txt'=>666];
+ $api_cache_arr['ccc'][] = ['api_name'=>111,'doc_txt'=>222];
+ $api_cache_arr['aaa'][] = ['api_name'=>555,'doc_txt'=>555];
+ $api_cache_arr['ccc'][] = ['api_name'=>333,'doc_txt'=>333];
+
+ dump($api_cache_arr);die;
+ // 使用示例
+ $color = $this->stringToColor("example string");
+ //echo $color; // 输出颜色码
+
+ die;
+ $color_code = substr(md5('asdfasdf'),0,6);
+ echo '
test
';die;
+
+// 使用示例
+ $color = $this->stringToColor("example string");
+ echo $color; // 输出颜色码
+ die;
+ // 配置您的讯飞应用信息
+ $appId = 'd482af59';
+ $apiKey = '0d20dab630904ad8676d9075375a1914';
+
+ // 创建事件循环
+ $loop = Factory::create();
+
+ // 创建TcpConnector,它实现了ConnectorInterface
+ $tcpConnector = new TcpConnector($loop);
+
+ // 使用TcpConnector创建SecureConnector
+ $secureConnector = new SecureConnector($tcpConnector, $loop);
+
+ // 实时语音转写API地址
+ //ws://8.130.29.83:2700
+ //$url = 'ws://8.130.29.83:2700';
+ $url = 'wss://rtasr.xfyun.cn/v1/ws';
+
+ // 计算签名
+ $ts = time();
+ $baseString = $appId . $ts;
+ $md5BaseString = md5($baseString);
+ $signa = base64_encode(hash_hmac('sha1', $md5BaseString, $apiKey, true));
+ dump($signa);
+
+ $params = [
+ 'appid' => $appId,
+ 'ts' => $ts,
+ 'signa' => $signa,
+ 'lang' => 'zh-cn', // 中文普通话
+ ];
+ dump($params);
+ $str = '';
+ $i = 0;
+ foreach ($params as $key => $value){
+ if($i==count($params)-1){
+ $str .= $key . '=' . $value ;
+ }else{
+
+ $str .= $key . '=' . $value . '&';
+ }
+ $i++;
+ }
+ $encodedParams = urlencode($str); // 对查询参数进行URL编码
+ // 构建WebSocket请求URL
+ $requestUrl = $url . '?' . $encodedParams;
+ dump($requestUrl);
+ // 使用SecureConnector连接到WebSocket服务器
+ $secureConnector->connect($requestUrl)->then(function (ConnectionInterface $conn) {
+ echo "Connected to the WebSocket server\n";
+ // ... 其他逻辑 ...
+ }, function ($error) {
+ // 连接失败处理
+ echo "Connection error: " . $error->getMessage() . "\n";
+ });
+
+ // 运行事件循环
+ $loop->run();
+ }
+ function callback($resource, $buffer, $length) {
+ global $audioQueue;
+ array_push($audioQueue, $buffer);
+ }
+ function testwss(){
+ return view();
+ }
+ function testwss2(){
+ return view();
+ }
+
+ function buildApiDoc()
+ {
+ parent::buildApiDoc();
+ }
+
+ public function buildTablesConf()
+ {
+ parent::buildTablesConf(); // TODO: Change the autogenerated stub
+ }
+ public function clearCache()
+ {
+ parent::clearCache(); // TODO: Change the autogenerated stub
+ }
+}
\ No newline at end of file
diff --git a/admin/public/api_docs/api_list.html b/admin/public/api_docs/api_list.html
new file mode 100644
index 0000000..0184635
--- /dev/null
+++ b/admin/public/api_docs/api_list.html
@@ -0,0 +1,41 @@
+
+
+
+
+
接口文档
+
+
+
+
+
+
文档说明:
+
1、如果没有明确说明,提交请求均使用post
+
2、此接口文档不包含websocket接口
+
3、接口参数之间使用“/”符号隔开
+
4、此文档接口测试功能只针对普通post、get接口,不能测试文件上传或文件流
+
5、功能模块按照颜色分组
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/public/api_docs/api_list.md b/admin/public/api_docs/api_list.md
new file mode 100644
index 0000000..fa43b7c
--- /dev/null
+++ b/admin/public/api_docs/api_list.md
@@ -0,0 +1,5 @@
+# API 文档
+## 接口列表
+###### (ctrl+f 搜索)(如果更改了路由,请根据路由规则定位)
+##### 请求域名:http://127.0.0.1:8080/
+##### 请求方式:POST(默认)
diff --git a/admin/public/assets/js/backend/aicustomerservice.js b/admin/public/assets/js/backend/aicustomerservice.js
new file mode 100644
index 0000000..24d567c
--- /dev/null
+++ b/admin/public/assets/js/backend/aicustomerservice.js
@@ -0,0 +1,51 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+ var Controller = {
+ index: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ index_url: 'aicustomerservice/index' + location.search,
+ add_url: 'aicustomerservice/add',
+ edit_url: 'aicustomerservice/edit',
+ del_url: 'aicustomerservice/del',
+ multi_url: 'aicustomerservice/multi',
+ import_url: 'aicustomerservice/import',
+ table: 'aicustomerservice',
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ add: function () {
+ Controller.api.bindevent();
+ },
+ edit: function () {
+ Controller.api.bindevent();
+ },
+ api: {
+ bindevent: function () {
+ Form.api.bindevent($("form[role=form]"));
+ }
+ }
+ };
+ return Controller;
+});
diff --git a/admin/public/assets/js/backend/firmcustomer.js b/admin/public/assets/js/backend/firmcustomer.js
index 8a83071..9f8e7fd 100644
--- a/admin/public/assets/js/backend/firmcustomer.js
+++ b/admin/public/assets/js/backend/firmcustomer.js
@@ -40,7 +40,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'status', title: __('Status'), searchList: {"yes":__('Status yes'),"no":__('Status no')}, formatter: Table.api.formatter.status},
{field: 'firmstoreprojectstwo.name', title: __('Firmstoreprojectstwo.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'firmcustomerorigin.name', title: __('Firmcustomerorigin.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- {field: 'firmemployee.name', title: __('Firmemployee.name'), operate: 'LIKE'},
+ {field: 'admin_id', title: __('责任人'), operate: 'LIKE'},
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
diff --git a/front/application/index/controller/BasePublicController.php b/front/application/index/controller/BasePublicController.php
index bdcae20..ca668fe 100644
--- a/front/application/index/controller/BasePublicController.php
+++ b/front/application/index/controller/BasePublicController.php
@@ -10,7 +10,6 @@ namespace app\index\controller;
use think\Request;
-use wanghua\general_utility_tools_php\framework\base\PublicController;
use wanghua\general_utility_tools_php\tool\Tools;
class BasePublicController extends BaseCommonController