mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
修复获取服务端配置,未使用配置的服务端地址的bug。
This commit is contained in:
parent
276092dfea
commit
bbaaa2e8d2
@ -17,6 +17,7 @@ Supported Languages: 中文 / [繁體中文](README-tw.md) / [English](README-en
|
||||
4. 修复`背景音乐组件`发布场景时,未导出音乐文件bug。
|
||||
5. 修复了一个严重bug,由于多次调用`clock.getElapsedTime`,导致所有动画播放变慢bug。
|
||||
6. 修复`视频贴图`发布场景后,视频地址不正确bug。
|
||||
7. 修复获取服务端配置,未使用配置的服务端地址的bug。
|
||||
|
||||
## v0.4.5更新【[更新日志](docs-dev/update/UpdateLog.md)】
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ function Application(container, options) {
|
||||
this.debug = this.storage.get('debug') || false;
|
||||
|
||||
// 服务端配置
|
||||
this.server = new Server();
|
||||
this.server = new Server(this.options.server);
|
||||
|
||||
// 包管理器
|
||||
this.packageManager = new PackageManager();
|
||||
|
||||
@ -3,7 +3,9 @@
|
||||
* @author tengge / https://github.com/tengge1
|
||||
*/
|
||||
class Server {
|
||||
constructor() {
|
||||
constructor(server) {
|
||||
this.origin = server;
|
||||
|
||||
this.enableAuthority = false; // 是否开启权限
|
||||
this.initialized = false; // 系统是否初始化
|
||||
|
||||
@ -23,7 +25,7 @@ class Server {
|
||||
|
||||
load() {
|
||||
return new Promise(resolve => {
|
||||
fetch(`/api/Config/Get`).then(response => {
|
||||
fetch(`${this.origin}/api/Config/Get`).then(response => {
|
||||
response.json().then(obj => {
|
||||
if (obj.Code !== 200) {
|
||||
app.toast(_t(obj.Msg), 'warn');
|
||||
@ -60,7 +62,7 @@ class Server {
|
||||
|
||||
login(username, password) {
|
||||
return new Promise(resolve => {
|
||||
fetch(`/api/Login/Login`, {
|
||||
fetch(`${this.origin}/api/Login/Login`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
@ -94,7 +96,7 @@ class Server {
|
||||
|
||||
logout() {
|
||||
return new Promise(resolve => {
|
||||
fetch(`/api/Login/Logout`, {
|
||||
fetch(`${this.origin}/api/Login/Logout`, {
|
||||
method: 'POST'
|
||||
}).then(response => {
|
||||
response.json().then(obj => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user