作者归档:admin

drupal 重写

ngnix重写规则

location ~ ^/sites/[^/]+/files/.*\.php$ {
    deny all;
} 
location ~* ^/.well-known/ {
    allow all;
} 
location ~ (^|/)\. {
    return 403;
}

location / { 
    try_files $uri /index.php?$query_string; 
}

location ~ /vendor/.*\.php$ {
    deny all;
    return 404;
}
location ~ ^/sites/.*/files/styles/ {
    try_files $uri /index.php?$query_string;
}

location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
    try_files $uri @rewrite;
    expires max;
    log_not_found off;
}

xhprof性能分析

https://pecl.php.net/package/xhprof

需要 xhprof_htmlxhprof_lib 两个文件夹,开启xhprof扩展

开始

if(function_exists('xhprof_enable')){
    xhprof_enable(XHPROF_FLAGS_NO_BUILTINS + XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY); 
}

结束

$xhprof_data = xhprof_disable();   
$xhprof_path =  __DIR__;
include_once $xhprof_path . "/xhprof_lib/utils/xhprof_lib.php";
include_once $xhprof_path . "/xhprof_lib/utils/xhprof_runs.php";
$xhprof_runs = new XHProfRuns_Default();
$n_name = '';
global $g_user_id; 
$n_name = $_SERVER['SERVER_NAME'];
$n_name .= $_SERVER['REQUEST_URI'];
$n_name = str_replace('/','@',$n_name);
$run_id = $xhprof_runs->save_run($xhprof_data, $n_name); 

自助打印-技术文档

计划任务

php think printer:printer_money  
php think printer:printer_pay 

智能证件照接口

http://dev.id-photo-verify.com/doc.html

配置参数

# 制作并检测证件照	
printer_ai_key = 
# 制作并裁剪换正装
printer_ai_change_dress =  

文档转PDF

https://market.aliyun.com/products/56928005/cmapi00044564.html

身份证去除背景

可在后台配置

https://www.textin.com

pip3 install --upgrade pip
yum install -y rh-python38 which
pip3 install backgroundremover 

配置命令行

backgroundremover = /opt/rh/rh-python38/root/usr/local/bin/backgroundremover

默认为 /opt/rh/rh-python38/root/usr/local/bin/backgroundremover

试卷翻新

https://www.textin.com/experience/text_auto_removal

解压zip、7z、gz、tar、bz2包

yum -y install p7zip unar unzip

PDF 依赖

yum install ImageMagick ImageMagick-devel ghostscript pdftk  poppler-utils  perl-Image-ExifTool.noarch 

安装 libreoffice

doc xls ppt转pdf

yum install libreoffice  

GX

yum install python3
如果提示requests模块不存在
pip install --upgrade pip
pip install requests
如果提示secrets模块不存在
pip install python-secrets -i https://pypi.tuna.tsinghua.edu.cn/simple
如果上面的secrets不能安装可尝试
pip install virtualenv
virtualenv myenv
source myenv/bin/activate 
后再执行 
如果报urllib3错误,说明 urllib3与chardet版本不一致,使用以下方式解决
pip uninstall urllib3 chardet 
pip install --upgrade requests

管理员菜单

当菜单过多时可进行分组显示。

代码

set_menu_group('视频商城',[
    '/a_shop_store/shop/index',
    '/a_shop_store/store/index',
    '/mall/goods',
    '/mall/order/video',
    '/fx/admin', 
    '/enroll/admin', 
    '/video/group',
]);

set_menu_group('管理',[
    '/admin/member',
    '/admin/config',  
    '/admin/user',  
    '/webtool/admin',  
]);

uniapp监听事件

演示代码请根据实际需要进行修改

注:需要在同一域名下

H5的PHP代码

<script type="text/javascript" src="<?=cdn_url()?>/lib/uni.webview.1.5.5.js"></script>  
<?php  
$vue->created(['load_vue()']);
$vue->data('uni',"");
$vue->method("load_vue()","
document.addEventListener('UniAppJSBridgeReady', function() {  
    _this.uni = uni;   
});
"); 
$vue->method("test()"," 
	_this.uni.postMessage({ 
    data:{
       action:'login',  
       data:res.data, 
    }
  });  
"); 
?>

data结构

data:{data:{user_id:'',token:''}}

UNIAPP

<template>
	<view>
		<web-view :src="url" ref="view" @message="message"></web-view>
	</view>
</template>

<script>
	var _this
	export default {
		data() {
			return {
				url: ''
			}
		},
		onLoad() {
			_this = this
			this.url = this.config.domain + '/applet/login'
			// #ifdef H5   
			window.addEventListener("message", receive_message, false); 
			function receive_message(event) {
				let res = event.data.data.arg
				let action = res.action
				let d = res.data
				_this.login_listen(action, d)
			}
			// #endif
		},
		methods: {
			message(e) {
				console.log('on message')
				console.log(e)
				let res = e.detail.data[0]
				let d = res.data
				let action = res.action
				_this.login_listen(action, d)
			},
			login_listen(action, d) {
				if (action == 'login') {
					if (d.token) { 
						uni.navigateBack()
					}
				}
			}
		}
	}
</script> 

客服APP

主要用于多商户系统,

客户点击商家联系图标弹出聊天窗口,发送信息,商家在PC端或APP端收到来自客户的信息并进行回复。

当客户点击系统的平台客服时弹出聊天窗口,平台客服在PC或APP端到来自客户的信息并进行回复。

PC、H5、APP聊天基础功能,PC直接用URL注册、登录后打开IM页面就可以聊天了。

PC 界面

H5、APP

已知问题

  1. PC注册、登录未加sign
  2. 消息未加离线
  3. APP未加通知

注意:为了APP登录安全建议开启腾讯云验证码

点击发送验证码时效果

技术部分

服务端配置

location / {
  limit_req zone=nglimit burst=100 nodelay;
  if (!-e $request_filename) {
    rewrite  ^(.*)$  /index.php?s=$1  last;
  } 
}
location /uploads/ {
    try_files $uri /image_cache/index.php/$uri;
}

location /wss {
    proxy_pass http://127.0.0.1:10001;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header X-Real-IP $remote_addr;
} 

location /ws {
    proxy_pass http://127.0.0.1:10001;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header X-Real-IP $remote_addr;
} 

分销

项目 bbc_video (多用户视频商城系统)

模块 fx

平台后台请访问左侧 分销菜单

小程序

点击提现

发起提现

点击直拉邀请、间接邀请等

点击邀请好友

joomla

语言包

1.后台安装语言包

/administrator/index.php?option=com_installer&view=languages

2.选择中文

注意有前台、后台区别

/administrator/index.php?option=com_languages&view=installed&client=1