rename config to cachedConfig

This commit is contained in:
pypy
2020-01-11 22:16:50 +09:00
parent 7c4bf0c50a
commit 9c07956a0c
3 changed files with 13 additions and 13 deletions
+5 -5
View File
@@ -463,7 +463,7 @@ if (window.CefSharp) {
// API: Config // API: Config
API.config = {}; API.cachedConfig = {};
API.$on('CONFIG', function (args) { API.$on('CONFIG', function (args) {
args.ref = this.updateConfig(args.json); args.ref = this.updateConfig(args.json);
@@ -486,7 +486,7 @@ if (window.CefSharp) {
clientApiKey: '', clientApiKey: '',
...ref ...ref
}; };
this.config = ctx; this.cachedConfig = ctx;
return ctx; return ctx;
}; };
@@ -724,7 +724,7 @@ if (window.CefSharp) {
} }
*/ */
API.login = function (param) { API.login = function (param) {
return this.call(`auth/user?apiKey=${this.config.clientApiKey}`, { return this.call(`auth/user?apiKey=${this.cachedConfig.clientApiKey}`, {
method: 'GET', method: 'GET',
headers: { headers: {
Authorization: `Basic ${btoa(encodeURIComponent(`${param.username}:${param.password}`).replace(/%([0-9A-F]{2})/gu, (_, s) => String.fromCharCode(parseInt(s, 16))).replace('%', '%25'))}` Authorization: `Basic ${btoa(encodeURIComponent(`${param.username}:${param.password}`).replace(/%([0-9A-F]{2})/gu, (_, s) => String.fromCharCode(parseInt(s, 16))).replace('%', '%25'))}`
@@ -750,7 +750,7 @@ if (window.CefSharp) {
} }
*/ */
API.loginWithSteam = function (param) { API.loginWithSteam = function (param) {
return this.call(`auth/steam?apiKey=${this.config.clientApiKey}`, { return this.call(`auth/steam?apiKey=${this.cachedConfig.clientApiKey}`, {
method: 'POST', method: 'POST',
body: param body: param
}).then((json) => { }).then((json) => {
@@ -807,7 +807,7 @@ if (window.CefSharp) {
}; };
API.getCurrentUser = function () { API.getCurrentUser = function () {
return this.call(`auth/user?apiKey=${this.config.clientApiKey}`, { return this.call(`auth/user?apiKey=${this.cachedConfig.clientApiKey}`, {
method: 'GET' method: 'GET'
}).then((json) => { }).then((json) => {
var args = { var args = {
+5 -5
View File
@@ -252,10 +252,10 @@
</el-button-group> </el-button-group>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="World" v-loading="isSearchWorldLoading" style="min-height:60px"> <el-tab-pane label="World" v-loading="isSearchWorldLoading" style="min-height:60px">
<el-dropdown @command="(command) => searchWorld(API.config.dynamicWorldRows[command])" size="small" trigger="click" style="margin-bottom:15px"> <el-dropdown @command="(command) => searchWorld(API.cachedConfig.dynamicWorldRows[command])" size="small" trigger="click" style="margin-bottom:15px">
<el-button size="small">Search by Category <i class="el-icon-arrow-down el-icon--right"></i></el-button> <el-button size="small">Search by Category <i class="el-icon-arrow-down el-icon--right"></i></el-button>
<el-dropdown-menu #default="dropdown"> <el-dropdown-menu #default="dropdown">
<el-dropdown-item v-for="row in API.config.dynamicWorldRows" :key="row.index" v-text="row.name" :command="row.index"></el-dropdown-item> <el-dropdown-item v-for="row in API.cachedConfig.dynamicWorldRows" :key="row.index" v-text="row.name" :command="row.index"></el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<div class="x-friend-list"> <div class="x-friend-list">
@@ -676,19 +676,19 @@
<div class="x-friend-item"> <div class="x-friend-item">
<div class="detail"> <div class="detail">
<span class="name">SDK Unity Version</span> <span class="name">SDK Unity Version</span>
<span class="extra" v-text="API.config.sdkUnityVersion"></span> <span class="extra" v-text="API.cachedConfig.sdkUnityVersion"></span>
</div> </div>
</div> </div>
<div class="x-friend-item"> <div class="x-friend-item">
<div class="detail"> <div class="detail">
<span class="name">SDK Version</span> <span class="name">SDK Version</span>
<span class="extra" v-text="API.config.releaseSdkVersion"></span> <span class="extra" v-text="API.cachedConfig.releaseSdkVersion"></span>
</div> </div>
</div> </div>
<div class="x-friend-item"> <div class="x-friend-item">
<div class="detail"> <div class="detail">
<span class="name">SDK URL</span> <span class="name">SDK URL</span>
<span class="extra" v-text="API.config.releaseSdkUrl"></span> <span class="extra" v-text="API.cachedConfig.releaseSdkUrl"></span>
</div> </div>
</div> </div>
</div> </div>
+3 -3
View File
@@ -376,7 +376,7 @@ if (window.CefSharp) {
// API: Config // API: Config
API.config = {}; API.cachedConfig = {};
API.$on('CONFIG', function (args) { API.$on('CONFIG', function (args) {
args.ref = this.updateConfig(args.json); args.ref = this.updateConfig(args.json);
@@ -399,7 +399,7 @@ if (window.CefSharp) {
clientApiKey: '', clientApiKey: '',
...ref ...ref
}; };
this.config = ctx; this.cachedConfig = ctx;
return ctx; return ctx;
}; };
@@ -546,7 +546,7 @@ if (window.CefSharp) {
} }
*/ */
API.getWorld = function (param) { API.getWorld = function (param) {
return this.call(`worlds/${param.worldId}?apiKey=${this.config.clientApiKey}`, { return this.call(`worlds/${param.worldId}?apiKey=${this.cachedConfig.clientApiKey}`, {
method: 'GET' method: 'GET'
}).then((json) => { }).then((json) => {
var args = { var args = {