我的电脑,属性,高级,环境变量,phth,path
月度归档: 2018 年 12 月
微信小程序server mysql
const { mysql } = require('../qcloud') module.exports = async (ctx, next) => { return mysql.select() .from('cSessionInfo') .then(function (response) { ctx.state.data = response }) }
react
npm install -g create-react-app
create-react-app jinguan
brew install yarn
yarn add styled-components
yarn add redux
yarn add react-redux
yarn start
composer国内镜像依赖
"repositories": { "packagist": { "type": "composer", "url": "https://packagist.phpcomposer.com" } }
linux command
ssh root@123.207.16.105 cd /var/www/jinguan git reset --hard git pull chmod -R 777 app/alipay.trade.page.pay-PHP-UTF-8/log.txt php artisan migrate:rollback php artisan migrate php artisan user
alipay demo encrypt and decrypt function renamed
alipay demo 和 laravel 的加密解密全局函数冲突。
vim查找:
vimgrep /\
vimgrep /\
vim替换:
:%s/\
:%s/\
最后找到需要的替换文件如下:
aop/AopEncrypt.php
aop/AopClient.php
lotusphp_runtime/Cookie/Cookie.php
laravel5找回密码改中文
5.7
lang/zh_cn.json
{ "Login": "登陆", "E-Mail Address": "邮箱", "Password": "密码", "Remember Me": "记住我", "Forgot Your Password?": "忘记密码?", "Register": "注册", "Name": "姓名", "Confirm Password": "重复密码", "Reset Password": "重设密码", "Send Password Reset Link": "发送邮件", "Logout": "退出", "Reset Password Notification": "找回密码", "You are receiving this email because we received a password reset request for your account.": "您收到此电子邮件,因为我们收到了找回密码请求您的账户。", "If you did not request a password reset, no further action is required.": "如果没有请求找回密码,则不需要进一步的操作。", "Hello!": "您好!", "Regards": "真挚问候", "If you’re having trouble clicking the ": "如果您不能点击" }
5.4
php artisan vendor:publish --tag=laravel-notifications//找回密码邮件模版 php artisan make:notification ResetPassword//找回密码邮件通知
App/Notifications/Resetpassword.php
<?php namespace App\Notifications; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Notification; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; class ResetPassword extends Notification { use Queueable; /** * The password reset token. * * @var string */ public $token; /** * Create a notification instance. * * @param string $token * @return void */ public function __construct($token) { $this->token = $token; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { return ['mail']; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { return (new MailMessage) ->subject('找回密码') ->line('您收到此电子邮件,因为我们收到了找回密码请求您的账户。') ->action('重设密码', route('password.reset', $this->token)) ->line('如果没有请求找回密码,则不需要进一步的操作。'); } /** * Get the array representation of the notification. * * @param mixed $notifiable * @return array */ public function toArray($notifiable) { return [ // ]; } }
app\User.php
<?php namespace App; use Illuminate\Notifications\Notifiable; use Illuminate\Foundation\Auth\User as Authenticatable; use App\Notifications\ResetPassword as ResetPasswordNotification; class User extends Authenticatable { use Notifiable; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'name', 'email', 'password', ]; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; public function sendPasswordResetNotification($token) { $this->notify(new ResetPasswordNotification($token)); } }
views/vendor/notifications/email.blade.php
@component('mail::message') {{-- Greeting --}} @if (! empty($greeting)) # {{ $greeting }} @else @if ($level == 'error') # 错误! @else # 您好! @endif @endif {{-- Intro Lines --}} @foreach ($introLines as $line) {{ $line }} @endforeach {{-- Action Button --}} @if (isset($actionText)) <?php switch ($level) { case 'success': $color = 'green'; break; case 'error': $color = 'red'; break; default: $color = 'blue'; } ?> @component('mail::button', ['url' => $actionUrl, 'color' => $color]) {{ $actionText }} @endcomponent @endif {{-- Outro Lines --}} @foreach ($outroLines as $line) {{ $line }} @endforeach <!-- Salutation --> @if (! empty($salutation)) {{ $salutation }} @else 来自,<br>{{ config('app.name') }} @endif <!-- Subcopy --> @if (isset($actionText)) @component('mail::subcopy') 如果您不能点击"{{ $actionText }}"按钮,请复制下面的网址粘贴到您的浏览器: [{{ $actionUrl }}]({{ $actionUrl }}) @endcomponent @endif @endcomponent
laravel常用命令
//执行迁移 php artisan migrate //数据回滚 php artisan migrate:rollback //webpack生产 npm run production //发布webpack npm run dev //重建节点 npm rebuild node-sass //创建新表 php artisan make:migration create_表名_table --create=表名 //填充数据 php artisan db:seed //添加字段 php artisan make:migration add_添加信息_to_表名_table --table=表名 //创建控制器 php artisan make:controller 控制器复数Controller --resource //创建模块 php artisan make:model 模块 -m //创建视图 php artisan generate:view 文件夹.视图 //创建控制器模块数据库增删改查文件 php artisan generate:resource 表名 //查看路由 php artisan route //自动加载 composer dumpautoload //重置key php artisan key:generate
cvim常用快捷键
h、j、k、l:上、下、左、右
u、d:上半屏、下半屏
H、L:后退、前进
f、F:直接打开、后台打开
o、t:当前打开网址、标签打开网址
gg、G:页头、页尾
gi、gI:第一个输入框、最后一个输入框
q、Q:鼠标hover事件、取消覆盖事件
x、X:关闭、打开上一次关闭
r:刷新
gd、ge:下载页面、扩展页面
0、$:行首、行尾
<、>:左移标签、右移标签
g0、g$:第一个标签、最后一个标签
gx$、gx0:关闭当前标签右、左所有标签
gxt、gxT:关闭当前标签右、左一个标签
commend+1、2345678:条转数字标签、9最后一个标签
ctrl+i、e:文本框行首、行尾
ctrl+u、o:删除当前光标到行首、行尾
/:查找、n下一个、N上一个、v选择模式
linux debain 用户配置
中文
apt-get install locales dpkg-reconfigure locales 勾选“en_US.UTF-8”和“zh_CN.UTF-8” apt-get install xfonts-intl-chinese 重启
w3m
apt-get install w3m-img zhcon H 显示帮助 q 退出,会有提示的 j,k,l,h 移动光标,就像vim中一样 J/K 向下/向上滚屏 </> 左右滚屏 Enter 输入 T 打开一个新标签页 Esc-t 打开所有标签页,供你选择,使用jk来上下移动 {/} 在标签页中切换 U 输入新的网址 B 后退 Ctrl+q 关闭当前标签页 / 向后查找当前页 ? 向前查找当前页