当前位置: 首页 > news >正文

昆明网站设计都需要设计什么WordPress外链转内链插件

昆明网站设计都需要设计什么,WordPress外链转内链插件,广州微网站,满vip手游的平台前言 最近在做项目中#xff0c;要求在后台管理中有企业微信管理的相关功能。相关准备工作#xff0c;需要准备好企业微信账号#xff0c;添加自建应用#xff0c;获得相应功能的权限#xff0c;以及agentid、secre等。 参考文档#xff1a; 企业微信开发文档 功能实现 因…前言 最近在做项目中要求在后台管理中有企业微信管理的相关功能。相关准备工作需要准备好企业微信账号添加自建应用获得相应功能的权限以及agentid、secre等。 参考文档 企业微信开发文档 功能实现 因功能接口比较多这里以“客户敏感词”为例以下为“敏感词”管理功能实现。 1 想法思路 企业微信接口有请求次数限制后台操作频繁避免多次请求企业微信接口也为了相应速度考虑我这里考虑将输入进行入库处理。每次新建敏感词企业微信“新增敏感词”接口请求成功后将数据添加到数据库编辑和删除同理。这样敏感词列表、查看敏感词就可以减少对企业微信接口的请求。 2 注意事项 1敏感词这里需要依赖通讯录中的成员和部门因此需要先开发这两个模块之后再进行敏感词功能开发成员和部门也做了入库处理所以在下面代码中我也是直接查询数据库的内容 2access_token 有三种通讯录access_token、联系人access_token以及自建应用 access_token要根据接口需要看需要哪一种access_token否则就会报错。敏感词这里使用的是自建应用 access_token。 3要记得添加IP白名单。 3 代码实现 InterceptController.php ?php // -----------------------xiaozhe-----------------------------------------------namespace app\wework\controller;use cmf\controller\AdminBaseController; use app\wework\service\InterceptService; use app\wework\service\WechatInterceptApi; use app\wework\model\InterceptModel; use app\wework\model\WeUserModel; use app\admin\model\AdminMenuModel;class InterceptController extends AdminBaseController {// 敏感词列表public function index(){ // 接口请求敏感词列表// $wxinterceptApi new WechatInterceptApi();// $list $wxinterceptApi-getInterceptRuleList();// echo pre;// print_r($list);// exit;$param $this-request-param();$interceptService new InterceptService();$data $interceptService-getList($param);$data-appends($param);$this-assign(keyword, isset($param[keyword]) ? $param[keyword] : );$this-assign(lists, $data-items());$this-assign(page, $data-render());return $this-fetch();}// 新增敏感词public function add(){if ($this-request-isPost()) {$data $this-request-param();$interceptModel new InterceptModel();$data[create_time] time();$data[user_id] cmf_get_current_admin_id();$data[group_id] 0;if ($data[applicable_type] 2) {// 选择员工的话是员工名$userModel new WeUserModel();$userList $userModel-whereIn(userid,$data[applicable_range])-column(userid,department_id);$group_arr array_unique(array_keys($userList));$applicable_range[user_list] implode(,,$userList);$applicable_range[department_list] implode(,,$group_arr);$data[applicable_range] json_encode($applicable_range,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);} else {$userModel new WeUserModel();$userList $userModel-whereIn(department_id,$data[applicable_range])-column(userid);$applicable_range[user_list] implode(,,$userList);$applicable_range[department_list] $data[applicable_range];$data[applicable_range] json_encode($applicable_range,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);}if (!empty($data[semantics_list])) {$data[semantics_list] implode(,,$data[semantics_list]);}// 敏感词接口新增$user_list !empty($applicable_range[user_list]) ? explode(,,$applicable_range[user_list]) : [];$department_list explode(,,$applicable_range[department_list]);$wx_intercept array(rule_name $data[rule_name],word_list explode(,,$data[word_list]),semantics_list explode(,,$data[semantics_list]),intercept_type $data[intercept_type],applicable_range array(user_list $user_list,department_list $department_list));$wxinterceptApi new WechatInterceptApi();$res $wxinterceptApi-addInterceptRule($wx_intercept);if ($res[errcode] ! 0) {$this-error($res[errmsg], url(Intercept/index));}$data[rule_id] $res[rule_id];$result $interceptModel-save($data);if ($result) {$this-success(添加成功, url(Intercept/index));} else {$this-error(添加失败, url(Intercept/index));}}return $this-fetch();}// 编辑敏感词public function edit(){if ($this-request-isPost()) {$data $this-request-param();$id $data[id] ?? 0;unset($data[id]);if ($data[applicable_type] 2) {// 选择员工的话是员工名$userModel new WeUserModel();$userList $userModel-whereIn(userid,$data[applicable_range])-column(userid,department_id);$group_arr array_unique(array_keys($userList));$applicable_range[user_list] implode(,,$userList);$applicable_range[department_list] implode(,,$group_arr);$data[applicable_range] json_encode($applicable_range,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);} else {$userModel new WeUserModel();$userList $userModel-whereIn(department_id,$data[applicable_range])-column(userid);$applicable_range[user_list] implode(,,$userList);$applicable_range[department_list] $data[applicable_range];$data[applicable_range] json_encode($applicable_range,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);}$update_info $data;$interceptModel new InterceptModel();// 敏感词接口编辑// 查询原来的数据$rule_info $interceptModel-field(rule_id,applicable_range)-where(id,$id)-find();$old_add_applicable_range json_decode($rule_info[applicable_range],true);$old_user_list !empty($old_add_applicable_range[user_list]) ? explode(,,$old_add_applicable_range[user_list]) : [];$old_department_list !empty($old_add_applicable_range[department_list]) ? explode(,,$old_add_applicable_range[department_list]) : [];$user_list !empty($applicable_range[user_list]) ? explode(,,$applicable_range[user_list]) : [];$department_list explode(,,$applicable_range[department_list]);$wx_intercept array(rule_id $rule_info[rule_id],rule_name $update_info[rule_name],word_list explode(,,$update_info[word_list]),extra_rule array(semantics_list $data[semantics_list],),intercept_type $data[intercept_type],add_applicable_range array(user_list $user_list,department_list $department_list),remove_applicable_range array(user_list $old_user_list,department_list $old_department_list));$wxinterceptApi new WechatInterceptApi();$res $wxinterceptApi-updateInterceptRule($wx_intercept);if ($res[errcode] ! 0) {$this-error($res[errmsg], url(Intercept/index));}if (!empty($update_info[semantics_list])) {$update_info[semantics_list] implode(,,$update_info[semantics_list]);}$result $interceptModel-where(id,$id)-update($update_info);if ($result) {$this-success(编辑成功, url(Intercept/index));} else {$this-error(编辑失败, url(Intercept/index));}}$id $this-request-param(id, 0, intval);if (empty($id)) {$this-error(请求参数有误);}// 查询敏感词信息$interceptService new InterceptService();$info $interceptService-getInfo($id);// 接口请求敏感词详情// $wxinterceptApi new WechatInterceptApi();// $list $wxinterceptApi-getInterceptRuleInfo([rule_id$info[rule_id]]);// echo pre;// print_r($list);// exit;$this-assign(info,$info);return $this-fetch();}// 删除敏感词public function delete(){$param $this-request-param();$interceptModel new InterceptModel();if (isset($param[id])) {$id $this-request-param(id, 0, intval);$rule_info $interceptModel-field(rule_id)-where(id,$id)-find();$wxinterceptApi new WechatInterceptApi();$wx_res $wxinterceptApi-deleteInterceptRule([rule_id$rule_info[rule_id]]);if ($wx_res[errcode] 0) {$result $interceptModel-where(id, $id)-delete();$this-success(删除成功);} else {$this-error(删除失败);}}}public function checkWorker(){$param $this-request-param();$applicable_type $param[type] ?? 1;$applicable_range $param[value] ?? ;$interceptService new InterceptService();$result $interceptService-getWorkerList($param);$this-assign(menus, $result);$this-assign(applicable_range, explode(,,$applicable_range));$this-assign(applicable_type,$applicable_type);return $this-fetch();}}InterceptService.php ?php // ---------------------------------------------------------------------- // xiaozhe // ---------------------------------------------------------------------- namespace app\wework\service;use app\wework\model\InterceptModel; use app\wework\model\DepartModel; use app\wework\model\WeUserModel; use think\db\Query;class InterceptService {public function getList($filter){$field a.id,a.rule_name,a.word_list,a.intercept_type,a.applicable_type,a.user_id,a.create_time,a.update_time,u.user_nickname;$interceptModel new InterceptModel();$result $interceptModel-alias(a)-leftJoin(user u,a.user_id u.id)-field($field)-where(function (Query $query) use ($filter) {$keyword empty($filter[keyword]) ? : $filter[keyword];if (!empty($keyword)) {$query-where(a.title, like, %$keyword%);}})-paginate(15);return $result;}public function getInfo($id){$interceptModel new InterceptModel();$info $interceptModel-where(id,$id)-find();if (!empty($info[semantics_list])) {$info[semantics_list] explode(,,$info[semantics_list]);}if (!empty($info[applicable_range])) {$info[applicable_range] json_decode($info[applicable_range],true);$info[user_count] count(explode(,,$info[applicable_range][user_list]));$info[depart_count] count(explode(,,$info[applicable_range][department_list]));if ($info[applicable_type] 1) {// 部门$info[applicable_range_value] $info[applicable_range][department_list];} else {// 员工$userModel new WeUserModel();$userIds $userModel-whereIn(userid,$info[applicable_range][user_list])-whereIn(department_id,$info[applicable_range][department_list])-column(userid);$info[applicable_range_value] implode(,,$userIds);}}return $info;}public function getWorkerList($filter){$type $filter[type];switch ($type) {case 1:// 部门$departmentModel new DepartModel();$newList $departmentModel-field(department_id as id,name,parentid as parent_id)-select()-toArray();break;case 2:// 员工$userModel new WeUserModel();$newList $userModel-field(userid as id,name)-select()-toArray();break;default:// code...break;}return $newList;}}WechatInterceptApi.php  ?php // ---------------------------------------------------------------------- // | xiaozhe // ---------------------------------------------------------------------- namespace app\wework\service; use app\wework\model\ConfigModel; use think\Db; /** * 企业微信接口 **/ class WechatInterceptApi {/*** 获取通讯录access_token**/public function getStaffAccessToken(){$cache_key staff_access_token;$res cache($cache_key);if(empty($res)){// 读取配置$WeworkConfigModel new ConfigModel();$info $WeworkConfigModel-where(id,1)-find();$response cmf_curl_get(https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid{$info[corpid]}corpsecret{$info[user_secret]});$arr json_decode($response, true); if($arr[errcode] ! 0){return ;}cache($cache_key, $arr[access_token], 6900);}return $res;}/*** 获取客户联系人access_token**/static public function getCustomerAccessToken(){$cache_key customer_access_token;$res cache($cache_key);if(empty($res)){$WeworkConfigModel new ConfigModel();$info $WeworkConfigModel-where(id,1)-find();$response cmf_curl_get(https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid{$info[corpid]}corpsecret{$info[customer_secret]});$arr json_decode($response, true); if($arr[errcode] ! 0){return ;}cache($cache_key, $arr[access_token], 6900);}return $res;}/*** 获取自建应用 access_token**/public function getSelfappAccessToken(){$cache_key selfapp_access_token;$res cache($cache_key);if(empty($res)){$WeworkConfigModel new ConfigModel();$info $WeworkConfigModel-where(id,1)-find();$response cmf_curl_get(https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid{$info[corpid]}corpsecret{$info[corpsecret]});$arr json_decode($response, true); if($arr[errcode] ! 0){return ;}cache($cache_key, $arr[access_token], 6900);}return $res;}// 获取敏感词列表public function getInterceptRuleList(){$token self::getSelfappAccessToken();$res cmf_curl_get(https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_intercept_rule_list?access_token.$token,array());$resp_arr json_decode($res, 1);return $resp_arr;}// 新增敏感词public function addInterceptRule($filter){$token self::getSelfappAccessToken();$res self::curl_post(https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_intercept_rule?access_token.$token,json_encode($filter));$resp_arr json_decode($res, 1);return $resp_arr;}// 获取敏感词详情public function getInterceptRuleInfo($filter){$token self::getSelfappAccessToken();$res self::curl_post(https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_intercept_rule?access_token.$token,json_encode($filter));$resp_arr json_decode($res, 1);return $resp_arr;}// 修改敏感词规则public function updateInterceptRule($filter){$token self::getSelfappAccessToken();$res self::curl_post(https://qyapi.weixin.qq.com/cgi-bin/externalcontact/update_intercept_rule?access_token.$token,json_encode($filter));$resp_arr json_decode($res, 1);return $resp_arr;}// 删除敏感词public function deleteInterceptRule($filter){$token self::getSelfappAccessToken();$res self::curl_post(https://qyapi.weixin.qq.com/cgi-bin/externalcontact/del_intercept_rule?access_token.$token,json_encode($filter));$resp_arr json_decode($res, 1);return $resp_arr;}public function curl_post($url,$data){$curl curl_init(); // 启动一个CURL会话curl_setopt($curl, CURLOPT_URL, $url); // 要访问的地址curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检查curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); // 从证书中检查SSL加密算法是否存在curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转curl_setopt($curl, CURLOPT_AUTOREFERER, 1); // 自动设置Referercurl_setopt($curl, CURLOPT_POST, 1); // 发送一个常规的Post请求curl_setopt($curl, CURLOPT_POSTFIELDS,$data); // Post提交的数据包curl_setopt($curl, CURLOPT_TIMEOUT, 30); // 设置超时限制防止死循环curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回$result curl_exec($curl); // 执行操作return $result;} } 前端代码我就不放了哈自行写一哈  实现效果 敏感词列表 新增敏感词 编辑敏感词
文章转载自:
http://www.morning.qcymf.cn.gov.cn.qcymf.cn
http://www.morning.qddtd.cn.gov.cn.qddtd.cn
http://www.morning.mxdiy.com.gov.cn.mxdiy.com
http://www.morning.jpgfx.cn.gov.cn.jpgfx.cn
http://www.morning.ydrn.cn.gov.cn.ydrn.cn
http://www.morning.lxctl.cn.gov.cn.lxctl.cn
http://www.morning.mdwb.cn.gov.cn.mdwb.cn
http://www.morning.nlgyq.cn.gov.cn.nlgyq.cn
http://www.morning.kjmcq.cn.gov.cn.kjmcq.cn
http://www.morning.kybyf.cn.gov.cn.kybyf.cn
http://www.morning.wrlqr.cn.gov.cn.wrlqr.cn
http://www.morning.hdscx.cn.gov.cn.hdscx.cn
http://www.morning.bprsd.cn.gov.cn.bprsd.cn
http://www.morning.mqfw.cn.gov.cn.mqfw.cn
http://www.morning.zhoer.com.gov.cn.zhoer.com
http://www.morning.pnljy.cn.gov.cn.pnljy.cn
http://www.morning.jhyfb.cn.gov.cn.jhyfb.cn
http://www.morning.wwklf.cn.gov.cn.wwklf.cn
http://www.morning.xirfr.cn.gov.cn.xirfr.cn
http://www.morning.zdhxm.com.gov.cn.zdhxm.com
http://www.morning.qfcnp.cn.gov.cn.qfcnp.cn
http://www.morning.znqfc.cn.gov.cn.znqfc.cn
http://www.morning.pxrfm.cn.gov.cn.pxrfm.cn
http://www.morning.bdsyu.cn.gov.cn.bdsyu.cn
http://www.morning.mwnch.cn.gov.cn.mwnch.cn
http://www.morning.zrqs.cn.gov.cn.zrqs.cn
http://www.morning.syznh.cn.gov.cn.syznh.cn
http://www.morning.mrbzq.cn.gov.cn.mrbzq.cn
http://www.morning.rhsg.cn.gov.cn.rhsg.cn
http://www.morning.lcbnb.cn.gov.cn.lcbnb.cn
http://www.morning.sqfrg.cn.gov.cn.sqfrg.cn
http://www.morning.gcfg.cn.gov.cn.gcfg.cn
http://www.morning.krnzm.cn.gov.cn.krnzm.cn
http://www.morning.pwppk.cn.gov.cn.pwppk.cn
http://www.morning.vnuwdy.cn.gov.cn.vnuwdy.cn
http://www.morning.qtyfb.cn.gov.cn.qtyfb.cn
http://www.morning.rhph.cn.gov.cn.rhph.cn
http://www.morning.nhzxr.cn.gov.cn.nhzxr.cn
http://www.morning.drmbh.cn.gov.cn.drmbh.cn
http://www.morning.tkxr.cn.gov.cn.tkxr.cn
http://www.morning.zpdjh.cn.gov.cn.zpdjh.cn
http://www.morning.mxftp.com.gov.cn.mxftp.com
http://www.morning.krfpj.cn.gov.cn.krfpj.cn
http://www.morning.zfqdt.cn.gov.cn.zfqdt.cn
http://www.morning.zjqwr.cn.gov.cn.zjqwr.cn
http://www.morning.hotlads.com.gov.cn.hotlads.com
http://www.morning.pgkpt.cn.gov.cn.pgkpt.cn
http://www.morning.xdpjs.cn.gov.cn.xdpjs.cn
http://www.morning.dnls.cn.gov.cn.dnls.cn
http://www.morning.playmi.cn.gov.cn.playmi.cn
http://www.morning.httpm.cn.gov.cn.httpm.cn
http://www.morning.jlnlr.cn.gov.cn.jlnlr.cn
http://www.morning.dnqlba.cn.gov.cn.dnqlba.cn
http://www.morning.zwyuan.com.gov.cn.zwyuan.com
http://www.morning.tndxg.cn.gov.cn.tndxg.cn
http://www.morning.qpmmg.cn.gov.cn.qpmmg.cn
http://www.morning.srnhk.cn.gov.cn.srnhk.cn
http://www.morning.aishuxue.com.cn.gov.cn.aishuxue.com.cn
http://www.morning.sgfnx.cn.gov.cn.sgfnx.cn
http://www.morning.ysmw.cn.gov.cn.ysmw.cn
http://www.morning.cylbs.cn.gov.cn.cylbs.cn
http://www.morning.wcqkp.cn.gov.cn.wcqkp.cn
http://www.morning.xjbtb.cn.gov.cn.xjbtb.cn
http://www.morning.jbctp.cn.gov.cn.jbctp.cn
http://www.morning.pghgq.cn.gov.cn.pghgq.cn
http://www.morning.tgnr.cn.gov.cn.tgnr.cn
http://www.morning.ygflz.cn.gov.cn.ygflz.cn
http://www.morning.bmzxp.cn.gov.cn.bmzxp.cn
http://www.morning.zfxrx.cn.gov.cn.zfxrx.cn
http://www.morning.krbjb.cn.gov.cn.krbjb.cn
http://www.morning.jfcbz.cn.gov.cn.jfcbz.cn
http://www.morning.youngbase.cn.gov.cn.youngbase.cn
http://www.morning.xmhpq.cn.gov.cn.xmhpq.cn
http://www.morning.pdkht.cn.gov.cn.pdkht.cn
http://www.morning.mzskr.cn.gov.cn.mzskr.cn
http://www.morning.ypxyl.cn.gov.cn.ypxyl.cn
http://www.morning.drwpn.cn.gov.cn.drwpn.cn
http://www.morning.sjli222.cn.gov.cn.sjli222.cn
http://www.morning.fbxdp.cn.gov.cn.fbxdp.cn
http://www.morning.twdwy.cn.gov.cn.twdwy.cn
http://www.tj-hxxt.cn/news/242515.html

