李东's Blog

李东

Laravel

使用API接口签名的代码

使用API接口签名的代码

//签名 function sin($params){ ksort($params); $str = ''; foreach ($params as $key => $param) { if ($param === '') continue; $param=urlencode($param); $str .= (empty($str) ? '' : '&') . "{$key}={$param}"; } // $str.='channelcode='.$params['channelcode'].'&productcode='.$params['productcode'].'&orderno='.$params['orderno'].'&appsecret=Mi1TtL0YyQbqom3xQjOrT2RD7KCPHmel'; $str.='&Mi1TtL0YyQbqom3xQjOrT2RD7KCPHmel'; $md5 = md5($str); return $md5; }
php
19
2025-04-01
Go部署到linux服务器

Go部署到linux服务器

###普通部署 set GOARCH=amd64 set GOOS=linux go build main.go //打包 然后传到线上对应的文件夹 给777权限 我们可以用nohup ./main &命令让程序在后台运行 nohup ./main & 查看程序是否正常运行 ps aux|grep main 关闭项目 用Kill PID 就行了 域名 用nginx 配置代理 映射到对应的IP 端口上去就可访问 location / { proxy_pass http://127.0.0.1:8000; proxy_http_version 1.1; #proxy_cache_bypass $http_upgrade; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Port $server_port; } ###Beego部署 如果bee run 出现报错 重新下载第三方包:go mod tidy 打包部署 bee pack -be GOOS=linux (打包到linux上部署命令) bee pack -be GOOS=window (打包到windows上部署命令) 将压缩包传到服务器gopath目录下,进行解压 nohup 用途:不挂断地运行命令。
php
316
2024-12-15
fastadmin 访问菜单的时候 还是显示 无权限

fastadmin 访问菜单的时候 还是显示 无权限

### 什么是 GitHub Issue sudo pacman-mirrors -i -c China -m rank <pre><code> &lt;script type="text/javascript"&gt; var lastTime = new Date().getTime(); var currentTime = new Date().getTime(); var timeOut = 10 * 60 * 1000; //设置超时时间: 10分 $(function(){ /* 鼠标移动事件 */ $(document).mouseover(function(){ lastTime = new Date().getTime(); //更新操作时间 }); }); function testTime(){ currentTime = new Date().getTime(); //更新当前时间 if(currentTime - lastTime &gt; timeOut){ //判断是否超时 超时就访问退出接口 $.ajax({ url:"admin/logout", dataType:"json", type:"get", async : false, cache : false, success:function(){ // 退出登陆接口 window.location.href="admin/login"; }, error:function(){ } }) } } /* 定时器 间隔1秒检测是否长时间未操作页面 */ window.setInterval(testTime, 1000); &lt;/script&gt; </code></pre>
php
516
2022-08-03