|
@@ -8,8 +8,7 @@ const {
|
|
|
getBindingByIdentity,
|
|
getBindingByIdentity,
|
|
|
getLegacyUserByIdentity,
|
|
getLegacyUserByIdentity,
|
|
|
insertSocialBinding,
|
|
insertSocialBinding,
|
|
|
- updateSocialBindingProfile,
|
|
|
|
|
- syncLegacySocialMirror
|
|
|
|
|
|
|
+ updateSocialBindingProfile
|
|
|
} = require('../../../lib/UserSocialBinding')
|
|
} = require('../../../lib/UserSocialBinding')
|
|
|
|
|
|
|
|
class Login extends API {
|
|
class Login extends API {
|
|
@@ -59,8 +58,8 @@ class Login extends API {
|
|
|
uuid = uuidv4()
|
|
uuid = uuidv4()
|
|
|
const username = `用户${uuid.slice(0, 8)}`
|
|
const username = `用户${uuid.slice(0, 8)}`
|
|
|
|
|
|
|
|
- let regSql = 'INSERT INTO users (uuid, username, registTime, social_uid, social_type, nickname, avatar, email) VALUES (?,?,?,?,?,?,?,?) '
|
|
|
|
|
- let regRows = await db.query(regSql, [uuid, username, time, social_uid, type, nickname, faceimg, '未设置'])
|
|
|
|
|
|
|
+ let regSql = 'INSERT INTO users (uuid, username, registTime, nickname, avatar, email) VALUES (?,?,?,?,?,?) '
|
|
|
|
|
+ let regRows = await db.query(regSql, [uuid, username, time, nickname, faceimg, '未设置'])
|
|
|
if (!regRows || regRows.affectedRows !== 1) {
|
|
if (!regRows || regRows.affectedRows !== 1) {
|
|
|
this.logger.error(`聚合登录用户注册失败!数据库错误`)
|
|
this.logger.error(`聚合登录用户注册失败!数据库错误`)
|
|
|
return res.json({
|
|
return res.json({
|
|
@@ -96,7 +95,6 @@ class Login extends API {
|
|
|
[time, nickname, uuid]
|
|
[time, nickname, uuid]
|
|
|
)
|
|
)
|
|
|
await updateSocialBindingProfile(type, social_uid, nickname, faceimg)
|
|
await updateSocialBindingProfile(type, social_uid, nickname, faceimg)
|
|
|
- await syncLegacySocialMirror(uuid, type)
|
|
|
|
|
|
|
|
|
|
res.json({
|
|
res.json({
|
|
|
...BaseStdResponse.OK,
|
|
...BaseStdResponse.OK,
|