Browse Source

兼容换行符

dev
刘向辉 3 years ago
parent
commit
dc962fd776
  1. 2
      src/app/babylon/game.ts
  2. 6
      src/app/service/babylon/building-basic-infos.service.ts

2
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()

6
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<any>(api + this.c_post, l_body, { headers, params })
.pipe(

Loading…
Cancel
Save