huangbinghe

Results 19 issues of huangbinghe

命令行执行交互操作时执行ask操作,返回值是null `$answer = $output->ask($input,'请输入答案');` 如果输入中文获取值是null

`test.py` ``` import fire def hello(name): print(name) print(name.get('a')) if __name__ == "__main__": fire.Fire(hello) ``` example: ``` python test.py '{"a":"aaa","b":[1,2,3]}' ``` the param `name` is json dict, result print: ``` {'a':'aaa','b':[1,2,3]}...

question

**svg image** [temp1629451352.8199928.svg.zip](https://github.com/deeplook/svglib/files/7029013/temp1629451352.8199928.svg.zip) **convert to pdf** [temp1629451352.8199928.pdf](https://github.com/deeplook/svglib/files/7029007/temp1629451352.8199928.pdf) **env:** win10 64bit python 3.7 64bit svglib 1.0.1 **demo:** ``` from svglib.svglib import svg2rlg from reportlab.graphics import renderPDF svg_file = 'temp1629451352.8199928.svg' pdf_file =...

增加 ThinkPHP6 单元测试 https://github.com/hbh112233abc/think-test

既然路由是针对应用的,那么在应用`admin`里开启路由 ``` \think\facade\Route::get('captcha/[:id]', "\\think\\captcha\\CaptchaController@index"); ``` 那么访问验证码的地址应该是`xxx.com/admin/captcha.html` 所以验证码helper.php的captcha_src中 ``` return Route::buildUrl('/captcha' . ($config ? "/{$config}" : '')); ``` 这里的路径是不是不能直接是`/captcha`呢? 建议针对多应用改进. 我现在改为: ``` return Route::buildUrl('./captcha' . ($config ? "/{$config}" : '')); ```...

![TIM截图20190618141501](https://user-images.githubusercontent.com/7788164/59657575-b73f0b80-91d3-11e9-834f-b7f0638e2166.png) 如上图所示,当图片宽度比较窄的时候,验证码字符能不能相对的排列在图片宽高之内?

vendor\topthink\think-captcha\src\Captcha.php 75行 ``` /** * 配置验证码 * @param string|null $config */ protected function configure(string $config = null): void { if (is_null($config)) { $config = $this->config->get('captcha', []); } else { $config...

mongo配置默认pk_convert_id=false 模型查询后 默认pk='id' 这样导致模型的save可能会更新多条数据 比如我有一个数据集 test 部分字段允许重复 比如title 定义了模型为`Test` 先查询一条数据,该条件下有多条数据,仅查第一条 ``` $data = Test::where('title','hello')->findOrEmpty(); ``` ``` db.test.find({title:"hello"}).limit(1) ``` 然后对数据进行了更新操作 ``` $data = Test::where('title','hello')->findOrEmpty(); $data->version = 2; $data->save(); ``` 本来以为仅更新了查询出来的那条数据,后来发现title=hello的都被修改了,看了一下sql日志发现更新条件和查询条件是一样的 ```...

``` $file = \app\common\mongo\FileInfo::where('fileid',$fileId)->find(); $file['update_time'] = date('Y-m-d H:m:s'); $file->save(); ``` 报错了 ``` topthink/think-orm/db/connector/Mongo.php line 383 Transaction numbers are only allowed on a replica set member or mongos ``` 我的mongo版本是3.6,就一个mongo库 请问遇到这问题该怎么解决呢

output example: ``` array:20 [▼ 0 => "file:///D:/www/tp6/public//images/test7.jpg (format: QR_CODE, type: ADDRESSBOOK):" 1 => "Raw result:" 2 => "BEGIN:VCARD" 3 => "VERSION:3.0" 4 => "FN:huang" 5 => "TEL:13913942792" 6 =>...