promise1.promise是解决异步的一种方案,也就是让promise帮我们去处理异步,最终promise会返回异步处理的结果。2.有了promise之后,让异步处理更加灵活,还能够解决之前的回调地狱的问题。promise的使用我们需要用promise帮我们处理异步vara=newPromise(function(resolve.reject){//在这里来进行真正的异步处理setTimeo
分类:
其他好文 时间:
2020-08-13 12:01:29
阅读次数:
53
class Work extends Model { protected $table='work'; protected $connection='zwhl'; public function follow(){ return $this->hasMany('WorkFollow','work_i ...
分类:
其他好文 时间:
2020-08-13 11:50:42
阅读次数:
55
错误 解决 导入import functools 在你写的装饰器里面将函数通过 @functools.wraps(执行函数名)装饰一下 ...
分类:
移动开发 时间:
2020-08-13 11:49:17
阅读次数:
73
beforeEnter: function(el) { // 通过绝对定位,小球css的top和left值一直都是固定的 //不管怎么滚动,小球的x y坐标固定 el.style.transform = "translate(0,0)"; }, enter: function(el, done) { ...
分类:
其他好文 时间:
2020-08-12 15:52:47
阅读次数:
66
var timer = setInterval(function () { if (countdown <= 0) { clearInterval(timer); $("#yzmdm").css('display','none'); $("#validationCode").css('display ...
分类:
其他好文 时间:
2020-08-11 17:29:35
阅读次数:
58
模块化第二种规范 AMD 说明 专门用于浏览器端,模块的加载时异步的 基本语法 定义暴露模块 //定义没有依赖的模块 define(functioin(){ return 模块 }) //定义有依赖的模块 define(['module1','module2'],function(){ return ...
分类:
Web程序 时间:
2020-08-11 15:49:21
阅读次数:
65
1.方式一 //登录 public function login(){ $config=config('ding'); $app = new Application($config); $response = $app->oauth->use('app-01')->withQrConnect()-> ...
分类:
其他好文 时间:
2020-08-11 09:22:31
阅读次数:
71
//发送工作通知消息 public function asyncsend(){ $config=config('ding'); $app = new Application($config); $params=[ 'agent_id'=>'849101807', 'userid_list'=>'31 ...
分类:
其他好文 时间:
2020-08-11 09:16:10
阅读次数:
209
hex2Rgb(hex) { //十六进制转为RGB var rgb = [] // 定义rgb数组 if (/^\#[0-9A-F]{3}$/i.test(hex)) { //判断传入是否为#三位十六进制数 let sixHex = '#' hex.replace(/[0-9A-F]/gi, fu ...
分类:
其他好文 时间:
2020-08-10 21:02:05
阅读次数:
72
断言:用于判断接口请求是否成功! 最少两个: 状态断言:200 业务断言:可以有多个。 //状态断言: //断言状态码为200 pm.test("Status code is 200", function () { pm.response.to.have.status(200); }); //业务断 ...
分类:
其他好文 时间:
2020-08-10 11:04:20
阅读次数:
68