milestone

This commit is contained in:
Jesse-Ma
2023-04-06 13:40:18 +08:00
parent a9e7f88412
commit 612c9b2164
22 changed files with 1595 additions and 1378 deletions

View File

@@ -73,10 +73,7 @@ export function saveNote(noteForm, secret) {
}
export function deleteNote(key) {
let storeKey = getStoreKey(key);
let storeInfo = storage.local.getText(storeKey);
let note = {
cipher: storeInfo.substring(2, 34),
key: key,
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -1,6 +1,4 @@
import Vue from "vue";
import VueI18n from "vue-i18n";
Vue.use(VueI18n);
import { createI18n } from "vue-i18n";
import zh from "./config/zh";
import en from "./config/en";
@@ -10,11 +8,16 @@ const messages = {
en,
}
const i18n = new VueI18n({
messages: messages,
const i18n = createI18n({
allowComposition: true,
globalInjection: true,
legacy: false,
locale: getLocale(),
messages
});
function getLocale() {
var lang = navigator.language;
if (lang) {

View File

@@ -1,25 +1,29 @@
import Vue from 'vue'
import { createApp } from 'vue'
import ViewUIPlus from 'view-ui-plus'
import App from './App.vue'
import router from './router'
import axios from 'axios'
import VueAxios from 'vue-axios'
import './plugins/iview.js'
import i18n from './i18n/'
import NoteConstant from "@/libs/constants";
import NoteConstant from "@/libs/constants"
axios.defaults.baseURL = NoteConstant.servicePath;
Vue.use(VueAxios, axios)
const debugFlag = process.env.NODE_ENV !== 'production';
Vue.config.debug = debugFlag;
Vue.config.devtools = debugFlag;
Vue.config.productionTip = debugFlag;
new Vue({
i18n,
router,
render: h => h(App)
}).$mount('#app')
const app = createApp(App)
app.config.debug = debugFlag;
app.config.devtools = debugFlag;
app.config.productionTip = debugFlag;
app.use(router)
.use(i18n)
.use(VueAxios, axios)
.use(ViewUIPlus, {
i18n: i18n,
transfer: true,
size: 'large',
capture: false,
})
.mount('#app')

View File

@@ -1,6 +0,0 @@
import Vue from 'vue'
import ViewUI from 'view-design'
Vue.use(ViewUI)
//import 'view-design/dist/styles/iview.css'

View File

@@ -1,5 +1,4 @@
import Vue from "vue";
import VueRouter from "vue-router";
import { createRouter, createWebHistory } from 'vue-router'
import EditNote from "@/views/EditNote.vue";
import ViewNote from "@/views/ViewNote.vue";
import ErrorRoute from "@/views/ErrorRoute.vue";
@@ -8,8 +7,6 @@ import { getNoteMeta } from "@/api/note";
import { getStoreKey } from "@/api/lock";
import storage from "@/libs/storage";
Vue.use(VueRouter);
var keyMeta = null;
var noteMeta = null;
var errorMeta = null;
@@ -119,9 +116,11 @@ const routes = [
{ path: "/:path(.*)", component: ErrorRoute }
];
const router = new VueRouter({
routes,
const router = createRouter({
history: createWebHistory(process.env.VUE_APP_URL_BASE_PATH),
linkExactActiveClass: "active",
mode: "history",
});
routes
})
export default router;

View File

@@ -217,6 +217,7 @@ export default {
lock: 0,
locking: 0,
commited: 0,
deleted: 0,
serverTime: '',
initTime: '',
},
@@ -518,6 +519,7 @@ export default {
},
dropNote() {
this.model.deleting = true;
this.state.deleted = 1;
storage.local.delete(this.secret.storeKey);
storage.session.setText(this.secret.storeKey + "_delete", 1);
location.reload();
@@ -602,7 +604,9 @@ export default {
});
},
beforeunloadHandler() {
setStoreText(this.noteForm, this.state, this.secret);
if(this.state.deleted==0){
setStoreText(this.noteForm, this.state, this.secret);
}
},
}
}

View File

@@ -135,19 +135,6 @@ export default {
//this.bindCopyTextEvent();
const myObserver = new ResizeObserver(entries => {
// iterate over the entries, do something.
entries.forEach(entry => {
let affix = document.querySelector('.ivu-affix');
if (affix) {
affix.setAttribute("style", "top: 0px; width: " + (entry.contentRect.width +2) + "px;");
}
});
});
const someOtherEl = document.querySelector('#wrapper');
myObserver.observe(someOtherEl);
},

View File

@@ -341,7 +341,7 @@ import { getStoreKey } from "@/api/lock";
import { deleteNote, getNoteBlob } from "@/api/note";
import storage from "@/libs/storage";
//import { getEscapeText } from "@/libs/noteStorage";
import QRCode from "qrcodejs2";
import QRCode from "qrcodejs2-fixes";
import Clipboard from "clipboard";
import { saveAs } from 'file-saver';
import { isWeixin, getNoteUrl } from "@/libs/utils";