aboutsummaryrefslogtreecommitdiff
path: root/src/site/components/footer
diff options
context:
space:
mode:
authorPitu <[email protected]>2021-01-07 19:03:47 +0900
committerPitu <[email protected]>2021-01-07 19:03:47 +0900
commitf3dc0ffe7507915710ce2c5d36ba9125394a262e (patch)
treec80ee29b003f4ea250a680052527ccb3f8bd3b67 /src/site/components/footer
parentfix: normalize url and thumbnail response (diff)
downloadhost.fuwn.me-f3dc0ffe7507915710ce2c5d36ba9125394a262e.tar.xz
host.fuwn.me-f3dc0ffe7507915710ce2c5d36ba9125394a262e.zip
chore: update sharex snippet to use apiKey instead of jwt
Diffstat (limited to 'src/site/components/footer')
-rw-r--r--src/site/components/footer/Footer.vue15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/site/components/footer/Footer.vue b/src/site/components/footer/Footer.vue
index 38e3f07..96774e7 100644
--- a/src/site/components/footer/Footer.vue
+++ b/src/site/components/footer/Footer.vue
@@ -35,11 +35,12 @@ import { saveAs } from 'file-saver';
export default {
computed: {
- ...mapGetters({ loggedIn: 'auth/isLoggedIn' }),
+ ...mapGetters({
+ loggedIn: 'auth/isLoggedIn',
+ apiKey: 'auth/getApiKey'
+ }),
...mapState({
- version: state => state.config.version,
- serviceName: state => state.config.serviceName,
- token: state => state.auth.token
+ version: state => state.config.version
}),
getYear() {
return new Date().getFullYear();
@@ -48,18 +49,18 @@ export default {
methods: {
createShareXThing() {
const sharexFile = `{
- "Name": "${this.serviceName}",
+ "Name": "${this.$store.state.config.serviceName}",
"DestinationType": "ImageUploader, FileUploader",
"RequestType": "POST",
"RequestURL": "${location.origin}/api/upload",
"FileFormName": "files[]",
"Headers": {
- "authorization": "Bearer ${this.token}",
+ "token": "${this.apiKey}",
"accept": "application/vnd.chibisafe.json"
},
"ResponseType": "Text",
"URL": "$json:url$",
- "ThumbnailURL": "$json:url$"
+ "ThumbnailURL": "$json:thumb$"
}`;
const sharexBlob = new Blob([sharexFile], { type: 'application/octet-binary' });
saveAs(sharexBlob, `${location.hostname}.sxcu`);