微信收付通V3支付

2023-11-18

<?php

namespace app\common\lib\built;

use app\platform\model\PaymentConfig;

/**
 * 微信支付
 * Class WxPayment
 * @package app\common\lib\built
 */
class WxPayment
{
    protected $authorization = 'WECHATPAY2-SHA256-RSA2048';  //认证类型
    protected $method = "POST"; //请求方式
    protected $url; //请求链接
    protected $platform_id;   //平台id
    protected $mch_id;        //商户号
    protected $nonce_str;        //随机字符串
    protected $sign;        //签名
    protected $timestamp;   //时间
    protected $serial_no;        //商户Api证书序列号
    protected $apiclient_key;   //私钥地址
    protected $apiclient_cert;   //公钥地址
    protected $secret_key;   //V3密钥
    protected $token;        //Token
    protected $data;         //发送参数
    protected $response;    //返回信息
    protected $image_type;    //图片类型
    protected $boundary;      //边界符
    protected $suffix;      //图片后缀
    protected $openid;      //发放的openid
    protected $file;         //图片信息
    protected $platform_certificate; //平台证书地址
    protected $platform_serial_no; //平台证书序列号


    public function __construct($param)
    {
        if (!empty($param['platform_id'])) {
            $PaymentConfigModel = new PaymentConfig();
            $config = $PaymentConfigModel->getFind([
                'platform_id' => $param['platform_id']
            ]);
            if (empty($config)) {
                echo json_encode(callBack('error', 'param_error', '未配置支付参数'), JSON_UNESCAPED_UNICODE);
                die();
            }
            $this->mch_id = $config['wx_mchid'];
            $this->serial_no = $config['wx_serial_no'];
            $this->apiclient_key = $config['wx_apiclient_key'];
            $this->secret_key = $config['wx_secret_key'];
            $this->platform_certificate = $config['wx_platform_certificate'];
            $this->platform_serial_no = $config['wx_platform_serial_no'];
            $this->apiclient_cert = $config['wx_apiclient_cert'];
        } else {
            $this->mch_id = $param['mch_id'] ?? '';
            $this->serial_no = $param['serial_no'] ?? '';
            $this->apiclient_key = $param['apiclient_key'] ?? '';
            $this->secret_key = $param['secret_key'] ?? '';
            $this->platform_certificate = $param['platform_certificate'] ?? '';
            $this->platform_serial_no = $param['platform_serial_no'] ?? '';
            $this->apiclient_cert = $param['apiclient_cert'] ?? '';
        }
        $this->platform_id = $param['platform_id'] ?? '';
        $this->method = $param['method'] ?? $this->method;
        $this->data = $param['data'] ?? [];
        $this->image_type = $param['image_type'] ?? '';
        $this->boundary = $param['boundary'] ?? '';
        $this->openid = $param['openid'] ?? '';
        $this->file = $param['file'] ?? '';
    }


    //微信小程序发起退款请求
    public function appletLaunchCombineRefund()
    {
        $this->url = 'https://api.mch.weixin.qq.com/v3/ecommerce/refunds/apply';
        $result = $this->requestAction();
        return $result;
    }


    /**
     * 上传图片
     * @return bool|string
     */
    public function upload()
    {
        $this->url = 'https://api.mch.weixin.qq.com/v3/merchant/media/upload';
        $result = $this->uploadRequestAction();
        return $result;
    }


    /**
     * 图片上传请求
     * @return bool|string
     */
    public function uploadRequestAction()
    {
        if (!in_array('sha256WithRSAEncryption', \openssl_get_md_methods(true))) {
            throw new \RuntimeException("当前PHP环境不支持SHA256withRSA");
        }
        $headerParam = $this->uploadHeaderParam(); //获取头部信息
        $boundarystr = "--{$this->boundary}\r\n";// $out是post的内容
        $str = $boundarystr;
        $str .= 'Content-Disposition: form-data; name="meta"' . "\r\n";
        $str .= 'Content-Type: application/json' . "\r\n";
        $str .= "\r\n";
        $str .= json_encode($this->data['meta']) . "\r\n";
        $str .= $boundarystr;
        $str .= 'Content-Disposition: form-data; name="file"; filename="' . $this->data['meta']['filename'] . '"' . "\r\n";
        $str .= 'Content-Type: ' . $this->image_type . ";\r\n";
        $str .= "\r\n";
        $str .= $this->data['file'] . "\r\n";
        $str .= $boundarystr . "--\r\n";
        $ThirdClass = new ThirdRequest();
        $this->response = $ThirdClass->curlPost($this->url, $str, $headerParam);
        return $this->response;
    }


