diff --git a/src/App.vue b/src/App.vue
index 7f15db3..85d8155 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -14,9 +14,8 @@
- {{userInfo.username.slice(0, 5)}}
+ {{userInfo.username.slice(0, 5)}}
-
@@ -138,22 +137,25 @@ export default {
fn()
} else {
// 已登录 系统无数据
- getObject('BOOKMARK').then((res) => {
- if (res.length > 0) {
- rowData = JSON.parse(res[0].attributes.formDatas)
- } else {
+ getObject('BOOKMARK')
+ .then((res) => {
+ if (res.length > 0) {
+ rowData = JSON.parse(res[0].attributes.formDatas)
+ } else {
+ localStorage.setItem('BOOKMARK', JSON.stringify(myData))
+ rowData = JSON.parse(JSON.stringify(myData))
+ }
+ })
+ .catch(() => {
localStorage.setItem('BOOKMARK', JSON.stringify(myData))
rowData = JSON.parse(JSON.stringify(myData))
- }
- }).catch(() => {
- localStorage.setItem('BOOKMARK', JSON.stringify(myData))
- rowData = JSON.parse(JSON.stringify(myData))
- }).finally(() => {
- fn()
- data.data = rowData
- data.bookMark = rowData[0].children
- data.allData = flatten(rowData)
- })
+ })
+ .finally(() => {
+ fn()
+ data.data = rowData
+ data.bookMark = rowData[0].children
+ data.allData = flatten(rowData)
+ })
}
}
diff --git a/src/components/Dialog.vue b/src/components/Dialog.vue
index d7e2209..9eec8ed 100644
--- a/src/components/Dialog.vue
+++ b/src/components/Dialog.vue
@@ -46,21 +46,21 @@ import { ElMessage } from 'element-plus'
export default {
model: {
value: 'isDetailVisible',
- events: 'closeViews'
+ events: 'closeViews',
},
props: {
isDetailVisible: {
type: Boolean,
- default: false
+ default: false,
},
selectType: {
type: Number,
- default: 0
+ default: 0,
},
detail: {
type: Object,
- default: () => {}
- }
+ default: () => {},
+ },
},
setup(props, context) {
const isBOOKMARK = JSON.parse(localStorage.getItem('BOOKMARK'))
@@ -71,13 +71,13 @@ export default {
type: '',
desc: '',
url: '',
- logo: ''
- }
+ logo: '',
+ },
})
// 定义校验规则 表单代码中必须以 :rules 接收
const rules = {
title: [{ required: true, message: '请输入书签名称', trigger: 'blur' }],
- type: [{ required: true, message: '请选择书签类别', trigger: 'change' }]
+ type: [{ required: true, message: '请选择书签类别', trigger: 'change' }],
}
const refruleForm = ref(null)
// 确定按钮的格式
@@ -101,7 +101,9 @@ export default {
// 更改了分类
// 当前分类删除该数据
if (myDetail.type === v.type) {
- const pindex = v.children.findIndex(p => p.title === myDetail.title)
+ const pindex = v.children.findIndex(
+ (p) => p.title === myDetail.title
+ )
v.children.splice(pindex, 1)
}
// 新分类添加该分类
@@ -148,11 +150,10 @@ export default {
submitForm,
refruleForm,
rules,
- BOOKMARK
+ BOOKMARK,
}
},
- methods: {
- }
+ methods: {},
}
diff --git a/src/components/Login.vue b/src/components/Login.vue
index f937ec4..942cc85 100644
--- a/src/components/Login.vue
+++ b/src/components/Login.vue
@@ -12,7 +12,6 @@
-
diff --git a/src/main.js b/src/main.js
index 65f698d..4110c3a 100644
--- a/src/main.js
+++ b/src/main.js
@@ -6,7 +6,9 @@ import 'element-plus/lib/theme-chalk/index.css'
// 接入了Leancloud
import AV from 'leancloud-storage'
+// 请注册leancloud,新建应用,然后替换这个
AV.init({ appId: '\x42\x77\x4c\x72\x43\x67\x64\x56\x79\x4c\x73\x35\x32\x6d\x4a\x4f\x31\x48\x63\x72\x58\x61\x6b\x49\x2d\x67\x7a\x47\x7a\x6f\x48\x73\x7a', appKey: '\x32\x35\x67\x4e\x77\x7a\x77\x34\x64\x56\x37\x49\x41\x68\x37\x69\x30\x49\x7a\x44\x6e\x59\x76\x56', serverURL: '\x68\x74\x74\x70\x73\x3a\x2f\x2f\x62\x77\x6c\x72\x63\x67\x64\x76\x2e\x6c\x63\x2d\x63\x6e\x2d\x6e\x31\x2d\x73\x68\x61\x72\x65\x64\x2e\x63\x6f\x6d' })
+
const app = createApp(App)
app.use(ElementPlus)
app.mount('#app')