微信粉丝注册失败问题
- 由于微信粉丝昵称带有Emoji表情或特殊字符导致的无法成功注册问题
PS:仅限解决HLFramework V1.0.4(包含V1.0.4)之前的版本,从V1.0.5以后已经不存在这个问题
解决方案:
1、修改数据库的连接编码,如下图所示
<?php
return [
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=#######',
'username' => '######',
'password' => '########',
'charset' => 'utf8mb4',
'tablePrefix' => 'hl_',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => true,
],
],
];
修改表字段编码,执行如下代码即可:
ALTER TABLE table_name CHANGE `old_column` `new_column` VARCHAR(25) CHARACTER SET utf8mb4 DEFAULT NULL;