    /**
     * 图片上传头部参数
     * @return array
     */
    public function uploadHeaderParam()
    {
        $this->getUploadSign();        //生成签名
        $this->getToken();        //生成Token
        $header = [
            "Content-Type: multipart/form-data;name='meta'",
            "Content-Type: application/json",
            "User-Agent:" . $_SERVER['HTTP_USER_AGENT'],
            'Authorization: ' . $this->authorization . ' ' . $this->token,
            "Content-Type: multipart/form-data;boundary=" . $this->boundary
        ];
        return $header;
    }

    /**
     * 图片生成签名
     */
    protected function getUploadSign()
    {
        $url_parts = parse_url($this->url);  //链接
        $canonical_url = ($url_parts['path'] . (!empty($url_parts['query']) ? "?${url_parts['query']}" : ""));
        $this->timestamp = time();
        $this->nonce_str = randomStr(32); //随机字符串
        $message = $this->method . "\n" .
            $canonical_url . "\n" .
            $this->timestamp . "\n" .
            $this->nonce_str . "\n" .
            json_encode($this->data['meta']) . "\n";
        openssl_sign($message, $raw_sign, openssl_get_privatekey(file_get_contents($this->apiclient_key)), 'sha256WithRSAEncryption');
        $this->sign = base64_encode($raw_sign);
    }


    //微信小程序发起合单支付请求
    public function appletLaunchCombinePayment()
    {
        $this->url = 'https://api.mch.weixin.qq.com/v3/combine-transactions/jsapi';
        $result = $this->requestAction();
        return $result;
    }


    /**
     * 进件状态
     * @param $out_request_no 业务申请编号
     * @return bool|string
     */
    public function applymentsStatus($out_request_no)
    {
        $this->url = 'https://api.mch.weixin.qq.com/v3/ecommerce/applyments/out-request-no/' . $out_request_no;
        $this->data = [];
        $this->getSign();        //生成签名
        $this->getToken();        //生成Token
        $headerParam = [
            "Content-type: application/json;charset='utf-8'",
            "Accept:application/json",
            "User-Agent:" . $this->mch_id,
            'Authorization: ' . $this->authorization . ' ' . $this->token,
            'Wechatpay-Serial:' . $this->platform_serial_no
        ];
        $ThirdClass = new ThirdRequest();
        $this->response = $ThirdClass->curlGet($this->url, $headerParam);
        return $this->response;
    }


    //供应商进件
    public function applyments()
    {
        $this->url = 'https://api.mch.weixin.qq.com/v3/ecommerce/applyments/';
        $this->getSign();        //生成签名
        $this->getToken();        //生成Token
        $headerParam = [
            "Content-type: application/json;charset='utf-8'",
            "Accept:application/json",
            "User-Agent:*/*",
            'Authorization: ' . $this->authorization . ' ' . $this->token,
            'Wechatpay-Serial:' . $this->platform_serial_no
        ];
        $ThirdClass = new ThirdRequest();
        $this->response = $ThirdClass->curlPost($this->url, json_encode($this->data), $headerParam);
        return $this->response;
    }


    //对私银行列表
    public function personalBanking()
    {
        $this->url = 'https://api.mch.weixin.qq.com/v3/capital/capitallhh/banks/personal-banking?offset=' . $this->data['offset'] . '&limit=' . $this->data['limit'];
        $this->data = [];
        $headerParam = $this->getHeaderParam(); //获取头部信息
        $ThirdClass = new ThirdRequest();
        $this->response = $ThirdClass->curlGet($this->url, $headerParam);
        return $this->response;
    }


