Complete message.

pull/25/head
ruibaby 2019-05-31 22:35:09 +08:00
parent 34e8c8d135
commit a5a27822d6
14 changed files with 35 additions and 66 deletions

View File

@ -1,29 +1,14 @@
/**
* 项目默认配置项
* primaryColor - 默认主题色
* navTheme - sidebar theme ['dark', 'light'] 两种主题
* layout - 整体布局方式 ['sidemenu', 'topmenu'] 两种布局
* fixedHeader - 固定 Header : boolean
* fixSiderbar - 固定左侧菜单栏 boolean
* autoHideHeader - 向下滚动时隐藏 Header : boolean
* contentWidth - 内容区布局 流式 | 固定
*
* storageOptions: {} - Vue-ls 插件配置项 (localStorage/sessionStorage)
*
*/
export default { export default {
primaryColor: '#1890FF', // primary color of ant design primaryColor: '#1890FF',
navTheme: 'light', // theme for nav menu navTheme: 'dark',
layout: 'topmenu', // nav menu position: sidemenu or topmenu layout: 'topmenu',
contentWidth: 'Fixed', // layout of content: Fluid or Fixed, only works when layout is topmenu contentWidth: 'Fixed',
fixedHeader: false, // sticky header fixedHeader: false,
fixSiderbar: false, // sticky siderbar fixSiderbar: false,
autoHideHeader: false, // auto hide header autoHideHeader: false,
// vue-ls options
storageOptions: { storageOptions: {
namespace: 'halo__', // key prefix namespace: 'halo__',
name: 'ls', // name variable Vue.[ls] or this.[$ls], name: 'ls',
storage: 'local' // storage name session, local, memory storage: 'local'
} }
} }

View File

