Skip to content

Commit a9831e6

Browse files
committed
fix: typecheck failed
1 parent 2e8a18e commit a9831e6

File tree

4 files changed

+7
-147
lines changed

4 files changed

+7
-147
lines changed

src/admin/driver.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*/
44
import { config } from '../../package.json';
55
import { CONFIG } from '../main';
6-
import { md5 } from '../utils/MD5';
76
import { exportIndex, Post } from '../utils/post';
87

98
export class RemoteFile{
@@ -13,15 +12,15 @@ export class RemoteFile{
1312

1413
static async __get(f: string){
1514
this.__check_enabled();
16-
const url = `${config.davbase}${config.base}${f}`;
15+
const url = `${CONFIG.davroot}${config.base}${f}`;
1716
const res = await fetch(url);
1817
if(!res.ok) throw new Error(`Failed to fetch ${url}: ${res.statusText}`);
1918
return res;
2019
}
2120

2221
static async __put(f: string, data: XMLHttpRequestBodyInit){
2322
this.__check_enabled();
24-
const url = `${config.davbase}${config.base}${f}`;
23+
const url = `${CONFIG.davroot}${config.base}${f}`;
2524
const res = await fetch(url, {
2625
method: 'PUT',
2726
body: data,
@@ -35,7 +34,7 @@ export class RemoteFile{
3534

3635
static __put_with_progress(f: string, data: XMLHttpRequestBodyInit, progress: (loaded: number, total: number) => void){
3736
this.__check_enabled();
38-
const url = `${config.davbase}${config.base}${f}`;
37+
const url = `${CONFIG.davroot}${config.base}${f}`;
3938
const xhr = new XMLHttpRequest();
4039
xhr.open('PUT', url);
4140
xhr.setRequestHeader('Content-Type', 'application/octet-stream');
@@ -52,7 +51,7 @@ export class RemoteFile{
5251

5352
static async __mkdir(p: string){
5453
this.__check_enabled();
55-
const url = `${config.davbase}${config.base}${p}/`;
54+
const url = `${CONFIG.davroot}${config.base}${p}/`;
5655
const res = await fetch(url, {
5756
method: 'MKCOL'
5857
});

src/admin/write-post.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717
} from '@muyajs/core';
1818
import '@muyajs/core/lib/style.css';
1919
import type { Search } from '@muyajs/core/lib/types/search/index.js';
20-
import { onMounted, onUnmounted, reactive, ref, shallowReactive } from 'vue';
20+
import { onMounted, onUnmounted, reactive, ref } from 'vue';
2121
import { Post } from '../utils/post';
2222
import { useRoute, useRouter } from 'vue-router';
2323
import { update_post } from './driver';
2424
import Autofill from './autofill.vue';
2525
import Filelist from './filelist.vue';
2626
import { config } from '../../package.json';
27-
import { CONFIG } from '../main';
2827
2928
Muya.use(EmojiSelector);
3029
Muya.use(InlineFormatToolbar);
@@ -211,7 +210,7 @@
211210
212211
onUnmounted(() => muya && muya.destroy());
213212
214-
const uninstall = useRouter().beforeEach((to, from) => {
213+
const uninstall = useRouter().beforeEach(() => {
215214
if(previousContent != muya!.getMarkdown()){
216215
return confirm('当前页面未保存,确定离开吗?');
217216
}

src/utils/MD5.ts

Lines changed: 0 additions & 138 deletions
This file was deleted.

tsconfig.app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"noFallthroughCasesInSwitch": true,
1111
"noUncheckedSideEffectImports": true
1212
},
13-
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "utils/rename.ts"]
13+
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
1414
}

0 commit comments

Comments
 (0)