    //对公银行列表
    public function corporateBanking()
    {
        $this->url = 'https://api.mch.weixin.qq.com/v3/capital/capitallhh/banks/corporate-banking?offset=' . $this->data['offset'] . '&limit=' . $this->data['limit'];
        $this->data = [];
        $headerParam = $this->getHeaderParam(); //获取头部信息
        $ThirdClass = new ThirdRequest();
        $this->response = $ThirdClass->curlGet($this->url, $headerParam);
        return $this->response;
    }


    /**
     * 发送post请求
     * @return bool|string
     */
    protected function requestAction()
    {
        $headerParam = $this->getHeaderParam(); //获取头部信息
        $ThirdClass = new ThirdRequest();
        $this->response = $ThirdClass->curlPost($this->url, json_encode($this->data), $headerParam);
        return $this->response;
    }


    /**
     * 获取请求头部参数
     * @return array
     */
    protected function getHeaderParam()
    {
        $this->getSign();        //生成签名
        $this->getToken();        //生成Token
        $header = [
            "Content-type: application/json;charset='utf-8'",
            "Accept:application/json",
            "User-Agent:*/*",
            'Authorization: ' . $this->authorization . ' ' . $this->token,
        ];
        return $header;
    }


    /**
     * 生成签名
     */
    protected function getSign()
    {
        $url_parts = parse_url($this->url);  //链接
        $canonical_url = ($url_parts['path'] . (!empty($url_parts['query']) ? "?${url_parts['query']}" : ""));
        $this->timestamp = time();
        $this->nonce_str = randomStr(32); //随机字符串
        if (!empty($this->data)) {
            $message = $this->method . "\n" .
                $canonical_url . "\n" .
                $this->timestamp . "\n" .
                $this->nonce_str . "\n" .
                json_encode($this->data) . "\n";
        } else {
            $message = $this->method . "\n" .
                $canonical_url . "\n" .
                $this->timestamp . "\n" .
                $this->nonce_str . "\n" .
                '' . "\n";
        }
        openssl_sign($message, $raw_sign, openssl_get_privatekey(file_get_contents($this->apiclient_key)), 'sha256WithRSAEncryption');
        $this->sign = base64_encode($raw_sign);
    }


    /**
     * 生成Token
     * @return string
     */
    protected function getToken()
    {
        $this->token = sprintf('mchid="%s",nonce_str="%s",timestamp="%d",serial_no="%s",signature="%s"',
            $this->mch_id, $this->nonce_str, $this->timestamp, $this->serial_no, $this->sign);
    }


    /**
     * 回调验签
     * @param $platform_id 平台id
     * @param $timeStamp 时间戳
     * @param $nonce 随机字符串
     * @param $body 内同
     * @param $wx_sign 签名
     * @param $serial_no 回调返回的平台证书序列号
     * @return bool
     */
    public function checkSign($timeStamp, $nonce, $body, $wx_sign, $serial_no)
    {
        if (!$serial_no) {
            return false;
        }
        //证书序列号不一致获取新的证书
        if ($serial_no != $this->platform_serial_no) {
            $this->getCertificates();
        }
        $message = $timeStamp . "\n" .
            $nonce . "\n" .
            $body . "\n";
        $wx_sign = base64_decode($wx_sign);
        $platform_certificate = file_get_contents($this->platform_certificate);//平台证书
        $res = openssl_verify($message, $wx_sign, $platform_certificate, OPENSSL_ALGO_SHA256);
        if ($res == 1) {
            return true;
        }
        return false;
    }


