微信昵称问题

dev_daiao
daiao 5 years ago
parent 892b7fabff
commit 85b002e1d4

@ -17,8 +17,7 @@ class Oauth::CreateOrFindQqAccountService < ApplicationService
new_user = true
# 新用户
login = User.generate_login('Q')
nickname = regix_emoji(params.dig('info', 'nickname'))
@user = User.new(login: login, nickname: nickname.force_encoding('UTF-8'), type: 'User', status: User::STATUS_ACTIVE)
@user = User.new(login: login, type: 'User', status: User::STATUS_ACTIVE)
end
ActiveRecord::Base.transaction do

@ -24,8 +24,7 @@ class Oauth::CreateOrFindWechatAccountService < ApplicationService
new_user = true
# 新用户
login = User.generate_login('w')
result['nickname'] = regix_emoji(result['nickname'])
@user = User.new(login: login, nickname: result['nickname'], type: 'User', status: User::STATUS_ACTIVE)
@user = User.new(login: login, type: 'User', status: User::STATUS_ACTIVE)
#@user = User.new(login: login, nickname: result['nickname'], type: 'User', status: User::STATUS_ACTIVE)
end

Loading…
Cancel
Save