feat(core): 将Mixly.MJSON调整为Mixly.MJson

This commit is contained in:
王立帮
2025-04-27 15:49:16 +08:00
parent 291667cccf
commit d04ec7bfc7
13 changed files with 76 additions and 59 deletions

View File

@@ -1,10 +1,10 @@
(() => {
goog.require('Mixly.MJSON');
goog.require('Mixly.MJson');
goog.require('Mixly.Config');
goog.provide('Mixly.Msg');
const { Msg, MJSON, Config } = Mixly;
const { Msg, MJson, Config } = Mixly;
const { USER } = Config;
@@ -15,9 +15,9 @@ Msg.LANG_PATH = {
}
Msg.LANG = {
"zh-hans": MJSON.get(Msg.LANG_PATH["zh-hans"]),
"zh-hant": MJSON.get(Msg.LANG_PATH["zh-hant"]),
"en": MJSON.get(Msg.LANG_PATH["en"])
"zh-hans": MJson.get(Msg.LANG_PATH["zh-hans"]),
"zh-hant": MJson.get(Msg.LANG_PATH["zh-hant"]),
"en": MJson.get(Msg.LANG_PATH["en"])
}
Msg.nowLang = USER.language ?? 'zh-hans';

View File

@@ -11,7 +11,7 @@ goog.require('Mixly.Msg');
goog.require('Mixly.BoardManager');
goog.require('Mixly.Config');
goog.require('Mixly.Env');
goog.require('Mixly.MJSON');
goog.require('Mixly.MJson');
goog.require('Mixly.Storage');
goog.require('Mixly.WebSocket.Socket');
goog.provide('Mixly.Setting');
@@ -23,7 +23,7 @@ const {
BoardManager,
Config,
Env,
MJSON,
MJson,
Storage,
Setting
} = Mixly;

View File

@@ -74,7 +74,7 @@
{
"path": "/common/msg.js",
"require": [
"Mixly.MJSON",
"Mixly.MJson",
"Mixly.Config"
],
"provide": [
@@ -95,7 +95,7 @@
"Mixly.BoardManager",
"Mixly.Config",
"Mixly.Env",
"Mixly.MJSON",
"Mixly.MJson",
"Mixly.Storage",
"Mixly.WebSocket.Socket"
],
@@ -130,7 +130,7 @@
"require": [
"Mixly.Env",
"Mixly.Config",
"Mixly.MJSON",
"Mixly.MJson",
"Mixly.WebSocket",
"Mixly.LayerExt",
"Mixly.Command"

View File

@@ -2,7 +2,7 @@
goog.require('Mixly.Env');
goog.require('Mixly.Config');
goog.require('Mixly.MJSON');
goog.require('Mixly.MJson');
goog.require('Mixly.WebSocket');
goog.require('Mixly.LayerExt');
goog.require('Mixly.Command');
@@ -11,7 +11,7 @@ goog.provide('Mixly.WebSocket.Socket');
const {
Env,
Config,
MJSON,
MJson,
LayerExt,
Command
} = Mixly;
@@ -130,7 +130,7 @@ Socket.init = (onopenFunc = (data) => {}, doFunc = () => {}) => {
WS.obj.onmessage = (event) => {
heartCheck.reset().start();
let command = Command.parse(event.data);
command = MJSON.decode(command);
command = MJson.decode(command);
if (Socket.debug)
console.log('receive -> ', event.data);
Command.run(command);
@@ -170,7 +170,7 @@ Socket.sendCommand = (command) => {
let commandStr = '';
try {
commandStr = JSON.stringify(MJSON.encode(command));
commandStr = JSON.stringify(MJson.encode(command));
if (Socket.debug)
console.log('send -> ', commandStr);
} catch (e) {