    //获取平台证书
    public function getCertificates()
    {
        $this->method = 'GET';
        $this->url = 'https://api.mch.weixin.qq.com/v3/certificates';
        $this->getSign();        //生成签名
        $this->getToken();        //生成Token
        $headerParam = [
            "Content-type: application/json;charset='utf-8'",
            "Accept:application/json",
            "User-Agent:" . $this->mch_id,
            'Authorization: ' . $this->authorization . ' ' . $this->token,
        ];
        $ThirdClass = new ThirdRequest();
        $result = $ThirdClass->curlGet($this->url, $headerParam);
        $list = json_decode($result, true)['data'];
        //查询本地证书序列号
        $str = md5(randomStr(32));
        $file_path = '../certificate/payments/platform_certificate/' . $this->platform_id;
        $FileHandleClass = new FileHandle();
        $FileHandleClass->createDir($file_path, 2);
        $file_path = $file_path . '/' . $str . '.pem';
        $PaymentConfigModel = new PaymentConfig();
        foreach ($list as $val) {
            if ($this->platform_serial_no != $val['serial_no']) {
                $serial_no = $val['serial_no'];//获取的平台证书序列号
                $encrypt_certificate = $val['encrypt_certificate'];
                $result = $this->decryptResource($encrypt_certificate['ciphertext'], $encrypt_certificate['associated_data'], $encrypt_certificate['nonce']);
                if (empty($result)) {
                    return callBack('error', 'param_error', '解密失败');
                }
                $PaymentConfigModel->updateInfo([
                    ['id', '=', $this->platform_id]
                ], [
                    'wx_platform_serial_no' => $serial_no,
                    'wx_platform_certificate' => $file_path
                ]);
                file_put_contents($file_path, $result);//获取的文件临时保存到服务器
            }
        }
        return callBack('success', 'success', '获取平台证书成功');
    }


    //加密敏感字符串
    public function getEncrypts($str = "张三")
    {
        $public_key = file_get_contents($this->platform_certificate);
        $encrypted = '';
        if (openssl_public_encrypt($str, $encrypted, $public_key, OPENSSL_PKCS1_OAEP_PADDING)) {
            $sign = base64_encode($encrypted);
        } else {
            return false;
        }
        return $sign;//返回加密的敏感字符串
    }


    //解密敏感字符串
    public function decryptToString($str)
    {
        $encrypted = '';
        $public_key = file_get_contents($this->apiclient_key);
        openssl_private_decrypt(base64_decode($str), $encrypted, $public_key);
        return $encrypted;//返回解密的字符串
    }


    /**
     * 解密resource对象
     * @param $ciphertext 数据密文
     * @param $associated_data 附加数据
     * @param $nonce 随机串
     * @return false|mixed|string
     */
    public function decryptResource($ciphertext, $associated_data, $nonce)
    {
        if (strlen($this->secret_key) != 32) {
            return false;
        }
        $ciphertext = \base64_decode($ciphertext);
        if (strlen($ciphertext) <= 16) {
            return false;
        }
        // ext-sodium (default installed on >= PHP 7.2)
        if (function_exists('\sodium_crypto_aead_aes256gcm_is_available') && \sodium_crypto_aead_aes256gcm_is_available()) {
            return \sodium_crypto_aead_aes256gcm_decrypt($ciphertext, $associated_data, $nonce, $this->secret_key);
        }

        // ext-libsodium (need install libsodium-php 1.x via pecl)
        if (function_exists('\Sodium\crypto_aead_aes256gcm_is_available') &&
            \Sodium\crypto_aead_aes256gcm_is_available()) {
            return \Sodium\crypto_aead_aes256gcm_decrypt($ciphertext, $associated_data, $nonce, $this->secret_key);
        }

        // openssl (PHP >= 7.1 support AEAD)
        if (PHP_VERSION_ID >= 70100 && in_array('aes-256-gcm', \openssl_get_cipher_methods())) {
            $ctext = substr($ciphertext, 0, -16);
            $authTag = substr($ciphertext, -16);
            return \openssl_decrypt($ctext,
                'aes-256-gcm',
                $this->secret_key,
                \OPENSSL_RAW_DATA,
                $nonce,
                $authTag,
                $associated_data);
        }
        throw new \RuntimeException('AEAD_AES_256_GCM需要PHP 7.1以上或者安装libsodium-php');
    }
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

微信收付通V3支付 的相关文章

  • WordPress 中的 add_action 函数

