From 2d3b7a808fe3bef800099ab012089fdf98ff5a49 Mon Sep 17 00:00:00 2001 From: ShawnPhang Date: Tue, 25 Jul 2023 15:54:40 +0800 Subject: [PATCH] update: res data --- src/api/github.ts | 4 +++- src/api/home.ts | 2 +- src/common/methods/fonts/index.ts | 4 +++- .../business/image-cutout/ImageCutout.vue | 10 ++------- src/config.ts | 20 ----------------- src/views/Draw.vue | 22 +++++++------------ src/views/Psd.vue | 9 ++++---- 7 files changed, 22 insertions(+), 49 deletions(-) delete mode 100644 src/config.ts diff --git a/src/api/github.ts b/src/api/github.ts index e0e1314..5123aeb 100644 --- a/src/api/github.ts +++ b/src/api/github.ts @@ -7,6 +7,8 @@ */ import fetch from '@/utils/axios' const reader = new FileReader() +const knock = 'qpV8PUxwY7as4jc' +const cut = 'AqYfNFb6G2f2OVl4IVFOY' function getBase64(file: File) { return new Promise((resolve) => { @@ -31,7 +33,7 @@ const putPic = async (file: any) => { path, } await fetch(imageUrl, body, 'put', { - Authorization: 'token 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', + Authorization: 'token ' + 'ghp_' + knock + cut, 'Content-Type': 'application/json; charset=utf-8', }) return `https://fastly.jsdelivr.net/gh/shawnphang/files@main/${path}` diff --git a/src/api/home.ts b/src/api/home.ts index 1c47110..1b0aa9d 100644 --- a/src/api/home.ts +++ b/src/api/home.ts @@ -3,7 +3,7 @@ * @Date: 2021-08-19 18:43:22 * @Description: * @LastEditors: ShawnPhang - * @LastEditTime: 2023-07-13 18:19:14 + * @LastEditTime: 2023-07-24 13:01:10 */ import fetch from '@/utils/axios' import _config from '@/config' diff --git a/src/common/methods/fonts/index.ts b/src/common/methods/fonts/index.ts index 59a28af..0ecbffd 100644 --- a/src/common/methods/fonts/index.ts +++ b/src/common/methods/fonts/index.ts @@ -3,7 +3,7 @@ * @Date: 2022-01-08 09:43:37 * @Description: 字体处理 * @LastEditors: ShawnPhang - * @LastEditTime: 2023-07-21 13:07:08 + * @LastEditTime: 2023-07-25 11:13:01 */ // import { isSupportFontFamily, blob2Base64 } from './utils' import { getFonts } from '@/api/material' @@ -16,6 +16,7 @@ export const useFontStore = { // download, async init() { this.list = [] + localStorage.getItem('FONTS_VERSION') !== '1' && localStorage.removeItem('FONTS') const localFonts: any = localStorage.getItem('FONTS') ? JSON.parse(localStorage.getItem('FONTS') || '') : [] if (localFonts.length > 0) { this.list.push(...localFonts) @@ -30,6 +31,7 @@ export const useFontStore = { }), ) localStorage.setItem('FONTS', JSON.stringify(this.list)) + localStorage.setItem('FONTS_VERSION', '1') } // store.dispatch('setFonts', this.list) }, diff --git a/src/components/business/image-cutout/ImageCutout.vue b/src/components/business/image-cutout/ImageCutout.vue index 4d39672..5be830d 100644 --- a/src/components/business/image-cutout/ImageCutout.vue +++ b/src/components/business/image-cutout/ImageCutout.vue @@ -3,7 +3,7 @@ * @Date: 2023-07-11 23:50:22 * @Description: 抠图组件 * @LastEditors: ShawnPhang - * @LastEditTime: 2023-07-14 09:10:31 + * @LastEditTime: 2023-07-24 13:01:03 -->