mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-23 00:33:50 +02:00
AH
This commit is contained in:
@@ -336,8 +336,7 @@ import gameLogService from './service/gamelog.js'
|
|||||||
...options
|
...options
|
||||||
};
|
};
|
||||||
var { params } = init;
|
var { params } = init;
|
||||||
var isGetRequest = init.method === 'GET';
|
if (init.method === 'GET') {
|
||||||
if (isGetRequest === true) {
|
|
||||||
// transform body to url
|
// transform body to url
|
||||||
if (params === Object(params)) {
|
if (params === Object(params)) {
|
||||||
var url = new URL(init.url);
|
var url = new URL(init.url);
|
||||||
@@ -352,7 +351,10 @@ import gameLogService from './service/gamelog.js'
|
|||||||
if (req !== undefined) {
|
if (req !== undefined) {
|
||||||
return req;
|
return req;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (init.test === 'a') {
|
||||||
|
console.log("test");
|
||||||
|
}
|
||||||
|
else {
|
||||||
init.headers = {
|
init.headers = {
|
||||||
'Content-Type': 'application/json;charset=utf-8',
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
...init.headers
|
...init.headers
|
||||||
@@ -361,6 +363,7 @@ import gameLogService from './service/gamelog.js'
|
|||||||
? JSON.stringify(params)
|
? JSON.stringify(params)
|
||||||
: '{}';
|
: '{}';
|
||||||
}
|
}
|
||||||
|
console.log(init);
|
||||||
var req = webApiService.execute(init).catch((err) => {
|
var req = webApiService.execute(init).catch((err) => {
|
||||||
this.$throw(0, err);
|
this.$throw(0, err);
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
@@ -400,7 +403,7 @@ import gameLogService from './service/gamelog.js'
|
|||||||
this.$throw(status, data);
|
this.$throw(status, data);
|
||||||
return data;
|
return data;
|
||||||
});
|
});
|
||||||
if (isGetRequest === true) {
|
if (init.method === 'GET') {
|
||||||
req.finally(() => {
|
req.finally(() => {
|
||||||
this.pendingGetRequests.delete(init.url);
|
this.pendingGetRequests.delete(init.url);
|
||||||
});
|
});
|
||||||
@@ -7443,6 +7446,8 @@ import gameLogService from './service/gamelog.js'
|
|||||||
D.visible = false;
|
D.visible = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// App: VRCPlus Icons
|
||||||
|
|
||||||
$app.methods.displayVRCPlusIconsTable = function () {
|
$app.methods.displayVRCPlusIconsTable = function () {
|
||||||
var params = {
|
var params = {
|
||||||
n: 100,
|
n: 100,
|
||||||
@@ -7520,6 +7525,38 @@ import gameLogService from './service/gamelog.js'
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$app.methods.onFileChange = function (e) {
|
||||||
|
var files = e.target.files || e.dataTransfer.files;
|
||||||
|
console.log(e);
|
||||||
|
if (!files.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
API.uploadVRCPlusIcon({ files[0]
|
||||||
|
}).then((args) => {
|
||||||
|
this.$message({
|
||||||
|
message: 'Icon uploaded',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
API.uploadVRCPlusIcon = function (params) {
|
||||||
|
return this.call('icon', {
|
||||||
|
method: 'POST',
|
||||||
|
'Content-Type': 'multipart/form-data',
|
||||||
|
'Content-Disposition': 'form-data; name="file"; filename="blob"',
|
||||||
|
test: 'a',
|
||||||
|
body: params
|
||||||
|
}).then((json) => {
|
||||||
|
var args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
$app = new Vue($app);
|
$app = new Vue($app);
|
||||||
window.$app = $app;
|
window.$app = $app;
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -444,10 +444,11 @@ html
|
|||||||
span(style="font-weight:bold") VRCPlus Icons
|
span(style="font-weight:bold") VRCPlus Icons
|
||||||
el-button(type="default" @click="displayVRCPlusIconsTable()" size="mini" icon="el-icon-refresh" circle style="margin-left:5px")
|
el-button(type="default" @click="displayVRCPlusIconsTable()" size="mini" icon="el-icon-refresh" circle style="margin-left:5px")
|
||||||
el-button(type="default" @click="setVRCPlusIcon('')" size="mini" icon="el-icon-close" circle style="margin:0")
|
el-button(type="default" @click="setVRCPlusIcon('')" size="mini" icon="el-icon-close" circle style="margin:0")
|
||||||
|
input(type="file" @change="onFileChange")
|
||||||
br
|
br
|
||||||
.x-friend-item(v-for="icon in VRCPlusIconsTable" :key="icon.id" style="display:inline-block;")
|
.x-friend-item(v-for="icon in VRCPlusIconsTable" :key="icon.id" style="display:inline-block;")
|
||||||
.vrcplus-icon(style="" @click="setVRCPlusIcon(icon.id)" :class="{ 'current-vrcplus-icon': 'https://api.vrchat.cloud/api/1/file/' + icon.id + '/1' === API.currentUser.userIcon }")
|
.vrcplus-icon(style="" @click="setVRCPlusIcon(icon.id)" :class="{ 'current-vrcplus-icon': 'https://api.vrchat.cloud/api/1/file/' + icon.id + '/1' === API.currentUser.userIcon }")
|
||||||
img.avatar(v-if="icon.versions[1].file.url" v-lazy="icon.versions[1].file.url")
|
img(v-if="icon.versions[1].file.url" v-lazy="icon.versions[1].file.url")
|
||||||
el-button(type="default" @click="deleteVRCPlusIcon(icon.id)" size="mini" icon="el-icon-delete" circle style="float:right;")
|
el-button(type="default" @click="deleteVRCPlusIcon(icon.id)" size="mini" icon="el-icon-delete" circle style="float:right;")
|
||||||
div(style="margin-top:30px")
|
div(style="margin-top:30px")
|
||||||
span(style="font-weight:bold") Current User JSON
|
span(style="font-weight:bold") Current User JSON
|
||||||
|
|||||||
Reference in New Issue
Block a user