    嗯 我正在学习创建一个 WordPress 插件 我下载了一个并阅读了代码 然后我看到了这个 我假设 foo 是它将添加操作的标签 但是 array 到底是做什么的呢 add action foo array foo1 foo2 我在看ht
  • ORDER BY 字段内的 MySQL 子查询。 (没有内连接)

    有很多与此相关的问题 但都具有使用内部联接的相同答案 这 我认为 在这里是不可能的 如果我错了请告诉我 我现在正在做的是调用两个不同的 mysql 查询来获取结果 它工作完美 db gt query SELECT FROM meta WHE
  • PHP 如何判断用户是否按下了 Enter 键或 Submit 按钮?

    我遇到的问题是我在一个表单中有多个提交输入 每个提交输入都有不同的值 我更愿意将它们保留为提交 Whenever the user presses Enter it is as though the topmost submit input
  • openssl_pkey_get_details($res) 不返回公共指数

    我在用着这个例子 https stackoverflow com a 12575951 2016196使用 php 生成的密钥进行 javascript 加密openssl图书馆 但是 details openssl pkey get de
  • 当数据验证失败时保留表单字段中的值

    我在弄清楚验证失败时如何保留用户数据时遇到问题 我对 PHP 有点陌生 所以我的逻辑可能会犯一些巨大的错误 目前 如果验证失败 所有字段都会被清除 并且 Post 数据也会消失 这是一些代码 假设用户输入无效电子邮件 我希望保留 名称 字段
  • Woocommerce 让产品显示在存档页面中

    我正在尝试让所有产品显示在我商店的存档页面中 我想知道他们的id我正在使用我的一个钩子 它在 wp head 上运行并检查 if is product category 我想以某种方式访问 产品的查询并获取它们的 ID if is prod
  • posts_search 中的自定义查询

    如何使用此查询作为我的自定义搜索查询 add filter posts search my search is perfect 20 2 function my search is perfect search wp query sWord
  • 扩展蓝图类?

    我想覆盖timestamps 函数中发现Blueprint班级 我怎样才能做到这一点 e g public function up Schema create users function Blueprint table table gt
  • 使用 preg_replace 仅替换第一个匹配项

    我有一个结构类似于以下的字符串 aba aaa cba sbd dga gad aaa cbz 该字符串每次都可能有点不同 因为它来自外部源 我只想替换第一次出现的 aaa 但其他人则不然 是否可以 可选的第四个参数预替换 http php
  • 学说迁移后备

    我们正在使用原则迁移 当迁移包含多个操作并且其中一个操作失败时 通常会出现问题 例如 如果迁移添加了 5 个外键 其中第 5 个失败 而字段长度不同 则修复字段错误并重新生成迁移不会not修复整个问题 而现在出现一个与 4 个密钥已存在有关
  • 从 .phar 存档中提取文件

    对于 Phar 文件 我完全错过了一些东西 我正在安装一个需要 phpunit pdepend 和其他依赖项的项目 我将它们作为 phar 文件获取 但是 我无法使用命令行工具 php 命令 从中提取文件 我用谷歌搜索了这个问题 但没有发现
  • 在 PHP 中撤销 Google 访问令牌

    正如标题所示 我想以编程方式撤销授予的访问令牌 即在 PHP 中 我发现这个他们的网站 https developers google com identity protocols OAuth2WebServer tokenrevoke 但
  • PHP 脚本可以在终端中运行,但不能在浏览器中运行

    我正在尝试执行exec命令 但我遇到了问题 当我运行以下代码时 当我通过浏览器运行它时它不起作用 但如果我把输出 str将其复制并粘贴到终端中 它工作得很好 造成这种情况的原因是什么 我该如何解决 目前我正在运行localhost php
  • 在 Wordpress 站点中进行 AJAX 调用时出现问题

    我在使用 Wordpress 站点功能的 AJAX 部分时遇到了一些问题 该功能接受在表单上输入的邮政编码 使用 PHP 函数来查找邮政编码是否引用特定位置并返回到该位置的永久链接 我的第一个问题是关于我构建的表单 现在我的表单操作是空白的
  • 使用 Ajax.Request 将 JSON 从浏览器传递到 PHP 的最佳方法

