头像设置
This commit is contained in:
@@ -49,9 +49,36 @@ class CallStateManager {
|
||||
async init() {
|
||||
// 初始化配置
|
||||
await this.setupConfig();
|
||||
// 加载用户设置
|
||||
this.loadUserSettings();
|
||||
// 获取本地摄像头视频流
|
||||
await this.getLocalStream();
|
||||
}
|
||||
|
||||
// 加载用户设置
|
||||
loadUserSettings() {
|
||||
const userSettings = localStorage.getItem('userSettings');
|
||||
if (userSettings) {
|
||||
try {
|
||||
const settings = JSON.parse(userSettings);
|
||||
|
||||
// 更新本地用户信息
|
||||
if (settings.name || settings.avatar) {
|
||||
this.state.session.localUser = {
|
||||
...this.state.session.localUser,
|
||||
id: settings.userId || this.state.session.localUser.id,
|
||||
name: settings.name || this.state.session.localUser.name,
|
||||
avatar: settings.avatar || this.state.session.localUser.avatar
|
||||
};
|
||||
|
||||
// 通知UI更新
|
||||
this.notify({ type: 'USER_SETTINGS_UPDATED', user: this.state.session.localUser });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error loading user settings:', error);
|
||||
}
|
||||
}
|
||||
}
|
||||
async setupConfig() {
|
||||
const res = await getServerConfig();
|
||||
this.useWebSocket = res.useWebSocket;
|
||||
|
||||
Reference in New Issue
Block a user