mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
thonking
This commit is contained in:
@@ -7531,21 +7531,37 @@ import gameLogService from './service/gamelog.js'
|
|||||||
if (!files.length) {
|
if (!files.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
API.uploadVRCPlusIcon({ files[0]
|
var based64 = '';
|
||||||
}).then((args) => {
|
var r = new FileReader();
|
||||||
this.$message({
|
r.onload = function() {
|
||||||
message: 'Icon uploaded',
|
based64 = btoa(r.result);
|
||||||
type: 'success'
|
var file = {
|
||||||
|
filename: 'blob',
|
||||||
|
private: false,
|
||||||
|
contents: based64
|
||||||
|
};
|
||||||
|
var array2 = { file };
|
||||||
|
console.log(JSON.stringify(array2));
|
||||||
|
API.uploadVRCPlusIcon(JSON.stringify(array2)
|
||||||
|
).then((args) => {
|
||||||
|
this.$message({
|
||||||
|
message: 'Icon uploaded',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
return args;
|
||||||
});
|
});
|
||||||
return args;
|
};
|
||||||
});
|
r.readAsBinaryString(files[0]);
|
||||||
};
|
};
|
||||||
|
|
||||||
API.uploadVRCPlusIcon = function (params) {
|
API.uploadVRCPlusIcon = function (params) {
|
||||||
return this.call('icon', {
|
return this.call('icon', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
'Content-Type': 'multipart/form-data',
|
headers: {
|
||||||
'Content-Disposition': 'form-data; name="file"; filename="blob"',
|
'Content-Type': 'application/json',
|
||||||
|
'Content-Disposition': 'form-data; name="file"; filename="blob"'
|
||||||
|
//'Content-Transfer-Encoding': 'base64'
|
||||||
|
},
|
||||||
test: 'a',
|
test: 'a',
|
||||||
body: params
|
body: params
|
||||||
}).then((json) => {
|
}).then((json) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user