安装Download URL Rewrite Module 2.1
/web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="http2https" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input=&q...
不推荐使用本文的方法,建议使用 props 和 emit
方法来自:stackoverflow.com/questions/55316490,在用这个方法前可以先试试 this.$refs[‘子组件’].doSth(),比下文的方法简单。
子组件
export default {
methods: {
doSth() {
console.log('子组件的 doSth 方法');
},
},
mounted() {
let self = this;
self.$emit('callback', {
doSth: () =&...
# app/Providers/AppServiceProvider.php
public function boot()
{
DB::listen(function ($query) {
$location = collect(debug_backtrace())->filter(function ($trace) {
return !str_contains($trace['file'], 'vendor/');
})->first(); // grab the first element of non vendor/ calls
$bindings = implode(", ", $query->bindings); // format t...
生成版本号配置的文件
hooks.js
const packageInfo = require('./package.json');
const fs = require('fs');
const gitHEAD = fs.readFileSync('.git/HEAD', 'utf-8').trim();
const ref = gitHEAD.split(': ')[1];
let version = packageInfo.version;
let commitId = ref ? fs.readFileSync('.git/' + ref, 'utf-8').trim() : gitHEAD;
let ...
驱动来自 blackPantherOS/rtl8192fu(代码被清了,历史记录里还有,拉下来后 git reset –hard 即可)
下载
安装后需要重启
开机后如果没有出现 WiFi 设备而是多了一个 CD-ROM 的话,执行:
usb_modeswitch -v 0bda -p a192 -KW
# usb_modeswitch 不会开机自动运行可以参考这个:
# mv /lib/udev/rules.d/40-usb_modeswitch.rules /lib/udev/rules.d/61-usb_modeswitch.rules
# sudo udevadm control --reload-rule...
.env
APP_VERSION=v2.0.1 beta
app/Http/Kernel.php
protected $middleware = [
// ...
\App\Http\Middleware\Version::class, // 在 http header 中返回当前接口的 Git 版本
];
app/Http/Middleware/Version.php
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class Version
{
/**
* 在 header 中添加项目 Git 库的 commit id
*
* @para...
function dodash(callsign = '') {
var sign = callsign.match(/[a-z0-9]+/)[0].toUpperCase();
var hash = 0x73e2;
var i = 0;
while (i < sign.length) {
var f = sign[i].charCodeAt();
hash ^= f<<8;
if (sign[i + 1]) {
var s = sign[i+1].charCodeAt();
hash ^= s;
}
i += 2;
}
return Math.abs(hash);
}
var code = dodash('BZ0ZZZ');
co...
const packageInfo = require('./package.json');
const fs = require('fs');
const gitHEAD = fs.readFileSync('.git/HEAD', 'utf-8').trim();
const ref = gitHEAD.split(': ')[1];
let version = packageInfo.version;
let commitId = '';
if (ref) {
commitId = fs.readFileSync('.git/' + ref, 'utf-8').trim();
} else ...
介绍
laravel-nestedset(Nested Set Model)
安装
composer require kalnoy/nestedset
用法
// database/migrations/2020_08_10_155445_create_category_table.php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCategoryTable extends Migration
{
public function up()
{
Schema::create('categor...
当服务器宕机时,同一个页面的所有接口都会报错,导致页面出现一堆消息,本文方法可以让相同内容的消息只显示最后一个。
不支持 .error() 式的用法。
操作步骤
编辑 main.js,添加以下代码:
import { Message } from 'element-ui';
var MessageStack = [];
Vue.prototype.msg = function(config = {}) {
MessageStack.forEach(function(item = {}) {
if (item.message == config.message && ite...
仅支持无感知验证,
vue-recaptcha-v3
yarn add vue-recaptcha-v3
src/main.js
import { VueReCaptcha } from 'vue-recaptcha-v3';
Vue.use(VueReCaptcha, {
siteKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
loaderOptions: {
// 是否使用国内的 recaptcha.net 域名
useRecaptchaNet: true,
// 是否隐藏“由reCAPTCHA 提供保护 隐私 - 使用条件”
autoHideBadge: process.env.N...
安装 Laravel
composer create-project laravel/laravel ./
修改依赖的下载源
composer global require slince/composer-registry-manager
composer repo:ls
composer repo:use aliyun
添加项目依赖
composer require doctrine/dbal # 增加修改表结构功能
composer require zedisdog/laravel-schema-extend # 增加表注释功能
composer require laravel/passport # OAuth
composer require spatie/laravel-permission # Permis...