@ -207,18 +207,6 @@ export const asyncRouterMap = [
* @type { *[] } * @type { *[] }
*/ */
export const constantRouterMap = [ export const constantRouterMap = [
{
path: '/test',
component: BlankLayout,
redirect: '/test/home',
children: [
{
path: 'home',
name: 'TestHome',
component: () => import('@/views/Home')
}
]
},
{ {
path: '/login', path: '/login',
name: 'Login', name: 'Login',

View File

@ -211,7 +211,7 @@ export default {
doUpdateAttachment() { doUpdateAttachment() {
attachmentApi.update(this.attachment.id, this.attachment).then(response => { attachmentApi.update(this.attachment.id, this.attachment).then(response => {
this.$log.debug('Updated attachment', response.data.data) this.$log.debug('Updated attachment', response.data.data)
this.$message.success('附件修改成功') this.$message.success('附件修改成功')
}) })
this.editable = false this.editable = false
}, },
@ -220,11 +220,11 @@ export default {
this.$copyText(text) this.$copyText(text)
.then(message => { .then(message => {
console.log('copy', message) console.log('copy', message)
this.$message.success('复制成功') this.$message.success('复制成功')
}) })
.catch(err => { .catch(err => {
console.log('copy.err', err) console.log('copy.err', err)
this.$message.error('复制失败') this.$message.error('复制失败')
}) })
}, },
handleCopyMarkdownLink() { handleCopyMarkdownLink() {
@ -232,11 +232,11 @@ export default {
this.$copyText(text) this.$copyText(text)
.then(message => { .then(message => {
console.log('copy', message) console.log('copy', message)
this.$message.success('复制成功') this.$message.success('复制成功')
}) })
.catch(err => { .catch(err => {
console.log('copy.err', err) console.log('copy.err', err)
this.$message.error('复制失败') this.$message.error('复制失败')
}) })
}, },
handleAddToPhoto() { handleAddToPhoto() {

View File

@ -184,7 +184,7 @@ export default {
this.loadAttachments() this.loadAttachments()
}, },
handleAttachmentUploadSuccess() { handleAttachmentUploadSuccess() {
this.$message.success('上传成功') this.$message.success('上传成功')
this.loadAttachments() this.loadAttachments()
}, },
handleDelete() { handleDelete() {

View File

@ -157,7 +157,7 @@ export default {
this.loadAttachments() this.loadAttachments()
}, },
handleAttachmentUploadSuccess() { handleAttachmentUploadSuccess() {
this.$message.success('上传成功') this.$message.success('上传成功')
this.loadAttachments() this.loadAttachments()
}, },
handleDelete() { handleDelete() {

View File

@ -388,9 +388,6 @@ export default {
this.options = response.data.data this.options = response.data.data
}) })
}, },
handleEditComment(id) {
this.$message.success('编辑')
},
handleEditStatusClick(commentId, status) { handleEditStatusClick(commentId, status) {
commentApi.updateStatus(this.type, commentId, status).then(response => { commentApi.updateStatus(this.type, commentId, status).then(response => {
this.$message.success('操作成功!') this.$message.success('操作成功!')

View File

@ -89,7 +89,7 @@ export default {
handleSelectFile(file) { handleSelectFile(file) {
const _this = this const _this = this
if (!file.editable) { if (!file.editable) {
this.$message.info('该文件不支持修改') this.$message.info('该文件不支持修改')
this.content = '' this.content = ''
this.file = {} this.file = {}
this.buttonDisabled = true this.buttonDisabled = true
@ -98,7 +98,7 @@ export default {
if (file.name === 'settings.yaml' || file.name === 'settings.yml' || file.name === 'theme.yaml' || file.name === 'theme.yml') { if (file.name === 'settings.yaml' || file.name === 'settings.yml' || file.name === 'theme.yaml' || file.name === 'theme.yml') {
this.$confirm({ this.$confirm({
title: '警告:请谨慎修改该配置文件', title: '警告:请谨慎修改该配置文件',
content: '修改之后可能会产生不可预料的问题', content: '修改之后可能会产生不可预料的问题',
onCancel() { onCancel() {
_this.content = '' _this.content = ''
_this.file = {} _this.file = {}
@ -114,7 +114,7 @@ export default {
}, },
handlerSaveContent() { handlerSaveContent() {
themeApi.saveContent(this.file.path, this.content).then(response => { themeApi.saveContent(this.file.path, this.content).then(response => {
this.$message.success('保存成功') this.$message.success('保存成功')
}) })
} }
} }

View File

@ -429,9 +429,9 @@ export default {
handleChange(info) { handleChange(info) {
const status = info.file.status const status = info.file.status
if (status === 'done') { if (status === 'done') {
this.$message.success(`${info.file.name} 主题上传成功`) this.$message.success(`${info.file.name} 主题上传成功`)
} else if (status === 'error') { } else if (status === 'error') {
this.$message.error(`${info.file.name} 主题上传失败`) this.$message.error(`${info.file.name} 主题上传失败`)
} }
}, },
handleUploadSuccess() { handleUploadSuccess() {
@ -450,7 +450,7 @@ export default {
handleFetching() { handleFetching() {
this.fetchButtonLoading = true this.fetchButtonLoading = true
themeApi.fetching(this.fetchingUrl).then(response => { themeApi.fetching(this.fetchingUrl).then(response => {
this.$message.success('拉取成功') this.$message.success('拉取成功')
this.uploadVisible = false this.uploadVisible = false
this.fetchButtonLoading = false this.fetchButtonLoading = false
this.loadThemes() this.loadThemes()

View File

@ -236,8 +236,8 @@ export default {
}, },
saveSheet() { saveSheet() {
this.createOrUpdateSheet( this.createOrUpdateSheet(
() => this.$message.success('页面创建成功'), () => this.$message.success('页面创建成功'),
() => this.$message.success('页面更新成功'), () => this.$message.success('页面更新成功'),
false false
) )
}, },

View File

@ -321,12 +321,12 @@ export default {
handleCreateOrUpdate() { handleCreateOrUpdate() {
if (this.photo.id) { if (this.photo.id) {
photoApi.update(this.photo.id, this.photo).then(response => { photoApi.update(this.photo.id, this.photo).then(response => {
this.$message.success('照片更新成功') this.$message.success('照片更新成功')
this.loadPhotos() this.loadPhotos()
}) })
} else { } else {
photoApi.create(this.photo).then(response => { photoApi.create(this.photo).then(response => {
this.$message.success('照片添加成功') this.$message.success('照片添加成功')
this.loadPhotos() this.loadPhotos()
this.photo = response.data.data this.photo = response.data.data
}) })

View File

@ -251,7 +251,7 @@ export default {
install() { install() {
adminApi.install(this.installation).then(response => { adminApi.install(this.installation).then(response => {
this.$log.debug('Installation response', response) this.$log.debug('Installation response', response)
this.$message.success('安装成功') this.$message.success('安装成功')
setTimeout(() => { setTimeout(() => {
this.$router.push({ name: 'Dashboard' }) this.$router.push({ name: 'Dashboard' })
}, 300) }, 300)
@ -273,7 +273,7 @@ export default {
if (this.migrationData) { if (this.migrationData) {
recoveryApi.migrate(this.migrationData).then(response => { recoveryApi.migrate(this.migrationData).then(response => {
this.$log.debug('Migrated successfullly') this.$log.debug('Migrated successfullly')
this.$message.success('数据迁移成功') this.$message.success('数据迁移成功')
this.install() this.install()
}) })
} else { } else {

View File

@ -31,7 +31,7 @@
<upload <upload
name="files" name="files"
multiple multiple
accept="application/markdown" accept="text/markdown"
:uploadHandler="uploadHandler" :uploadHandler="uploadHandler"
@change="handleChange" @change="handleChange"
> >
@ -65,9 +65,9 @@ export default {
console.log(info.file, info.fileList) console.log(info.file, info.fileList)
} }
if (status === 'done') { if (status === 'done') {
this.$message.success(`${info.file.name} 导入成功`) this.$message.success(`${info.file.name} 导入成功`)
} else if (status === 'error') { } else if (status === 'error') {
this.$message.error(`${info.file.name} 导入失败`) this.$message.error(`${info.file.name} 导入失败`)
} }
} }
} }

View File

@ -67,12 +67,12 @@ export default {
...mapActions(['login', 'loadUser']), ...mapActions(['login', 'loadUser']),
handleLogin() { handleLogin() {
if (!this.username) { if (!this.username) {
this.$message.warn('用户名不能为空') this.$message.warn('用户名不能为空')
return return
} }
if (!this.password) { if (!this.password) {
this.$message.warn('密码不能为空') this.$message.warn('密码不能为空')
return return
} }

View File

@ -28,7 +28,7 @@
</div> </div>
<div class="profile-center-detail"> <div class="profile-center-detail">
<p> <p>
<a-icon type="link" /><a <a-icon type="global" /><a
:href="options.blog_url" :href="options.blog_url"
target="method" target="method"
>{{ options.blog_url }}</a> >{{ options.blog_url }}</a>
@ -205,7 +205,6 @@ export default {
this.$message.error('确认密码和新密码不匹配!') this.$message.error('确认密码和新密码不匹配!')
return return
} }
userApi.updatePassword(this.passwordParam.oldPassword, this.passwordParam.newPassword).then(response => {}) userApi.updatePassword(this.passwordParam.oldPassword, this.passwordParam.newPassword).then(response => {})
}, },
handleUpdateProfile() { handleUpdateProfile() {