首页
更多应用
Search
1
修改iview的标签为i-的形式而不是驼峰的形式
3,148 阅读
2
PHP微信和企业微信签名
2,881 阅读
3
在VUE中怎么全局引入sass文件
2,522 阅读
4
解决Macos下storm系列IDE卡顿的问题
2,231 阅读
5
vscode硬件占用较高解决方案
2,185 阅读
默认分类
JS
VUE
CSS
mac使用技巧
React
fastmock
登录
/
注册
Search
标签搜索
react
js
vue
vscode
nodejs
项目
代码
webpack
工具
nginx
小程序
css
fastmock
eslint
npm
http
vue-cli3
git
浏览器
const
fastmock技术社区
累计撰写
105
篇文章
累计收到
26
条评论
首页
栏目
默认分类
JS
VUE
CSS
mac使用技巧
React
fastmock
页面
更多应用
搜索到
59
篇与
的结果
2018-12-29
Linux环境下Nginx详细安装部署教程
一、Nginx简介Nginx是一个web服务器也可以用来做负载均衡及反向代理使用,目前使用最多的就是负载均衡,具体简介我就不介绍了百度一下有很多,下面直接进入安装步骤二、Nginx安装1、下载Nginx及相关组件(我的软件目录为/software)[root@localhost software]# wget http://nginx.org/download/nginx-1.10.2.tar.gz 省略安装内容... [root@localhost software]# wget http://www.openssl.org/source/openssl-fips-2.0.10.tar.gz 省略安装内容... [root@localhost software]# wget http://zlib.net/zlib-1.2.11.tar.gz 省略安装内容... [root@localhost software]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz 省略安装内容...安装c++编译环境,如已安装可略过[root@localhost software]# yum install gcc-c++ 省略安装内容... 期间会有确认提示输入y回车 Is this ok [y/N]:y 省略安装内容...2、安装Nginx及相关组件openssl安装[root@localhost software]# tar zxvf openssl-fips-2.0.10.tar.gz 省略安装内容... [root@localhost software]# cd openssl-fips-2.0.10 [root@localhost openssl-fips-2.0.10]# ./config && make && make install 省略安装内容...pcre安装[root@localhost software]# tar zxvf pcre-8.40.tar.gz 省略安装内容... [root@localhost software]# cd pcre-8.40 [root@localhost pcre-8.40]# ./configure && make && make install 省略安装内容...zlib安装[root@localhost software]# tar zxvf zlib-1.2.11.tar.gz 省略安装内容... [root@localhost software]# cd zlib-1.2.11 [root@localhost zlib-1.2.11]# ./configure && make && make install 省略安装内容...nginx安装[root@localhost software]# tar zxvf nginx-1.10.2.tar.gz 省略安装内容... [root@localhost software]# cd nginx-1.10.2 [root@localhost nginx-1.10.2]# ./configure && make && make install 省略安装内容...3、启动Nginx先找一下nginx安装到什么位置上了whereis nginx进入nginx目录并启动(启动指令为nginx)如果报如下错误“error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory,”按照下面方式解决1.用whereis libpcre.so.1命令找到libpcre.so.1在哪里 2.用ln -s /usr/local/lib/libpcre.so.1 /lib64命令做个软连接就可以了 3.用sbin/nginx启动Nginx 4.用ps -aux | grep nginx查看状态 [root@localhost nginx]# whereis libpcre.so.1 [root@localhost nginx]# ln -s /usr/local/lib/libpcre.so.1 /lib64 [root@localhost nginx]# sbin/nginx [root@localhost nginx]# ps -aux | grep nginx 进入Linux系统的图形界面,打开浏览器输入localhost会看到下图,说明nginx启动成功Welcome to nginx!If you see this page, the nginx web server is successfully installed and working. Further configuration is required.For online documentation and support please refer to nginx.org.Commercial support is available at nginx.com.Thank you for using nginx.nginx 基本操作启动 [root@localhost ~]# /usr/local/nginx/sbin/nginx 停止/重启 [root@localhost ~]# /usr/local/nginx/sbin/nginx -s stop(quit、reload) 命令帮助 [root@localhost ~]# /usr/local/nginx/sbin/nginx -h 验证配置文件 [root@localhost ~]# /usr/local/nginx/sbin/nginx -t 配置文件 [root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf本文转载自https://www.cnblogs.com/taiyonghai/p/6728707.html
2018年12月29日
819 阅读
0 评论
0 点赞
2018-12-28
linux常用指令备忘
为node全局包(如:cnpm创建环境变量)$ sudo ln -s /usr/local/nodejs/bin/cnpm /usr/local/bin/ // 假设nodejs的安装目录为/usr/local/nodejs停止node服务ps -ef|grep node 找到node服务的进程信息root 3370 2822 0 16:21 pts/0 00:00:00 grep nodekill 3370 终止进程node后台启动nohup npm start& 通过这种方式启动,会在项目根目录生成nohup.out文件(如果本来不存在)并且跳出服务监控,服务的日志文件会写到nohup.out文件中forever工具,通过npm install -g forever安装。使用方法参考 https://www.npmjs.com/package/forever[1]: https://www.npmjs.com/package/forever
2018年12月28日
930 阅读
0 评论
0 点赞
2018-10-30
小程序中生成二维码和条形码
使用wxbarcode模块可以很方便地生成二维码和条形码。效果安装$ npm install wxbarcode使用方法import wxbarcode from 'wxbarcode' wxbarcode.barcode('barcode', '1234567890123456789', 680, 200); wxbarcode.qrcode('qrcode', '1234567890123456789', 420, 420);条形码函数名:barcode函数原型:barcode(id, code, width, height)参数:id: wxml文件中的 Canvas IDcode: 用于生成条形码的字符串width: 生成的条形码宽度,单位 rpxheight: 生成的条形码高度,单位 rpx二维码函数名:qrcode函数原型:qrcode(id, code, width, height)参数:id: wxml文件中的 Canvas IDcode: 用于生成二维码的字符串width: 生成的二维码宽度,单位 rpxheight: 生成的二维码高度,单位 rpx小程序案例// 页面所在的js文件 import wxbarcode from '../../utils/qrcode/index.js'; // ... wxbarcode.barcode('barcode', res.data.voucher_info.closure_code, 680, 150); wxbarcode.qrcode('qrcode', res.data.voucher_info.closure_code, 340, 340);// wxml文件 <view class='barcode'> <canvas canvas-id="barcode"></canvas> </view> <view class='qrcode'> <!-- <image src='/assets/images/qrcode.png'></image> --> <canvas canvas-id="qrcode"></canvas> </view>本地wxbarcode目录结构(从github download下来的目录结构)
2018年10月30日
1,516 阅读
0 评论
0 点赞
2018-10-24
HTML特殊字符编码对照表
HTML特殊字符编码对照表 特殊符号 命名实体 十进制编码 特殊符号 命名实体 十进制编码 特殊符号 命名实体 十进制编码 Α Α Α Β Β Β Γ Γ Γ Δ Δ Δ Ε Ε Ε Ζ Ζ Ζ ΗΗ Η Θ Θ Θ Ι Ι Ι Κ Κ Κ Λ Λ Λ Μ Μ Μ Ν Ν Ν Ξ Ξ Ξ Ο Ο Ο Π Π Π Ρ Ρ Ρ Σ Σ Σ Τ Τ Τ Υ Υ Υ Φ Φ Φ Χ Χ Χ Ψ Ψ Ψ Ω Ω Ω α α α β β β γ γ γ δ δ δ ε ε ε ζ ζ ζ η η η θ θ θ ι ι ι κ κ κ λ λ λ μ μ μ ν ν ν ξ ξ ξ ο ο ο π π π ρ ρ ρ ς ς ς σ σ σ τ τ τ υ υ υ φ φ φ χ χ χ ψ ψ ψ ω ω ω ϑ ϑ ϑ ϒ ϒ ϒ ϖ ϖ ϖ • • • … … … ′ ′ ′ ″ ″ ″ ‾ ‾ ‾ ⁄ ⁄ ⁄ ℘ ℘ ℘ ℑ ℑ ℑ ℜ ℜ ℜ ™ ™ ™ ℵ ℵ ℵ ← ← ← ↑ ↑ ↑ → → → ↓ ↓ ↓ ↔ ↔ ↔ ↵ ↵ ↵ ⇐ ⇐ ⇐ ⇑ ⇑ ⇑ ⇒ ⇒ ⇒ ⇓ ⇓ ⇓ ⇔ ⇔ ⇔ ∀ ∀ ∀ ∂ ∂ ∂ ∃ ∃ ∃ ∅ ∅ ∅ ∇ ∇ ∇ ∈ ∈ ∈ ∉ ∉ ∉ ∋ ∋ ∋ ∏ ∏ ∏ ∑ ∑ − − − − ∗ ∗ ∗ √ √ √ ∝ ∝ ∝ ∞ ∞ ∞ ∠ ∠ ∠ ∧ ∧ ⊥ ∨ ∨ ⊦ ∩ ∩ ∩ ∪ ∪ ∪ ∫ ∫ ∫ ∴ ∴ ∴ ∼ ∼ ∼ ≅ ≅ ≅ ≈ ≈ ≅ ≠ ≠ ≠ ≡ ≡ ≡ ≤ ≤ ≤ ≥ ≥ ≥ ⊂ ⊂ ⊂ ⊃ ⊃ ⊃ ⊄ ⊄ ⊄ ⊆ ⊆ ⊆ ⊇ ⊇ ⊇ ⊕ ⊕ ⊕ ⊗ ⊗ ⊗ ⊥ ⊥ ⊥ ⋅ ⋅ ⋅ ⌈ ⌈ ⌈ ⌉ ⌉ ⌉ ⌊ ⌊ ⌊ ⌋ ⌋ ⌋ ◊ ◊ ◊ ♠ ♠ ♠ ♣ ♣ ♣ ♥ ♥ ♥ ♦ ♦ ♦   ¡ ¡ ¡ ¢ ¢ ¢ £ £ £ ¤ ¤ ¤ ¥ ¥ ¥ ¦ ¦ ¦ § § § ¨ ¨ ¨ © © © ª ª ª « « « ¬ ¬ ¬ ­ ­ ® ® ® ¯ ¯ ¯ ° ° ° ± ± ± ² ² ² ³ ³ ³ ´ ´ ´ µ µ µ " " " < < < > > > ' '
2018年10月24日
1,040 阅读
0 评论
0 点赞
2018-08-09
windows下删除node_modules目录的方法
在用npm管理依赖包的项目中,npm会为我们拉取大量的npm包到本地,有时候因为某些依赖出现问题需要重新拉取依赖,或者说我们干脆想删掉整个项目,就会出现node_module下的某些目录或者文件无法删除的情况,这是因为windows环境下删除文件时如果文件名过长或者文件夹名过长导致的,要想删除这些文件,我们可以使用一个npm包,他叫rimraf,使用方法如下:全局安装rimrafnpm install -g rimraf在项目根目录下执行命令 rimraf node_modules 当然,如果你知道node_modules的详细路径,也不用非得进到项目目录下执行当前命令这个工具不只是可以删除node_modules 如果你需要删除其他因为文件过多或者文件名过长的文件或目录,也可以用这个工具删除,当然,前提条件是你的电脑安装了nodejs环境。其实他就是linux系统下的 rm -rf 指令 rm指令删除文件或者目录,参数说明:-r 向下递归,不管有多少级目录,一并删除 -f 直接强行删除,没有任何提示
2018年08月09日
998 阅读
0 评论
0 点赞
2018-04-19
PHP微信和企业微信签名
签名算法签名生成规则如下:参与签名的参数有四个: noncestr(随机字符串), jsapi_ticket, timestamp(时间戳), url(当前网页的URL,不包含#及其后面部分)将这些参数使用URL键值对的格式 (即 key1=value1&key2=value2…)拼接成字符串string1。有两个注意点:1. 字段值采用原始值,不要进行URL转义;2. 必须严格按照如下格式拼接,不可变动字段顺序。(以上内容摘自企业微信开发文档)具体实现代码如下:index.php<? // 设置跨域请求头 header("Access-Control-Allow-Origin: *"); header('Access-Control-Allow-Headers: X-Requested-With,X_Requested_With'); include_once('Http.php'); // 如果存在缓存文件,用缓存文件中的信息初始化签名数据 $cacheData = array(); if (file_exists('cache.php')) { $cacheData = include_once('cache.php'); // 判断缓存信息是否过期,如果过期删除缓存文件,并将data重置 if (time() - $cacheData['timestamp']/1 >= 7200) { unlink('cache.php'); $cacheData = array(); } } // 企业号信息 $corpId = 'XXXXXXXXXXXXXXXXXX'; $agentId = 'XXXXXXX'; $secret = 'XXXXXXXXXXXXXXXXXXXXX'; $getTokenUrl = 'https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid='.$corpId.'&corpsecret='.$secret; $getTicketUrl = 'https://qyapi.weixin.qq.com/cgi-bin/get_jsapi_ticket?access_token='; // 生成nonce_str的方法--参数:生成的长度 function randomkeys($length) { $returnStr=''; $pattern = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; for($i = 0; $i < $length; $i ++) { $returnStr .= $pattern {mt_rand ( 0, 61 )}; } return $returnStr; } // 如果缓存文件中已经存在token if (isset($cacheData['access_token'])) { $token = $cacheData['access_token']; $onceStr = $cacheData['nonce_str']; $timeStamp = $cacheData['timestamp']; } else { $onceStr = randomkeys(16); $timeStamp = time(); // 请求微信接口获取access_token $data = json_decode(send_post($getTokenUrl, array()), true); $token = $data['access_token']; } $getTicketUrl = $getTicketUrl.$token; // 如果缓存文件中已经存在ticket $ticket = ''; if (isset($cacheData['access_token'])) { $ticket = $cacheData['jsapi_ticket']; } else { // 请求微信接口获取ticket $jsTicketRes = json_decode(send_post($getTicketUrl, array()), true); if ($jsTicketRes['errcode'] == 0) { $ticket = $jsTicketRes['ticket']; } } // 缓存ticket和accessToken的配置信息 $cacheData = array( 'jsapi_ticket' => $ticket, 'access_token' => $token, 'nonce_str' => $onceStr, 'timestamp' => $timeStamp ); // 签名的参数信息--参数的key值必须要按照ASCII码排序 $cacheParams = 'jsapi_ticket='.$ticket.'&noncestr='.$onceStr.'×tamp='.$timeStamp.'&url='.urldecode($_POST['signUrl']); // 生成签名的函数--php自带shal算法函数,直接调用即可 function makeSignature($args){ return sha1($args); } // 如果不存在缓存文件,则缓存, 否则不缓存 if (!file_exists('cache.php')) { $path = 'cache.php'; $str = '<?php return '; $str .= var_export($cacheData,true);//数组转字符串 $str .= ';'; file_put_contents($path,$str); } // 生成签名 $signature = makeSignature($cacheParams, $onceStr); // 返回签名信息 echo json_encode(array( 'signature' => $signature, 'timestamp' => $timeStamp, 'onceStr' => $onceStr )); ?> Http.php (http请求工具函数)<? /** * 发送post请求 * @param string $url 请求地址 * @param array $post_data post键值对数据 * @return string */ function send_post($url, $post_data, $type = 'GET') { $postdata = http_build_query($post_data); $options = array( 'http' => array( 'method' => $type, 'header' => 'Content-type:text/json', 'content' => $postdata, 'timeout' => 15 * 60 // 超时时间(单位:s) ) ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); return $result; } ?> cache.php(生成的access_token和ticket缓存文件)<?php return array ( 'jsapi_ticket' => 'HoagFKDcsGMVCIY2vOjf9i-5XABPegggM0ZkCdJVgMv_WFPkNNg94gBf3pfJ4E8ohxc4b5eXSYEjuq41TYtclA', 'access_token' => 'Kzz-XRg8MEdT3-CbQWcp4f_1VOIFhM-dpvGWUDHuIIYXRhnjF5Pa4F8apWZ7oBjgzS2kruL6LZjayiIx3yS1cr0oUlI1PqiFF9UZ9SlZLwem9JzHlWD02eqAWOTYlEd3JZk0o39D3TuKcn_XHBd4jFl9TCuVEqwe7KtHRheil61LXewtDwClaLznhWykJNYJbaSfpy0-pRmnTb6iwwHoyA', 'nonce_str' => 'CTjKeEp5nwskvgqn', 'timestamp' => 1524100235, );
2018年04月19日
2,881 阅读
4 评论
0 点赞
2017-12-20
修改iview的标签为i-的形式而不是驼峰的形式
前言iview组件库中,通过Vue.use注册了iview到项目中后,在组件内调用iview组件时默认都是通过CamelCase的方式引用iview组件的,HTML本身是大小写不敏感的,vue官网也推荐在template中使用kebab-case标签,iview官网也提供了修改的方法,具体操作如下:首先通过 npm 安装 iview-loadernpm install iview-loader --save-dev配置 webpack(build目录下的webpack.base.conf.js文件),改写平时 vue-loader 的配置,形如:module: { rules: [ { test: /\.vue$/, use: [ { loader: 'vue-loader', options: { } }, { loader: 'iview-loader', options: { prefix: false } } ] } ] }参数 prefix 设置为 true 后,所有 iView 组件标签名都可以使用前缀 i-,例如 、完整的标签名如下:{ 'i-affix': 'Affix', 'i-alert': 'Alert', 'i-auto-complete': 'AutoComplete', 'i-avatar': 'Avatar', 'i-back-top': 'BackTop', 'i-badge': 'Badge', 'i-breadcrumb': 'Breadcrumb', 'i-breadcrumb-item': 'BreadcrumbItem', 'i-button': 'Button', 'i-button-group': 'ButtonGroup', 'i-card': 'Card', 'i-carousel': 'Carousel', 'i-carousel-item': 'CarouselItem', 'i-cascader': 'Cascader', 'i-checkbox': 'Checkbox', 'i-checkbox-group': 'CheckboxGroup', 'i-circle': 'i-circle', 'i-col': 'Col', 'i-collapse': 'Collapse', 'i-color-picker': 'ColorPicker', 'i-date-picker': 'DatePicker', 'i-dropdown': 'Dropdown', 'i-dropdown-item': 'DropdownItem', 'i-dropdown-menu': 'DropdownMenu', 'i-form': 'Form', 'i-form-item': 'FormItem', 'i-icon': 'Icon', 'i-input': 'Input', 'i-input-number': 'InputNumber', 'i-menu': 'Menu', 'i-menu-group': 'MenuGroup', 'i-menu-item': 'MenuItem', 'i-submenu': 'Submenu', 'i-modal': 'Modal', 'i-option': 'Option', 'i-option-group': 'OptionGroup', 'i-page': 'Page', 'i-panel': 'Panel', 'i-poptip': 'Poptip', 'i-progress': 'Progress', 'i-radio': 'Radio', 'i-radio-group': 'RadioGroup', 'i-rate': 'Rate', 'i-row': 'Row', 'i-select': 'Select', 'i-slider': 'Slider', 'i-spin': 'Spin', 'i-step': 'Step', 'i-steps': 'Steps', 'i-switch': 'i-switch', 'i-table': 'Table', 'i-tabs': 'Tabs', 'i-tab-pane': 'TabPane', 'i-tag': 'Tag', 'i-timeline': 'Timeline', 'i-timeline-item': 'TimelineItem', 'i-time-picker': 'TimePicker', 'i-tooltip': 'Tooltip', 'i-transfer': 'Transfer', 'i-tree': 'Tree', 'i-upload': 'Upload' }
2017年12月20日
3,148 阅读
3 评论
0 点赞
2017-11-08
Apache httpd.conf 配置文件语法验证
Apache 的 httpd.conf文件修改之后,必须重启服务器才能生效。有时服务器在提供服务的时候,直接更改配置,重启服务,会带来很大的危险性。比如下面这样的错误日志11:22:48 [Apache] Error: Apache shutdown unexpectedly. 11:22:48 [Apache] This may be due to a blocked port, missing dependencies, 11:22:48 [Apache] improper privileges, a crash, or a shutdown by another method. 11:22:48 [Apache] Press the Logs button to view error logs and check 11:22:48 [Apache] the Windows Event Viewer for more clues 11:22:48 [Apache] If you need more help, copy and post this 11:22:48 [Apache] entire log window on the forums咋一看 以为是端口被占用,遇到这样的问题,我们先查看端口占用情况1,开始—->运行—->cmd,或者是window+R组合键,调出命令窗口,2,输入命令:netstat -ano,列出所有端口的情况。在列表中我们观察“本地地址”那一列被占用的端口如果通过以上方法发现我们的端口没有被占用,那多半是我们的Apache配置文件出错了,那么我们需要一种方法,可以检测我们的Apache配置文件有没有语法错误。如果能在修改配置之后,先验证语法正确与否,再重启服务器,则能避免一些不必要的错误。对以上需求,Apache本身提供了相应的命令来验证配置文件的语法。Windows环境的命令:httpd -t (注:如果您的电脑没有未Apache配置环境变量,需要进入到Apache目录的bin目录下执行该命令)Linux环境的命令:[root@server bin]# ./apachectl configtest如果正确无误,会显示Syntax OK信息Syntax OK如果存在错误,则会显示出错的行号以及错误信息,如下:AH00526: Syntax error on line 639 of D:/xampp/apache/conf/httpd.conf: <Directory> directive missing closing '>' AH00526: Syntax error on line 639 of D:/xampp/apache/conf/httpd.conf: <Directory> directive missing closing '>'
2017年11月08日
1,463 阅读
0 评论
0 点赞
2017-11-08
typecho 让注册的人直接可以发文章
让注册的人成为贡献者组修改文件 \var\Widget\Register.php 第 68 行:$dataStruct = array( 'name' => $this->request->name, 'mail' => $this->request->mail, 'screenName'=> $this->request->name, 'password' => $hasher->HashPassword($generatedPassword), 'created' => $this->options->gmtTime, 'group' => 'subscriber' );这个数组里面有个'group'应该就是了,将'subscriber'改成'contributor'就行了。让 “贡献者” 发帖直接通过无需审核方法参考:http://forum.typecho.org/viewtopic.php?f=4&t=7771修改 var/Widget/Contents/Post/Edit.php 的第 222 和 299 行(开发板在 223 和 230 行)将“editor”为“contributor”或者修改$contents['status'] = 'publish'; // 'waiting';把waiting改成publish即可。
2017年11月08日
1,344 阅读
0 评论
0 点赞
1
...
5
6