    您好 我有一个 JSON 对象 它是一个二维数组 我需要使用 Ajax Request 将其传递给 PHP 我知道的唯一方法 现在我使用js函数手动序列化我的数组 并获取以下格式的数据 s 1 d 3 4等 我的问题是 有没有办法更直接 有
  • 跟踪用户何时点击浏览器上的后退按钮

    是否可以检测用户何时单击浏览器的后退按钮 我有一个 Ajax 应用程序 如果我可以检测到用户何时单击后退按钮 我可以显示适当的数据 任何使用 PHP JavaScript 的解决方案都是优选的 任何语言的解决方案都可以 只需要我可以翻译成
  • PHP HEREDoc (EOF) 语法在 Sublime Text 3 上突出显示与正斜杠的差异

    我不熟悉 Sublime Text 3 如何使用语法突出显示 例如 如果它纯粹依赖于主题 或者它内置于主题运行的标准中 但就我而言 使用 PHP 的 HERE 文档和转发存在一些语法突出显示差异斜线 一旦出现正斜杠 ST3 就会认为以下所有
  • php 错误 fopen(): 文件名不能为空

    发送带有附件代码的电子邮件工作正常 最近我们已将文件传输到另一个托管服务器 idk 发生了什么 它显示以下错误 警告 fopen 第 106 行 home hugerecruitmetnt public html validatecva p
  • Laravel 中只向登录用户显示按钮

    如果我以 John 身份登录 如何才能只显示 John 的红色按钮而不显示 Susan 的红色按钮 测试系统环境 Win10 Laravel5 4 Mysql5 7 19 table class table table responsive
  • 如何在 PHP 中从 IP 地址/国家/地区名称查找时区 ID?

    谁能告诉我 PHP 中是否有任何方法可以从 IP 地址或国家 地区名称获取时区区域 例如 亚洲 加尔各答 描述 我正在尝试根据他 她的国家 地区设置用户时区 我从他的 IP 地址获取用户所在国家 地区 但我需要该国家 地区的时区区域 例如

随机推荐

  • EOFError: end of file reached

    logstash config email have error 2018 06 13T18 26 21 299 ERROR logstash outputs email Something happen while delivering
  • C/C++语言中字符串多行书写方法

    在C C 语言中 可能我们要书写的一个字符串太长了 放在一行上影响代码的可读性 这时我们就需要多行书写了 字符串多行书写有两种方法 在字符串换行处加一个反斜杠 下一行前不能有空格或者Tab键 使用双引号 程序示例 01 02 Introdu
  • Python求解,汉诺塔问题(附原代码和注释)

    def hanoi n a b c if n 1 print a gt c 最终目标是把A处移到C处 else hanoi n 1 a c b 把A处上层的n 1个移动到B处 此时A处即为A处 B处即为目标终点C hanoi 1 a b c
  • 性能测试工具 Locust

    目录 1 Locust的特点 2 脚本编写 class HttpLocust Locust class TaskSet 发出 HTTP 请求 使用 HTTP client 手动控制请求是成功还是失败 3 脚本增强 关联 参数化 检查点 断言
  • Android HAL 层框架分析(一)

    作为一个搞android驱动或者说搞底层的人 我觉得对于hal那是必须要掌握的 而且必须达到一定深度 于是我总结了一下 将整个自己的分析思路写下来 主要是看android源代码 根据源代码得到的思路 看源代码比看什么著作书籍都管用 andr
  • 封装

    1 生活中封装 快递 外卖 电脑机箱 2 java中封装 隐藏类内部的细节 对外部提供一些访问细节的方法 3 封装例子 方法 类 属性 4 封装好处 提高代码复用性 提高代码安全性 提高代码易用性 5 实现步骤 1 隐藏内部细节 属性 2
  • 网站服务器地址url怎么查看,怎么查看服务器访问外部的url地址

