mirror of
http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore.git
synced 2026-01-15 05:35:09 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
def9f0469d | ||
|
|
5ed5070f32 | ||
|
|
8dcf586baf | ||
|
|
a7a8087509 | ||
|
|
e50a2e08df | ||
|
|
fca8f9d013 |
24
CHANGELOG.md
24
CHANGELOG.md
@@ -1,4 +1,28 @@
|
||||
# 版本更新日志
|
||||
### [0.1.6](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.1.5...v0.1.6) (2023-03-21)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **middleware.i18n:** 尝试修复了多语言无法正确获取的问题 ([a7a8087](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/a7a80875092653e56d8dc9351743a08933d59282))
|
||||
|
||||
|
||||
### ✅ Tests | 测试
|
||||
|
||||
* **email:** 更新了邮件发送的测试账号 ([8dcf586](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/8dcf586baf1960f906d63c15f3d659b16b456048))
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** 更新依赖 ([5ed5070](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/5ed5070f323d0ea34b8c99b5ac826dc6c24431df))
|
||||
|
||||
### [0.1.5](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.1.4...v0.1.5) (2023-02-03)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **commonHandler:** 修复了一处兼容问题 ([fca8f9d](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/fca8f9d013e1d121bf8bc997710d77ff038fdae0))
|
||||
|
||||
### [0.1.4](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.1.3...v0.1.4) (2023-02-02)
|
||||
|
||||
|
||||
|
||||
@@ -57,7 +57,11 @@
|
||||
"hyperf/session": "Session 鉴权必需",
|
||||
"symfony/mailer": "用于发送电子邮件",
|
||||
"guzzlehttp/guzzle": "需要发起 http 请求时必需",
|
||||
"alibabacloud/dysmsapi-20170525": "阿里云短信服务必需"
|
||||
"alibabacloud/dysmsapi-20170525": "阿里云短信服务必需",
|
||||
"laminas/laminas-text": "用于cli展示表格和大字",
|
||||
"gevman/interactive-cli": "用于提供漂亮的交互式命令行",
|
||||
"clue/stdio-react": "一个基于 reactphp 的交互式命令行",
|
||||
"brainmaestro/composer-git-hooks": "用于 php 项目的 git-hooks"
|
||||
},
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
@@ -109,5 +113,5 @@
|
||||
"url": "https://repo.huaweicloud.com/repository/php/"
|
||||
}
|
||||
},
|
||||
"version": "0.1.4"
|
||||
"version": "0.1.6"
|
||||
}
|
||||
|
||||
464
composer.lock
generated
464
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -80,7 +80,7 @@ class CommonHandler extends ExceptionHandler
|
||||
$this->request->url();
|
||||
|
||||
$is_debug = $this->request->hasHeader('Postman-Token')
|
||||
|| str_starts_with($this->request->header('User-Agent'), 'apifox');
|
||||
|| str_starts_with($this->request->header('User-Agent', ''), 'apifox');
|
||||
|
||||
$request_data = Json::encode($this->request->getParsedBody());
|
||||
$request_headers = Json::encode($this->request->getHeaders());
|
||||
|
||||
@@ -36,10 +36,10 @@ class InternationalizationMiddleware implements MiddlewareInterface
|
||||
$language = $request->getHeaderLine('Accept-Language');
|
||||
if (!empty($language)) {
|
||||
switch (true) {
|
||||
case in_array($language, ['en', 'en_us', 'en-us', 'en-uk', 'en_uk']):
|
||||
case in_array(strtolower($language), ['en', 'en_us', 'en-us', 'en-uk', 'en_uk']):
|
||||
$language = 'en';
|
||||
break;
|
||||
case in_array($language, ['zh', 'zh_cn', 'zh-cn']):
|
||||
case in_array(strtolower($language), ['zh', 'zh_cn', 'zh-cn']):
|
||||
$language = 'zh_CN';
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -12,25 +12,27 @@ namespace Singularity\HDK\Test\Core\Service;
|
||||
use Singularity\HDK\Core\Service\EmailService;
|
||||
use Symfony\Component\Mailer\Exception\TransportException;
|
||||
|
||||
$dsn = 'smtp://account@luxcreo.ai:Qfsd8866@smtp.qiye.aliyun.com:465';
|
||||
$dsn = 'smtp://account@luxcreo.com:Qfsd8866@smtp-mail.outlook.com:587';
|
||||
$mail_sender_name = 'LuxCreo';
|
||||
$mail_sender = 'account@luxcreo.ai';
|
||||
$mail_sender = 'account@luxcreo.com';
|
||||
$email = new EmailService($dsn, $mail_sender_name, $mail_sender);
|
||||
|
||||
it('assertions that send HTML is available', function () use ($email) {
|
||||
$result = $email->sendHtml(
|
||||
'dongyun.li@luxcreo.ai',
|
||||
'HDK Unit Test HTML',
|
||||
<<<HTML
|
||||
$target = 'dongyun.li@luxcreo.ai';
|
||||
|
||||
it('assertions that send HTML is available', function () use ($email, $target) {
|
||||
$result = $email->sendHtml(
|
||||
$target,
|
||||
'HDK Unit Test HTML',
|
||||
<<<HTML
|
||||
<h1>Hello, World!</h1>
|
||||
HTML
|
||||
);
|
||||
expect($result)->toBeTrue();
|
||||
);
|
||||
expect($result)->toBeTrue();
|
||||
});
|
||||
|
||||
it('assertions that send Text is available', function () use ($email) {
|
||||
it('assertions that send Text is available', function () use ($email, $target) {
|
||||
$result = $email->sendText(
|
||||
'dongyun.li@luxcreo.ai',
|
||||
$target,
|
||||
'HDK Unit Test Text',
|
||||
<<<Text
|
||||
<h1>Hello, World!</h1>
|
||||
@@ -41,24 +43,26 @@ Text
|
||||
|
||||
it('assertions Error Receiver can be catch', function () use ($email) {
|
||||
try {
|
||||
$email->sendHtml(
|
||||
$result = $email->sendHtml(
|
||||
'unknown@luxcreo.ai',
|
||||
'HDK Unit Test',
|
||||
<<<HTML
|
||||
<h1>Hello, World!</h1>
|
||||
HTML
|
||||
);
|
||||
expect($result)->toBeTrue();
|
||||
} catch (TransportException $t) {
|
||||
expect($t->getCode())->toBe(554);
|
||||
}
|
||||
try {
|
||||
$email->sendText(
|
||||
$result = $email->sendText(
|
||||
'unknown@luxcreo.ai',
|
||||
'HDK Unit Test',
|
||||
<<<Text
|
||||
<h1>Hello, World!</h1>
|
||||
Text
|
||||
);
|
||||
expect($result)->toBeTrue();
|
||||
} catch (TransportException $t) {
|
||||
expect($t->getCode())->toBe(554);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user