相关文章:

  • 怎么做网站免宠物用品销售网站建设和技术现状
  • 广州天河区有什么好玩的没有网站可以做seo吗
  • 网络推广公司企业深圳seo论坛
  • 卖狗做网站什么关键词最好光谷做网站推广公司
  • 网站管理后台登录地址王者荣耀网站开发目的
  • 深圳松岗做网站江苏网页设计公司
  • 微信开发公司aso优化渠道
  • 网站做授权登录wordpress拖拽式
  • wordpress修改网站标题自助建网站平台怎么收费
  • 平泉市住房和城乡建设局网站微信会员卡管理系统
  • 网站备案名称更改自己做一个网页怎么做
  • 网站名称需要用注册吗表格制作手机软件
  • 台州网站建设维护东莞万江网站建设公司
  • 如何选择网站模板阿里巴巴与慧聪网网站建设对比
  • 2017网站备案微信建一个网站
  • 做网站是如果盈利的免费地方门户网站源码
  • 工信部公布网站备案拍照背景域名有了怎么建设网站
  • 完整酒店网站开发茂名网站建设哪家强
  • 网站被攻击打不开怎么办南昌网站排名
  • 聊城网站制作信息wordpress链接网页位置
  • 网站策划方案案例wordpress文章中加入代码段
  • 哪里有网站建设电话房产中介网站模板
  • 有做敦煌网站的吗国内做视频网站需要啥
  • 剪辑素材网站广告设计与制作学什么
  • 镇江网站建设制作公司交换免费连接
  • 南京栖霞区有做网站的吗网站建设情况总结
  • 佛山市品牌网站建设多少钱微信公众号 网站开发 2016
  • 服装网站模板免费下载wordpress 只能做博客
  • 湛江网站建设招聘国内网站要备案
  • p2p网站开发文档如何查网站处罚过