fix: If not initialized, jump to the initialization page. (#91)

* feat: If not initialized, jump to the initialization page.

* refactor: table layout.

* chore: update package-lock.json.
pull/93/head
Ryan Wang 2020-03-09 23:47:42 +08:00 committed by GitHub
parent 5a9906797b
commit 3136ab9467
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 66 additions and 65 deletions

62
package-lock.json generated
View File

@ -2087,9 +2087,9 @@
"dev": true
},
"@vue/test-utils": {
"version": "1.0.0-beta.31",
"resolved": "https://registry.npmjs.org/@vue/test-utils/-/test-utils-1.0.0-beta.31.tgz",
"integrity": "sha512-IlhSx5hyEVnbvDZ3P98R1jNmy88QAd/y66Upn4EcvxSD5D4hwOutl3dIdfmSTSXs4b9DIMDnEVjX7t00cvOnvg==",
"version": "1.0.0-beta.32",
"resolved": "https://registry.npmjs.org/@vue/test-utils/-/test-utils-1.0.0-beta.32.tgz",
"integrity": "sha512-ywhe7PATMAk/ZGdsrcuQIliQusOyfe0OOHjKKCCERqgHh1g/kqPtmSMT5Jx4sErx53SYbNucr8QOK6/u5ianAw==",
"dev": true,
"requires": {
"dom-event-types": "^1.0.0",
@ -2314,9 +2314,9 @@
}
},
"acorn": {
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz",
"integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==",
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz",
"integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==",
"dev": true
},
"acorn-globals": {
@ -2429,9 +2429,9 @@
}
},
"ant-design-vue": {
"version": "1.5.0-alpha.1",
"resolved": "https://registry.npmjs.org/ant-design-vue/-/ant-design-vue-1.5.0-alpha.1.tgz",
"integrity": "sha512-tOi7V/VPOY9e5YPrnl93nvJLegafEkvwcKAGNKfQeHnx1LNb2jSfIXpafFE5NL7+Hcn+Ou/NL1FbuAPdISNbyw==",
"version": "1.5.0-beta.1",
"resolved": "https://registry.npmjs.org/ant-design-vue/-/ant-design-vue-1.5.0-beta.1.tgz",
"integrity": "sha512-Fv5vxO+qHakbjsswgZ70/bjiZK4FphdFxv31VjBJKfhA5Ud7K6sNqC0BVpYS8nL0BwxGCVG8I30efNdU3VifnA==",
"requires": {
"@ant-design/icons": "^2.1.1",
"@ant-design/icons-vue": "^2.0.0",
@ -3599,9 +3599,9 @@
}
},
"caniuse-lite": {
"version": "1.0.30001032",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001032.tgz",
"integrity": "sha512-8joOm7BwcpEN4BfVHtfh0hBXSAPVYk+eUIcNntGtMkUWy/6AKRCDZINCLe3kB1vHhT2vBxBF85Hh9VlPXi/qjA==",
"version": "1.0.30001033",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001033.tgz",
"integrity": "sha512-8Ibzxee6ibc5q88cM1usPsMpJOG5CTq0s/dKOmlekPbDGKt+UrnOOTPSjQz3kVo6yL7N4SB5xd+FGLHQmbzh6A==",
"dev": true
},
"capture-exit": {
@ -3953,9 +3953,9 @@
"dev": true
},
"yargs": {
"version": "15.1.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.1.0.tgz",
"integrity": "sha512-T39FNN1b6hCW4SOIk1XyTOWxtXdcen0t+XYrysQmChzSipvhBO8Bj0nK1ozAasdk24dNWuMZvr4k24nz+8HHLg==",
"version": "15.3.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.0.tgz",
"integrity": "sha512-g/QCnmjgOl1YJjGsnUg2SatC7NUYEiLXJqxNOQU9qSpjzGtGXda9b+OKccr1kLTy8BN9yqEyqfq5lxlwdc13TA==",
"dev": true,
"requires": {
"cliui": "^6.0.0",
@ -3968,13 +3968,13 @@
"string-width": "^4.2.0",
"which-module": "^2.0.0",
"y18n": "^4.0.0",
"yargs-parser": "^16.1.0"
"yargs-parser": "^18.1.0"
}
},
"yargs-parser": {
"version": "16.1.0",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-16.1.0.tgz",
"integrity": "sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg==",
"version": "18.1.0",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.0.tgz",
"integrity": "sha512-o/Jr6JBOv6Yx3pL+5naWSoIA2jJ+ZkMYQG/ie9qFbukBe4uzmBatlXFOiu/tNKRWEtyf+n5w7jc/O16ufqOTdQ==",
"dev": true,
"requires": {
"camelcase": "^5.0.0",
@ -9065,9 +9065,9 @@
}
},
"ws": {
"version": "7.2.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.2.1.tgz",
"integrity": "sha512-sucePNSafamSKoOqoNfBd8V0StlkzJKL2ZAhGQinCfNQ+oacw+Pk7lcdAElecBF2VkLNZRiIb5Oi1Q5lVUVt2A==",
"version": "7.2.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.2.2.tgz",
"integrity": "sha512-2qj/tYkDPDSVf7JiHanwEBwkhxi7DchFewIsSnR33MQtG3O/BPAJjqs4g6XEuayuRqIExSQMHZlmyDLbuSrXYw==",
"dev": true
}
}
@ -10618,9 +10618,9 @@
}
},
"node-releases": {
"version": "1.1.50",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.50.tgz",
"integrity": "sha512-lgAmPv9eYZ0bGwUYAKlr8MG6K4CvWliWqnkcT2P8mMAgVrH3lqfBPorFlxiG1pHQnqmavJZ9vbMXUTNyMLbrgQ==",
"version": "1.1.51",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.51.tgz",
"integrity": "sha512-1eQEs6HFYY1kMXQPOLzCf7HdjReErmvn85tZESMczdCNVWP3Y7URYLBAyYynuI7yef1zj4HN5q+oB2x67QU0lw==",
"dev": true,
"requires": {
"semver": "^6.3.0"
@ -10635,9 +10635,9 @@
}
},
"nopt": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz",
"integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=",
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz",
"integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==",
"dev": true,
"requires": {
"abbrev": "1",
@ -14700,9 +14700,9 @@
}
},
"vuex": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.1.2.tgz",
"integrity": "sha512-ha3jNLJqNhhrAemDXcmMJMKf1Zu4sybMPr9KxJIuOpVcsDQlTBYLLladav2U+g1AvdYDG5Gs0xBTb0M5pXXYFQ=="
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.1.3.tgz",
"integrity": "sha512-k8vZqNMSNMgKelVZAPYw5MNb2xWSmVgCKtYKAptvm9YtZiOXnRXFWu//Y9zQNORTrm3dNj1n/WaZZI26tIX6Mw=="
},
"w3c-hr-time": {
"version": "1.0.2",

View File

@ -9,7 +9,7 @@
"test:unit": "vue-cli-service test:unit"
},
"dependencies": {
"ant-design-vue": "^1.5.0-alpha.1",
"ant-design-vue": "^1.5.0-beta.1",
"axios": "^0.19.2",
"enquire.js": "^2.1.6",
"filepond": "^4.12.0",

View File

@ -245,6 +245,7 @@
:dataSource="formattedComments"
:loading="loading"
:pagination="false"
scrollToFirstRowOnChange
>
<template
slot="author"
@ -437,6 +438,7 @@ const postColumns = [
title: '昵称',
dataIndex: 'author',
width: '150px',
ellipsis: true,
scopedSlots: { customRender: 'author' }
},
{
@ -455,6 +457,7 @@ const postColumns = [
title: '评论文章',
dataIndex: 'post',
width: '200px',
ellipsis: true,
scopedSlots: { customRender: 'post' }
},
{
@ -475,6 +478,7 @@ const sheetColumns = [
title: '昵称',
dataIndex: 'author',
width: '150px',
ellipsis: true,
scopedSlots: { customRender: 'author' }
},
{
@ -493,12 +497,13 @@ const sheetColumns = [
title: '评论页面',
dataIndex: 'sheet',
width: '200px',
ellipsis: true,
scopedSlots: { customRender: 'sheet' }
},
{
title: '日期',
dataIndex: 'createTime',
width: '150px',
width: '170px',
scopedSlots: { customRender: 'createTime' }
},
{

View File

@ -175,13 +175,8 @@
:dataSource="menus"
:loading="loading"
:rowKey="menu => menu.id"
:scrollToFirstRowOnChange="true"
>
<ellipsis
:length="30"
tooltip
slot="name"
slot-scope="text"
>{{ text }}</ellipsis>
<span
slot="action"
slot-scope="text, record"
@ -215,14 +210,17 @@ const columns = [
{
title: '名称',
dataIndex: 'name',
ellipsis: true,
scopedSlots: { customRender: 'name' }
},
{
title: '地址',
ellipsis: true,
dataIndex: 'url'
},
{
title: '分组',
ellipsis: true,
dataIndex: 'team'
},
{

View File

@ -169,15 +169,8 @@
:dataSource="categories"
:rowKey="record => record.id"
:loading="loading"
:scrollToFirstRowOnChange="true"
>
<ellipsis
:length="30"
tooltip
slot="name"
slot-scope="text"
>
{{ text }}
</ellipsis>
<span
slot="postCount"
slot-scope="text,record"
@ -252,14 +245,17 @@ import menuApi from '@/api/menu'
const columns = [
{
title: '名称',
ellipsis: true,
dataIndex: 'name'
},
{
title: '别名',
ellipsis: true,
dataIndex: 'slug'
},
{
title: '描述',
ellipsis: true,
dataIndex: 'description'
},
{

View File

@ -303,11 +303,11 @@
:dataSource="formattedPosts"
:loading="postsLoading"
:pagination="false"
:scrollToFirstRowOnChange="true"
>
<span
slot="postTitle"
slot-scope="text,record"
style="max-width: 150px;display: block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
>
<a-icon
type="pushpin"
@ -525,6 +525,7 @@ const columns = [
title: '标题',
dataIndex: 'title',
width: '150px',
ellipsis: true,
scopedSlots: { customRender: 'postTitle' }
},
{

View File

@ -150,11 +150,11 @@
:dataSource="formattedSheets"
:pagination="false"
:loading="loading"
:scrollToFirstRowOnChange="true"
>
<span
slot="sheetTitle"
slot-scope="text,record"
style="max-width: 150px;display: block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
>
<a
v-if="record.status=='PUBLISHED'"
@ -347,6 +347,7 @@ const customColumns = [
{
title: '标题',
dataIndex: 'title',
ellipsis: true,
scopedSlots: { customRender: 'sheetTitle' }
},
{

View File

@ -157,6 +157,7 @@
:dataSource="links"
:loading="loading"
:rowKey="link => link.id"
:scrollToFirstRowOnChange="true"
>
<template
slot="url"
@ -234,15 +235,18 @@ const columns = [
{
title: '名称',
dataIndex: 'name',
ellipsis: true,
scopedSlots: { customRender: 'name' }
},
{
title: '网址',
dataIndex: 'url',
ellipsis: true,
scopedSlots: { customRender: 'url' }
},
{
title: '分组',
ellipsis: true,
dataIndex: 'team'
},
{

View File

@ -69,23 +69,8 @@
:dataSource="formattedDatas"
:loading="loading"
:pagination="false"
:scrollToFirstRowOnChange="true"
>
<ellipsis
:length="50"
tooltip
slot="key"
slot-scope="key"
>
{{ key }}
</ellipsis>
<ellipsis
:length="50"
tooltip
slot="value"
slot-scope="value"
>
{{ value }}
</ellipsis>
<span
slot="type"
slot-scope="typeProperty"
@ -187,11 +172,13 @@ const columns = [
{
title: 'Key',
dataIndex: 'key',
ellipsis: true,
scopedSlots: { customRender: 'key' }
},
{
title: 'Value',
dataIndex: 'value',
ellipsis: true,
scopedSlots: { customRender: 'value' }
},
{

View File

@ -130,6 +130,7 @@
</template>
<script>
import adminApi from '@/api/admin'
import { mapActions, mapGetters, mapMutations } from 'vuex'
export default {
@ -148,6 +149,7 @@ export default {
...mapGetters({ defaultApiUrl: 'apiUrl' })
},
created() {
this.verifyIsInstall()
const _this = this
document.addEventListener('keydown', function(e) {
if (e.keyCode === 72 && e.altKey && e.shiftKey) {
@ -161,6 +163,13 @@ export default {
setApiUrl: 'SET_API_URL',
restoreApiUrl: 'RESTORE_API_URL'
}),
verifyIsInstall() {
adminApi.isInstalled().then(response => {
if (!response.data.data) {
this.$router.push({ name: 'Install' })
}
})
},
handleLogin() {
if (!this.username) {
this.$message.warn('用户名不能为空!')