    怎么查看服务器访问外部的url地址 内容精选 换一换 在云服务器上搭建网站后 部分客户通过本地网络访问网站时出现偶发性无法访问的情况 确认客户使用的本地网络 若客户的本地网络是NAT网络 本地主机通过NAT功能使用公网IP地址访问弹性云服务
  • Python的列表和元组

    Python 列表 list 1 序列介绍 序列是Python中最基本的数据结构 序列中的每个元素都分配一个数字 它的位置 或索引 第一个索引是0 第二个索引是1 依此类推 Python有6个序列的内置类型 但最常见的是列表和元组 序列都可
  • pitaya框架中etcd实现服务发现源码注释

    package cluster import context encoding json fmt strings sync time github com coreos etcd clientv3 github com coreos etc
  • StaggeredGridLayoutManager与GridLayoutManager小细节注意点

    一 StaggeredGridLayoutManager 1 当我们的设置为VERTICAL时 很容易发现当上一行的高度排放相等时它一行排放的先后顺序是从左到右 2 当我们的设置为HORIZONTAL时 它总是从上到下排放的 3 当我们的设
  • opencv的安装、配置及所遇问题(Ubuntu16.04 + OpenCV3.4.2 + Python3.6)

    安装opencv对好多首次安装的开发者来说都是一场勇气和运气的较量 同样也是我在安装Ubuntu下安装过的众多软件包中最为波折的一款 在此记录安装过程中出现的各种error 幸运女神眷顾的安装顺序 1 安装ubuntu下的依赖项 sudo
  • 《Ansible自动化工具篇:Centos操作系统基于ansible工具一键远程离线部署之K8S1.24.12二进制版集群》

    一 部署背景 由于业务系统的特殊性 我们需要针对不同的客户环境部署二进制版K8S集群 由于大都数用户都是专网环境 无法使用外网 为了更便捷 高效的部署 针对业务系统的特性 我这边编写了 基于ansible自动化工具一键远程离线部署进制版K8
  • 办公利器:用Python向钉钉发送消息

    钉钉作为目前最热门的办公软件 在工作中大多数时间都在与他打交道 今天和大家分享一下如何用Python向钉钉发送消息 最终达到每日自动向指定群中发送销售日报 新建群机器人 首先打开群设置 点击智能群助手 选择添加自定义机器人 然后根据提示添加
  • 构造函数分类以及调用

    构造函数语法 类名 1 gt 构造函数 没有返回值也不写void 2 gt 函数名称与类名相同 3 gt 构造函数可以有参数的 因此是可以发生函数重载 4 gt 程序在调用对象时 会自动调用构造函数 无须手动调用 而且只会调用一次 析构函数
  • Servlet开发环境搭建

    Servlet是属于JAVA EE的范畴 是以JAVA SE为基础的 所以我们首先要配置JAVA的环境 不熟悉如何配置JAVA环境的可以参考 JAVA环境变量配置 这里我们的开发工具选择Eclipse Web容器选择Tomcat eclip
  • CentOS 7 vs CentOS 6新特性

    1 CentOS7 简介 CentOS Community Enterprise Operating System 中文意思是 社区企业操作系统 是Linux发行版之一 它是来自于Red Hat Enterprise Linux依照开放源代
  • 修改IP 脚本

    echo off echo echo 1 地税外网 echo 2 地税内网 echo 3 公司 echo 4 自动获取 echo echo 选择你要设置的网络 set p x if x 1 goto a if x 2 goto b if x
  • css中align-self属性是什么

    css中align self属性是什么 1 align self属性定义flex子项单独在侧轴 纵轴 方向上的对齐方式 2 align self多了个auto 默认值 表示继承自flex容器的align items属性值 实例 CSS co
  • 深度学习(二十八)基于多尺度深度网络的单幅图像深度估计

    基于多尺度深度网络的单幅图像深度估计 原文地址 http blog csdn net hjimce article details 50569474 作者 hjimce 一 相关理论 本篇博文主要讲解来自2014年NIPS上的一篇paper
  • 微信收付通V3支付