自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Adapter适配器模式,以jquery为例

(function() { 'use strict' var $ = window.jQuery var Waypoint = window.Waypoint function JQueryAdapter(element) { this.$element = $(element) } $.each([ 'innerHeight', 'innerWidth', 'off', 'offset', 'on', 'outerHei

2021-11-01 15:36:00 366

原创 tp验证码

在服务层通过info方法查询有没有缓存然后查询数据库里有没有,返回一个关键字 到控制层。控制层根据关键字(是否开启验证码)来调用utils来创建验证码信息返回给前端。登录的时候需要check验证码。...

2021-09-06 11:15:19 104

转载 vue_多语言

https://blog.csdn.net/Dream_xun/article/details/82743762

2021-08-31 17:40:58 78

原创 上传图片,视频到七牛云

需要用到的参数:1、AccessKey (在“个人中心”–>“秘钥管理”中)2、SecretKey (在“个人中心”–>“秘钥管理”中)3、存储空间名字(自己创建的)参考官方文档。

2021-08-30 11:39:09 78

原创 2021-07-19

1.http请求方法2.获取版本号plus.runtime.appid3.请求服务端版本号4.获取服务端版本号http请求方法2.获取版本号plus.runtime.appid3.请求服务端版本号4.获取服务端版本号http请求方法2.获取版本号plus.runtime.appid3.请求服务端版本号4.获取服务端版本号http.get5.从服务端下载包plus.downloader.createDownload6.plus.runtime.install7.文件默认export方法获取应用版

2021-07-19 14:56:07 57 1

转载 PhpSpreadsheet的简单使用

composer require phpoffice/phpspreadsheet/** * excel文件导出 */function export(){ require_once __DIR__ . '/vendor/autoload.php'; $data = [ ['title1' => '111', 'title2' => '222'], ['title1' => '111', 'title2' => '222']

2021-07-06 15:21:19 186

原创 通过使用路由meta.roles判断当前用户是否具有权限 permission

function hasPermission(roles, route) { if (route.meta && route.meta.roles) { return roles.some(role => route.meta.roles.includes(role)) } else { return true }}递归路由表export function filterAsyncRoutes(routes, roles) { const res

2021-05-31 11:31:00 10619 2

原创 uni-app界面相关API

uni.showTotast显示消息提示框uni.hideToastshowmodeshowActionsheet从底部向上弹出,可以指定宽高区域可以有按钮数组及文字2.设置导航条uni.onWindowResize(CALLBACK)窗口uni.offWindowResize(CALLBACK)uni.createSelectorQuery()节点信息const query = uni.createSelectorQuery().in(this);query.select('#

2021-05-27 14:10:49 294

原创 computed

component() { // 全部加载 if (this.type === 'all') { return categoryAll } // 懒加载 if (this.type === 'lazy') { return categoryLazy } return 'div' }

2021-05-27 10:37:54 43

原创 filters

filters: { getPreviewUrl(val) { if (Array.isArray(val) && val.length > 0) { if (val[0].source) { return util.getImageCodeUrl(val[0].source, 'goods_image_x80') } } return '' }, getNumber(v.

2021-05-27 10:37:24 39

原创 vuex使用

// 记录和显示错误function errorLog(error) { if (util.cookies.get('block') === 'true') { return } // 添加到日志 store.dispatch('careyshop/log/push', { type: 'danger', info: '数据请求异常', message: error.message, meta: { error } }) // 打印到控制

2021-05-27 10:36:56 42

转载 函数currying

// 普通的add函数function add(x, y) { return x + y}// Currying后function curryingAdd(x) { return function (y) { return x + y }}add(1, 2) // 3curryingAdd(1)(2) // 3实际上就是把add函数的x,y两个参数变成了先用一个函数接收x然后返回一个函数去处理y参数。现在思路应该就比较清晰

2021-05-27 10:36:10 53

原创 2021-05-25

<view class="content b-t"> <view class="list b-b" v-for="(item, index) in addressList" :key="index" @click="checkAddress(item)"> <view class="wrapper"> <view class="address-box"> <text v-if="item.default" class="tag

2021-05-25 14:48:53 211

原创 window.requestAnimationFrame

window.requestAnimationFrame() 告诉浏览器——你希望执行一个动画,并且要求浏览器在下次重绘之前调用指定的回调函数更新动画。该方法需要传入一个回调函数作为参数,该回调函数会在浏览器下一次重绘之前执行requestAnimationFrame...

2021-04-30 17:53:02 129 1

原创 call apply bind

call 等可以使用在生命周期外面时// 外面function handleMaker(wait) { return throttle(e => { this.$emit('scroll', { x: e.target.scrollLeft, y: e.target.scrollTop }) }, wait)}//里面 methods: { // 增加滚动事件监听 addScrollListener() { //

2021-04-30 16:24:44 70 1

原创 tagsview

const mutations = {ADD_VISITED_VIEW: (state, view) => {if (state.visitedViews.some(v => v.path === view.path)) returnstate.visitedViews.push(Object.assign({}, view, {title: view.meta.title || ‘no-name’}))},点击时监听路有对象然后存储到vuex里...

2021-03-11 13:57:10 171

原创 管理系统权限的问题

1.根据角色权限来设置用户可以访问的接口。最高权限可以添加菜单,获取用户信息,修改信息等等。正常的操作后台的用户可以看业务相关的菜单。2.当前端登录时判断用户角色权限,如果没有这个权限则根据访问路径来返回“你没有此权限”。前端配置菜单也应该根据路由的meta来进行设置那些需要验证才可以进行访问。3.登录流程大概是根据用户信息和验证码,发送到服务器,服务器验证根据用户信息生成用户id和token,然后前端存储token。用户id和token放置在请求头中,后端根据请求路径和token来判断用户和tok

2021-03-10 17:28:28 394

原创 jquery方法

eachmapattrprop事件绑定与解绑bind unbindscrolltop事件冒泡和默认行为event.stopPropagation();event.preventDefault()

2021-03-06 15:23:58 40

原创 数据请求类写法

新建一个class构造函数传参数,写post.get等方法,然后写一个请求函数在post等里面调用。在这个request请求方法里做请求拦截的验证。

2021-03-06 15:20:01 99

原创 小程序登录session_key非跳转版

1.setAuthStatus()wx.getSetting()判断用户是否给了权限。没有就弹出弹框,有就隐藏弹框判断app.globalData.token有就触发父组件that.triggerEvent(‘onLoadFun’, app.globalData.token)没有就出现登陆加载然后调用 that.getUserInfoBydecryptCode();2.setUserInfo()没有授权调用login获取session_key(wx.checkSession先从缓存中查找,没有通过wx

2021-03-03 13:37:52 69

原创 请求路径组装方法

参数:url,param判断param是否为对象通过for in来获取键和值,使用json.stringify并使用‘=’,‘&’连接。然后去掉最后一个&,使用substr(0,pstr.length-1)最后拼接上“?”。

2021-03-01 17:14:42 107

原创 tp5笔记

设置根目录为public时访问路径要加上index.php.首页设置为public/index.php

2021-03-01 09:55:13 62

原创 vue答题插件

1.分析数据结构return [ { id:1, type:'radio', number:1, title:'1生物大灭绝是指大规模的集群灭绝,生物灭绝又叫生物绝种。历史上一共有几次大灭绝?', imageList:['https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&

2021-02-27 11:35:15 877

空空如也

空空如也

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

TA关注的人

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