feat: game UID fully internal + remove multi-identity copy
- game_uid is now an internal param: auto-generated server-side (U + 12 hex) on register/bind-identity/install/admin-create/external register; player-supplied game_uid ignored - Removed all player-facing UID inputs: register page, install page, identity bind modal, ticket-create 'your UID' field - Removed player-facing UID display: identity table column, ticket detail/tracking reporter UID - Removed '同一账号可绑定网易端 + 皮肤站身份' / '可绑定多个来源身份' copy - Kept target_game_uid (reported player) and admin panel UID management - settings-page skin-site placeholder updated
This commit is contained in:
@@ -118,13 +118,15 @@ router.post('/register', validateLengths({
|
||||
} catch {}
|
||||
|
||||
const hashed = await bcrypt.hash(password, 10);
|
||||
// 游戏UID为内置参数: 不接收玩家输入, 由系统自动生成
|
||||
const builtinUid = 'U' + uuid().replace(/-/g, '').slice(0, 12).toUpperCase();
|
||||
const r = await query(
|
||||
'INSERT INTO users(username, password, email, game_name, game_uid, active, email_verified, source) VALUES (?,?,?,?,?,?,?,?)',
|
||||
[username, hashed, email, game_name, game_uid||'', 1, 1, source || '']
|
||||
[username, hashed, email, game_name, builtinUid, 1, 1, source || '']
|
||||
);
|
||||
try {
|
||||
await query('INSERT INTO user_identities(user_id, source, game_name, game_uid) VALUES (?,?,?,?)',
|
||||
[r.insertId, source || '', game_name, game_uid || '']);
|
||||
[r.insertId, source || '', game_name, builtinUid]);
|
||||
} catch {}
|
||||
res.status(201).json({ message: '注册成功,请登录' });
|
||||
} catch (err) {
|
||||
@@ -233,7 +235,8 @@ router.post('/identities', authenticate, async (req, res) => {
|
||||
if (dupName) return res.status(400).json({ error: '该游戏名已绑定其他账号' });
|
||||
|
||||
const r = await query('INSERT INTO user_identities(user_id, source, game_name, game_uid) VALUES (?,?,?,?)',
|
||||
[req.user.id, source || '', game_name, game_uid || '']);
|
||||
// 游戏UID为内置参数: 不接收玩家输入, 由系统自动生成
|
||||
[req.user.id, source || '', game_name, 'U' + uuid().replace(/-/g, '').slice(0, 12).toUpperCase()]);
|
||||
res.status(201).json({ id: r.insertId, message: '绑定成功' });
|
||||
} catch (err) {
|
||||
console.error('[auth]', err);
|
||||
|
||||
Reference in New Issue
Block a user