自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

原创 微信小程序简单实现聊天室功能

<?php $server = new swoole_websocket_server("0.0.0.0", 9501); $server->on('open', function (swoole_websocket_server $server, $request) { file_put_contents( __DIR__ .'/log.txt' , $request->fd);}); $server->on('message', function (swo.

2022-02-16 08:42:08 3177

原创 laravel8+ 微信小程序生成二维码

首先生成 access_token public function getAccessToken() { $url = "https://api.weixin.qq.com/cgi-bin/token? grant_type=client_credential&appid=".self::APPID."&secret=".self::SECRET; $res = (new Curl())->getUrl($url);

2022-02-15 19:58:09 662

原创 laravel8 小程序分页(非常简单)

后端 public function goodsList(Request $request) { $page = $request->input('page') ?: 1; $limit = $request->input('limit') ?: 5; $status = ($page - 1) * $limit; $result = SeckillModel::with(['goods'])->offset($

2022-01-03 15:17:53 590

原创 laravel8 延迟消息队列

php artisan make:job OrderJop 生成任务类,类名自己取启动任务队列:php artisan queue:work 能看到执行成功<?phpnamespace App\Jobs;use App\Models\GoodsModel;use App\Models\OrderModel;use App\Models\SkillModel;use Illuminate\Bus\Queueable;use Illuminate\Contracts\Q.

2021-12-30 20:29:45 406

原创 laravel8 微信小程序解密获取手机号

首先根据code授权登录获取openid和session_key入库 public function login(Request $request) { $code = $request->input('code'); $url = sprintf(config('wechat.wx_url'),config('wechat.appid'),config('wechat.secret'),$code);

2021-12-26 20:28:51 1028

原创 laravel8 Token验证

Service 层<?phpnamespace App\Service;use Firebase\JWT\JWT; class Token{ protected $key; public function __construct() { $this->key = 'lizichen'; } /** * 生成token */ public function createToken($uid)

2021-12-01 20:33:04 445

原创 laravel8 + 微信小程序手机号登录注册

laravel8 根据手机号获取验证码 存到redis public function getCode(Request $request) { $phone = $request->input('phone'); $code = (new Server())->sendMsg($phone); if ($code) { Cache::store('redis')->put('code_' . $phon

2021-12-01 20:22:06 515

原创 laravel8 + 微信小程序实现签到功能

$uid = $request->input('user_id');$time = date("Y-m-d", strtotime("-1 day"));$nowTime = date("Y-m-d");if (date('w') == 1) { Redis::set($uid, 1);}$data = SingModel::where('sing_at', '>=', $nowTime . " 00:00:00")->where('sing_at', '<=',.

2021-11-03 19:20:13 413

原创 laravel8 Es简单实现搜索功能

public function create_index(){ //简单索引 $client = ClientBuilder::create()->build(); $params = [ 'index' => 'lists' ]; // Create the index $response = $client->indices()->create($params);}public function ad.

2021-07-08 21:34:31 643

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除