diff --git a/src/app/babylon/game.ts b/src/app/babylon/game.ts index 80415d9..d0c5f82 100644 --- a/src/app/babylon/game.ts +++ b/src/app/babylon/game.ts @@ -4,6 +4,7 @@ import { SceneManager } from "./controller/scene-manager"; import { LoginSatus } from "./controller/status/login-status"; import { StatusManager } from "./controller/status/status-manager"; import { UIManager } from "./controller/ui-manager"; +import { SpeakingTool } from "./tool/speaking-tool"; export class Game { @@ -85,6 +86,7 @@ export class Game { } dispose() { + SpeakingTool.Instance.clear(); SceneManager.Instance.dispose(); StatusManager.dispose(); this.scene.dispose() diff --git a/src/app/service/babylon/building-basic-infos.service.ts b/src/app/service/babylon/building-basic-infos.service.ts index 72e95d6..bd18c1b 100644 --- a/src/app/service/babylon/building-basic-infos.service.ts +++ b/src/app/service/babylon/building-basic-infos.service.ts @@ -1,6 +1,5 @@ import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { NumberValueAccessor } from '@angular/forms'; import { Observable, throwError } from 'rxjs'; import { catchError, retry } from 'rxjs/operators'; @@ -169,7 +168,10 @@ export class BuildingBasicInfosService { let headers = this.headers; - let l_body = `'${JSON.stringify(body)}'`; + let bodyString = JSON.stringify(body); + let l_body = `'${bodyString}'`; + //兼容换行符 + l_body = l_body.replace(/\\n/g, "\\\\n"); return this.http.post(api + this.c_post, l_body, { headers, params }) .pipe(