|
|
@@ -244,7 +244,7 @@ export class MatrixClientService implements OnDestroy {
|
|
|
*/
|
|
|
async connectSession(accessToken: string, userId: string, deviceId?: string): Promise<void> {
|
|
|
if (!accessToken || !userId) {
|
|
|
- throw new Error('Matrix 凭据不完整(缺 accessToken 或 userId)');
|
|
|
+ throw new Error('登录凭据不完整,请重新进入');
|
|
|
}
|
|
|
// 同身份重复调用:幂等,不打断现有 sync
|
|
|
if (this.client && this.token === accessToken && this._userId() === userId) {
|
|
|
@@ -520,7 +520,7 @@ export class MatrixClientService implements OnDestroy {
|
|
|
// ① 上传到媒体库 → mxc://
|
|
|
const upload = await c.uploadContent(blob, { name: card.name, type: card.mimeType });
|
|
|
const mxc = upload.content_uri;
|
|
|
- if (!mxc) throw new Error('附件上传到 Matrix 失败(没有返回地址)');
|
|
|
+ if (!mxc) throw new Error('附件上传失败(没有返回地址)');
|
|
|
|
|
|
// ② 发原生附件事件。图片用 m.image(客户端可直接内联显示),其余用 m.file
|
|
|
const isImage = card.mimeType.startsWith('image/');
|
|
|
@@ -871,7 +871,7 @@ export class MatrixClientService implements OnDestroy {
|
|
|
}
|
|
|
|
|
|
private requireClient(): MatrixClient {
|
|
|
- if (!this.client) throw new Error('Matrix 客户端未连接');
|
|
|
+ if (!this.client) throw new Error('尚未连接,请稍后重试');
|
|
|
return this.client;
|
|
|
}
|
|
|
|