ApiCloud打包H5壳APP,apicloud h5使用api对象接口,h5退出App应用方法,Apicloud Web App退出App
ApiCloud打包H5壳APP,apicloud h5使用api对象接口,h5退出App应用方法,Apicloud Web App退出App
使用H5打包的apicloud web app,需要退出App时,可以直接调用这个接口
<div onclick='closeApp()'>直接退出!</div><script> api.closeWidget({ silent:true // 静默退出 });</script>
ApiCloud api接口可以直接在Web App里使用https://docs.apicloud.com/Client-API/api#14
PHP图像文字绘制 坐标尺寸测量 PHP图像文字水平居中处理
PHP绘制文字到图像时,有时需要文字居中,这时候就要用到imagettfbbox函数.示例:
//1.配置图片路径$src = '图片本地路径';//2.获取图片信息$info = getimagesize($src);//3.通过编号获取图像类型$type = image_type_to_extension($info[2], false);//4.在内存中创建和图像类型一样的图像$fun = "imagecreatefrom" . $type;//5.图片复制到内存$image = $fun($src);$font = "字体.ttf";$content='我是文字内容';$fontSize = 40;//像素字体大小//设置字体颜色和透明度$color = imagecolorallocatealpha($image, 0,0,0,0);//计算文字边距坐标位置$fontBox = imagettfbbox($fontSize, 0, $font, $content);//文字水平居中处理 $info ...
微擎登录后,直接跳转到应用后台
微擎登录后,直接跳转到应用后台
微擎版本: v2.5.4
根目录\web\source\user\login.ctrl.php
底部找到
itoast("欢迎回来,{$record['username']}", $forward, 'success');
代码,在前面添加
$forward ='./index.php?c=home&a=welcome&do=ext&m=模块名';
最终
isetcookie('__uid', '1', 7 * 86400);isetcookie('__uniacid', '2', 7 * 86400);$forward ='./index.php?c=home&a=welcome&do=ext&m=xxx';itoast("欢迎回来,{$record['username ...
献血记
我不喜欢这个世界,因为它有很多不美好的地方。但是我愿意去做些什么,让它变成我喜欢的样子,即使我没有能力做到,那我为它多添一点美好也是愿意的。
进程 线程 子进程 About Processes,Threads,Coroutine
here is a story to explain what Processes,Threads,Coroutine is,andunderstanding of parallel and concurrent programming
1.Parallel and Concurrent
Parallel: simultaneous execution of multiple tasks
Concurrent Multiple tasks are executed alternately on the same processor
2.Processesmean program in progress
strengths and weaknessesstrengths:
more stability and safety
weaknesses:
require more resource overhead when processe swiching
IPC is complex and time-consuming
3.ThreadsThread contained in ...
PHP ZIPARCHIVE 压缩文件处理目录结构 PHP ZIPARCHIVE directory structure
PHP ZIPARCHIVE 压缩文件处理目录结构 Prevent directory structure in compressed package
$flag = $zip->open($filePath, \ZIPARCHIVE::CREATE);if ($flag!== TRUE) { //if Linux,need check file authorization exit("open file err="+$flag);}//add test.php to zip file $zip->addFile('test.php');// run rename$zip->renameName('test.php','test.php');
async await promise demo
async await promise 实例
video demo
function step1(query) { return new Promise((success) => { let waiting=2000; setTimeout(() => { success('wait-time:'+waiting+' step:'+query); }, waiting); });}function step2(query) { return new Promise((success) => { let waiting=1000; setTimeout(() => { success('wait-time:'+waiting+' step:'+query); ...