类的方法也具有public,protected 以及 private 的访问控制。 访问控制的关键字代表的意义为: public:公开的 protected:受保护的 private:私有的 我们可以这样定义方法: class Car { public function getName() { re ...
分类:
Web程序 时间:
2020-07-11 09:47:42
阅读次数:
92
AddDbContext 是单例模式的作用域,需要通过 using (var scope = _scopeFactory.CreateScope()) //剔除单例模式的Context问题。 { var wallContext = scope.ServiceProvider.GetRequiredS ...
分类:
数据库 时间:
2020-07-11 09:27:06
阅读次数:
190
引言:运行qt程序涉及到信号槽出现的错误。 1、error: 'connect' was not declared in this scope 原因: 有可能是类中使用了信号槽,却未引入信号与槽的基类QObject 解决方法一: 将connect换成QObject::connect(注意:要在类中加 ...
分类:
其他好文 时间:
2020-07-10 21:13:02
阅读次数:
56
$url = $this->film_model . $user['shop_id'] . "/code_img/"; //判断是否存在 if(!$this->isDirFile($url)){ mkdir ($url,0777,true); } //判断文件或者目录是否存在 protected f ...
分类:
Web程序 时间:
2020-07-10 19:23:40
阅读次数:
87
1、基本配置 webpack.common.js const path = require('path') const HtmlWebpackPlugin = require('html-webpack-plugin') const { srcPath, distPath } = require(' ...
分类:
Web程序 时间:
2020-07-10 11:36:07
阅读次数:
104
pytest-repeat是pytest的插件:(pytest-repeat 无法支持使用unittest.TestCase测试类) 作用:用于重复执行单个用例,或多个测试用例,并指定重复次数,安装:pip install pytest-repeat使用:--count命令,指定要运行测试用例和测试 ...
分类:
其他好文 时间:
2020-07-08 23:02:53
阅读次数:
110
@EnableWebSecurity public class seccurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Ex ...
分类:
编程语言 时间:
2020-07-08 20:07:45
阅读次数:
48
laravel 关联模型 多态关系 一对一(多态) note 1个关联上从属于多个模型,如:博客post和用户user共享1个关联图片image。 1篇博客拥有1张主图 1个用户拥有1个头像 graph LR image(图片) image --> |imageable_id=post.id<br> ...
分类:
其他好文 时间:
2020-07-08 19:57:33
阅读次数:
52
==打开保护模式== protected-mode yes ==修改默认6379端口== port 8793 ==禁用或者重命名危险命== 修改 redis.conf 文件,添加 rename-command FLUSHALL "" rename-command FLUSHDB "" rename- ...
分类:
其他好文 时间:
2020-07-08 19:38:11
阅读次数:
126
####一、前言 fixture里面有个scope参数可以控制fixture的作用范围: session > module > class > function ####二、fixture作用范围 function:每一个函数或方法都会调用 class:每一个类调用一次,一个类可以有多个方法 mod ...
分类:
其他好文 时间:
2020-07-08 01:30:36
阅读次数:
63