自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(356)
  • 资源 (15)
  • 收藏
  • 关注

原创 fastadmin 常用操作

1、列表页自定义toggle{field: 'enable', title: __('Enable'), formatter: function(val, row, index){ if (val == 0){ return '<a href="javascript:;" data-toggle="tooltip" title="" class="btn-change " data-index="0" data-id="'+ row.group_id +'" dat

2021-12-02 15:15:23 1404

原创 editor.md基本使用和图片上传

1、代码<!DOCTYPE html><html lang="zh"> <head> <meta charset="utf-8" /> <title>Simple example - Editor.md examples</title> <link rel="stylesheet" href="css/style.css" /> <link r

2021-10-18 11:31:08 1210

原创 fastadmin 使用 topthink/img 压缩、裁剪、加水印、处理图片

1、安装composer require topthink/think-image2、使用(application/admin/controller/Ajax.php)在fastadmin中上传文件的公用方法中使用思路:可以添加上传参数type,系统会根据type选择不同的方式处理图片 $new_file_name = ''; if (in_array($fileInfo['type'], ['image/gif', 'image/jpg', 'image/j

2021-09-16 15:16:28 1648 1

原创 uniapp vue 利用canvas生成海报

<template> <view class="content" v-if="isShow" @click.stop="isShow=false"> <canvas @click.stop="" :style="{ width: canvasW + 'px', height: canvasH + 'px' }" canvas-id="my-canvas"></canvas> <view class="save-btn" @click.stop=

2021-09-06 13:43:11 375

原创 uniapp 微信小程序 保存图片到本地

先下载,再保存uni.downloadFile({ url, success: (res) =>{ if (res.statusCode === 200){ uni.saveImageToPhotosAlbum({ filePath: res.tempFilePath, success: function() { uni.showToast({ title: "保存成功", icon: "none" }); },

2021-09-06 13:37:59 406

原创 使用PhpOffice\PhpSpreadsheet生成Excel表格

1、安装PhpOffice\PhpSpreadsheetcomposer require phpoffice/phpspreadsheet2、引入use PhpOffice\PhpSpreadsheet\Helper\Sample;use PhpOffice\PhpSpreadsheet\IOFactory;use PhpOffice\PhpSpreadsheet\Spreadsheet;use PhpOffice\PhpSpreadsheet\Writer\Xlsx;use PhpOffi

2021-08-28 14:03:25 800

原创 使用easywechat生成小程序码

1、安装easywechat2、使用 $path = '/pages/index/index'; $config = [ 'app_id' => 'wxb5axxxx', 'secret' => 'XXXX', 'response_type' => 'array', 'log' => [ 'level' => 'deb

2021-08-27 17:44:44 1383

原创 vue封装公共函数

1、common.js定义两个公共函数function toast(title = '', icon = 'none') { uni.showToast({ title: title, icon: icon });}function myRequest(url = "", data = {}, method = 'POST'){ return new Promise((res,rej)=>{ uni.request({ url: this.$apiUrl + url,

2021-08-15 14:40:06 836

原创 springboot(4):整合spring security

1、引入依赖(只列举部分) <dependency> <groupId>org.thymeleaf.extras</groupId> <artifactId>thymeleaf-extras-springsecurity5</artifactId></dependency><dependency> <groupId>org.springframework.security&l

2021-05-16 16:50:47 121

原创 springboot(三):整合mybatis

1、引入依赖(mybatis和lombok)<dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.1.1</version></dependency><dependency>

2021-05-05 12:12:43 148

原创 springboot(二):整合druid

1、pom.xml中添加druid依赖<dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.24</version></dependency>2、application.yml中配置数据库type指定数据源spring: datasource:

2021-05-04 17:03:56 203

原创 springboot(一)

准备工作,1、配置好JDK2、IntelliJ编辑器1、用IDEA新建spring boot项目1、Developer Tools(必选) -Spring Boot DevTools -Lombok2、Web (必选) -Spring Web -Spring Web Services3、Template Engines(可选,后期可在prom.xml文件中添加此依赖) -Thymel...

2021-04-04 13:47:09 218 2

原创 linux 使用 top 查看进程信息

查看 ps aux | sort -k4nr | head -n 5查看 ps aux | sort -k3nr | head -n 5参考链接https://www.cnblogs.com/mengchunchen/p/9669704.html

2021-01-26 17:28:11 725 2

原创 go/gin:使用redis

"github.com/go-redis/redis"1、安装go get -u github.com/go-redis/redis2、引入并初始化var ( Redis *redis.Client)func InitRedis() (err error) { Redis = redis.NewClient(&redis.Options{ Addr: "127.0.0.1:6379", Password: "", // no password se.

2021-01-21 16:08:37 1345

原创 go/gin使用bcrypt

1、加密result,_ := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)2、比对密码bcrypt.CompareHashAndPassword([]byte(user.Password), []byte(password))

2021-01-12 16:29:59 326

原创 go/gin使用jwt

1、安装拓展包$ go get -u github.com/dgrijalva/jwt-go2、发放tokenfunc ReleaseToken(user *model.User) (tokenString string,err error) { expire := time.Now().Add(7 * 24 * time.Hour) claims := &Claims{ UserId: user.ID, StandardClaims: jwt.StandardClaim

2021-01-12 16:09:51 655

原创 laravel使用redis/set限制登录(同时在线数量)

思路(以限制3台为例)每当用户登录时,执行两个操作:(1)写入session(用户信息 + 随机字符串A)(2)判断redis的集合长度是否大于等于3,如果是,则弹出集合第一个元素,否则,继续第三步。(3)写入redis,利用集合(key:用户id,value:随机字符串A)每当用户进入任意页面时候执行一个操作:判断session里的随机字符串是否在redis的集合(key为用户id)里面,如果不在,则清除当前登录用户的session信息,强制下线1、用户登录 //生

2021-01-07 16:51:56 1026

原创 filepond使用

filepond是一款上传插件。官网https://pqina.nl/filepond基本使用1、cdn引入<link href="https://unpkg.com/filepond/dist/filepond.css" rel="stylesheet"><script src="https://unpkg.com/filepond/dist/filepond.js"></script>2、html<input type="file" .

2021-01-07 11:26:55 2207

原创 linux部署go/gin项目

安装部署go环境1、打开go官网(https://golang.google.cn/dl/),找到适合系统的版本(uname -a查看版本),复制下载连接,比如https://golang.google.cn/dl/go1.15.6.linux-amd64.tar.gz2、下载$ wget https://golang.google.cn/dl/go1.15.6.linux-amd64.tar.gz3、解压$ tar xzf go1.15.6.linux-amd64.tar....

2021-01-04 12:17:57 1595 5

原创 Go/Gin 项目封装拆分步骤

原始项目package mainimport( "github.com/gin-gonic/gin" "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/mysql")type Todo struct{ ID int `json:"id"` Title string `json:"title"` Status bool `json:"status"`}var( DB *gorm.DB)f

2020-12-30 12:06:04 1219

原创 Go/Gin报错集锦(1):exec: “gcc“: executable file not found in %PATH%

1、下载https://jmeubank.github.io/tdm-gcc/download/2、全部勾选,完成3、命令行输入 gcc -v4、重启goland

2020-12-29 17:34:14 162

原创 DcatAdmin开发集锦(2):屏蔽OSS找不到文件错误

新增/编辑页面,若远程文件不存在,则删除数据库文件字段记录 $id = \request('article'); if($id){$res = Article::find($id); if($res->photo != ''){ $handle= @fopen('http://static.abc.com/'.$res->photo,'r'); if (!$handle) { $res->phot

2020-12-18 11:25:52 436

原创 Tinymce 配置

'language'=>'zh_CN', 'plugins'=>'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wor...

2020-12-17 10:17:36 610

原创 DcatAdmin开发集锦(1):使用模型树

1、创建category表(必须有parent_id id title order show)字段CREATE TABLE IF NOT EXISTS `category` ( `id` bigint(20) unsigned NOT NULL, `parent_id` bigint(20) NOT NULL DEFAULT '0', `order` int(11) NOT NULL DEFAULT '0', `title` varchar(50) COLLATE utf8mb4_un

2020-11-25 15:26:12 2639

原创 方便SEO自动跳转手机端JS代码

1、网站<head></head>加入canonical、alternate标签<link rel="canonical" href="{{\Request::url()}}"/><link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.xxxx.com/{{\Request::path() == '/' ? '' : \Request::path()}}

2020-11-25 09:40:17 376

原创 宝塔面板一个网站绑定两个域名配置SSL

宝塔面板一个网站绑定两个以上的域名配置SSL1、比如a.com b.com c.com 同时绑定一个网站2、申请证书,获取pem、key3、开启a.com 的ssl4、点击左侧配置文件<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "/www/wwwroot/test.com/public" ServerName 7277db5a.test.com Serve

2020-11-20 15:51:55 6134 2

原创 Laravel 新篇章(2):使用定时任务

1、生成任务类App\Console\Commands\Test.phpphp artisan make:command SendEmail2、打开文件App\Console\Commands\Test.phpnamespace App\Console\Commands;use Illuminate\Console\Command;class SendEmail extends Command{ protected $signature = 'email:send';..

2020-11-20 09:32:08 163

原创 Laravel 新篇章(1):使用队列

1、在.env文件中进行配置(默认为异步,数据库)QUEUE_CONNECTION=database2、生成队列表php artisan queue:table执行php artisan migrate3、数据库中会生成jobs和failed_jobs两张表jobs存放未执行的队列failed_jobs存放执行失败的队列4、生成Job类(位于app\Jobs\SendEmailJob.php)php artisan make:job SendEmailJob

2020-11-12 16:09:38 304

原创 uniapp个人开发常用设置 & 封装方法

1、封装 http 请求1、新建 unti/api.jsconst BASE_URL = 'http://www.abc.com/api/v1'export const myRequest = (options)=>{ return new Promise((resolve, reject)=>{ uni.request({ url: BASE_URL + options.url, method: options.method || 'GET', data:

2020-11-09 16:15:07 623

原创 jq 关键字/搜索结果变色

var val = 'abcdef';var searchText = 'c';var regExp = new RegExp(searchText, 'g');var newval = val.replace(regExp, '<a style="color:red" >'+searchText+'</a>');则newval就是替换后关键词高亮的内容val 是 abcdenewval 是abcde...

2020-10-27 13:02:29 422

原创 同一台电脑上Git配置Github Gitee的ssh

阅读之前请了解git相关知识:查看git配置git config --system --list //系统级配置git config --global --list //全局配置git config --local --list //当前项目配置 进行配置git config --global user.name "test"git config --global user.email "[email protected]"删除配置git config

2020-10-12 11:20:53 208

原创 laravel 开发拓展包

1、在根目录下新建packages/itchuan/src/MD5Hasher.php并写入<?phpnamespace Itchuan\Hasher;class MD5Hasher{ public function make($value, array $options = []) { $salt = isset($options['salt']) ? $options['salt'] : ''; return hash(

2020-10-09 09:56:03 292

原创 Go/Gin 数据库相关

1、安装gormgo get -u gorm.io/gormgo get -u gorm.io/driver/mysql2、引入import ( "gorm.io/gorm" "gorm.io/driver/sqlite")3、连接func main() { dsn := "root:root678@tcp(127.0.0.1:3306)/topics?charset=utf8mb4&parseTime=True&loc=Local" db, _

2020-09-27 10:35:22 193

原创 GO/Gin 使用自定义验证器 V8 V10

使用V8版本package main import ( "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" "gopkg.in/go-playground/validator.v8" "net/http" "reflect" "time") //binding 绑定一些验证请求参数,自定义标签bookabledate表示可预约的时期type Booking struct { CheckIn time.T

2020-09-26 10:43:35 1802 3

原创 Go:Beego安装与使用

由于下载过慢,改用代理1、配置代理go env -w GO111MODULE=ongo env -w GOPROXY=https://goproxy.io,direct2、安装 beegogo get -u github.com/astaxie/beego3、安装bee脚手架go get -u github.com/beego/bee4、创建项目bee new test5、运行项目bee runbeego采用mvc,使用方法和大多数mvc框架差不多,不

2020-09-23 16:50:00 477

原创 PHP设计模式(5):策略模式

策略模式,将一组特定的行为和算法封装成类,以适应某些特定的上下文环境。eg:假如有一个电商网站系统,针对男性女性用户要各自跳转到不同的商品类目,并且所有的广告位展示不同的广告。在传统的代码中,都是在系统中加入各种if else的判断,硬编码的方式。如果有一天增加了一种用户,就需要改写代码。使用策略模式,如果新增加一种用户类型,只需要增加一种策略就可以。其他所有的地方只需要使用不同的策略就可以。首先声明策略的接口文件,约定了策略的包含的行为。然后,定义各个具体的策略实现类。UserStrategy..

2020-09-22 17:17:42 144

原创 PHP设计模式(4):适配器模式

将各种截然不同的函数接口封装成统一的API。PHP中的数据库操作有MySQL,MySQLi,PDO三种,可以用适配器模式统一成一致,使不同的数据库操作,统一成一样的API。类似的场景还有cache适配器,可以将memcache,redis,file,apc等不同的缓存函数,统一成一致。首先定义一个接口(有几个方法,以及相应的参数)。然后,有几种不同的情况,就写几个类实现该接口。将完成相似功能的函数,统一成一致的方法。统一接口<?phpnamespace IMooc;interface

2020-09-22 17:17:20 128

原创 PHP设计模式(3):注册模式

将对象注册到全局树上,就可以被任意地方访问了注册模式,解决全局共享和交换对象。已经创建好的对象,挂在到某个全局可以使用的数组上,在需要使用的时候,直接从该数组上获取即可。将对象注册到全局的树上。任何地方直接去访问。<?phpclass Register{ private static $objects; public static function set($key,$value){ self::$objects[$key] = $value; //将对象放到树上 }

2020-09-22 17:17:01 110

原创 PHP设计模式(2):工厂模式

工厂模式  一个类通过本身的静态方法来,实例化一个类并返回一个实例对象;classFactory{staticpublicfunctionfactory($class_name){returnnew$class_name();}}如果已经使用的类内部发生改变,哪不需要在所有的地方都改变,只需要在类工厂类里改变既可,比如:连接数据库,可以使用mysql 、mysqli、pdo,根据不同参数配置使用不同的数据库操作类做支付接口的时候,未来...

2020-09-22 17:16:42 117

原创 PHP设计模式(1):单例模式

Singleton:单例模式单例模式是最常见的模式之一,在运行时为某个特定的类创建仅有一个可访问的实例。特点:三私一公私有属性:用于保存实例私有的构造方法:防止创建实例私有的克隆方法:防止复制实例公有的静态方法:对外界提供实例class Singleton{ //私有属性,用于保存实例 private static $instance; //构造方法私有化,防止外部创建实例 private function __construct(){}

2020-09-22 17:14:57 192

Tabby工具 windows版本 ssh / shell 工具 正版软件 版本 1.0.164

Tabby是一个基于 TypeScript 开发的终端模拟器,适用于 Windows,macOS 和 Linux。 那么Tabby如何使用呢,本文将介绍下Tabby下载安装和添加SSH连接。版本 1.0.164

2022-09-06

editormd.zip

editor.md基本使用及上传代码,请放在服务器上运行,不要直接在文件资源管理器中打开 教程查看https://blog.csdn.net/sinat_37390744/article/details/120823214

2021-10-18

VisualSVN Server服务端(2.7.7)和tortoiseSVN客户端(1.8.10)含中文语言.zip

VisualSVN Server服务端(2.7.7)和tortoiseSVN客户端(1.8.10)含中文语言包;使用方法见我的博客

2019-03-29

wget for windows 64位安装包exe文件

wget for windows 64位安装包exe文件;使用方法如下:将下载的压缩包解压后,将里面的wget.exe文件复制到C:Windows\System32文件夹里面;此时打开cmd命令行,直接输入wget 资源链接 就可以啦

2019-03-23

安卓版日语词典KDictionary

安卓版日语词典KDictionary

2017-08-07

yii2 basic 文件

yii2 basic 文件

2017-07-03

ionic-app-base-master.zip

ionic-app-base-master.zip

2017-07-03

php版本实例(php版本的demo)

php版本的zyUpload多图上传插件

2017-06-14

仿站小工具.

仿站小工具.输入网址即可下载页面和css、js文件,非常好用

2017-05-21

jqzoom-2.3商品相册图片放大

jqzoom-2.3商品相册图片放大

2017-04-02

transport.js文件(解决ecshop jquery jqzoom冲突)

transport.js文件(解决ecshop jquery jqzoom冲突)

2017-04-02

pygame飞机大战源码和素材(Python版)完整版

Python:pygame飞机大战源码和素材

2017-02-22

Phpcms可视化在线编辑

Phpcms可视化在线编辑图文教程

2017-02-07

Phpcms的pc标签实现动态展现子栏目和文章列表

Phpcms的pc标签实现动态展现子栏目和文章列表。图文教程

2017-02-07

Phpcms创建和开发模块

Phpcms创建和开发模块的具体讲解。有图有笔记。自己整理的!步骤详细

2017-02-07

自己用PHPCMS集合BootStrap写的数码网站的源码

自己用PHPCMS集合BootStrap写的数码网站的源码

2017-01-29

空空如也

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

TA关注的人

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