1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-06-12 13:19:31 +08:00

新增:联系博主页面顶部返回按钮;

修复:修复 默认封面图、默认图片、默认头像在使用随机api时候无法显示的BUG;
修复:后台管理新增文章发布失败BUG;
删除:去除联系博主页面中的 联系博主 按钮;
优化:对友链页面进行重写;
优化:对部分页面和功能进行优化。
This commit is contained in:
小莫唐尼
2022-12-09 00:24:39 +08:00
parent 473655171b
commit 3702cb1618
15 changed files with 200 additions and 92 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ export const _DefaultAppSettings = {
},
gallery: {
// 是否使用瀑布流
useWaterfull: false
useWaterfull: true
},
links: {
// 是否使用简约模式
+51
View File
@@ -0,0 +1,51 @@
/**
* 日志工具
*/
const LOG_NAME = 'APP_CONFIG_LOG'
export const logTypes = {
config: 'BASE_CONFIG'
}
export const logTypesMap = {
BASE_CONFIG: '基础配置'
}
export const logUtils = {
/**
* @param {Object} type 日志类型
* @param {Object} msg 日志信息
*/
saveLog(type, data) {
const {
msg,
page,
path
} = data;
let _logs = this.getLogs()
const logMsgObj = {
time: new Date().getTime(),
type: type,
typeText: logTypesMap[type],
page: page || '',
path: path || '',
msg: msg
}
_logs.push(logMsgObj)
uni.setStorageSync(LOG_NAME, JSON.stringify(_logs))
},
/**
* 获取所有的日志
*/
getLogs() {
let _logs = uni.getStorageSync(LOG_NAME)
return _logs ? JSON.parse(_logs) : [];
},
/**
* 删除所有日志
*/
removeLogs() {
uni.removeStorageSync(LOG_NAME)
},
}
+26 -4
View File
@@ -11,7 +11,10 @@
*/
import HaloConfig from '@/config/halo.config.js';
import {
logTypes,
logUtils
} from '@/utils/halo.logs.js'
const utils = {
/**
* 检查是否为http/https链接
@@ -30,14 +33,29 @@ const utils = {
// 检查封面图
checkThumbnailUrl: function(thumbnail) {
if (!thumbnail) return HaloConfig.defaultThumbnailUrl + `&r=${new Date().getTime()}`;
if (!HaloConfig.defaultThumbnailUrl) {
// logUtils.saveLog(logTypes.config, {
// path: 'checkThumbnailUrl',
// page: 'checkThumbnailUrl',
// msg: '未配置默认的封面图,配置参数【HaloConfig.defaultThumbnailUrl】'
// })
}
let _url = HaloConfig.defaultThumbnailUrl
if (_url) {
_url = _url.indexOf('?') !== -1 ? _url : _url + `&r=${new Date().getTime()}`
}
if (!thumbnail) return _url;
if (!this.checkIsUrl(thumbnail)) return HaloConfig.apiUrl + thumbnail;
return thumbnail
},
// 检查图片
checkImageUrl: function(image) {
if (!image) return HaloConfig.defaultImageUrl + `&r=${new Date().getTime()}`;
let _url = HaloConfig.defaultImageUrl
if (_url) {
_url = _url.indexOf('?') !== -1 ? _url : _url + `&r=${new Date().getTime()}`
}
if (!image) return _url;
if (!this.checkIsUrl(image)) return HaloConfig.apiUrl + image;
return image
},
@@ -46,7 +64,11 @@ const utils = {
checkAvatarUrl: function(avatar, isAdmin = false) {
if (isAdmin) return HaloConfig.author.avatar;
if (!avatar) {
return HaloConfig.defaultAvatarUrl + `&r=${new Date().getTime()}`;
let _url = HaloConfig.defaultAvatarUrl
if (_url) {
_url = _url.indexOf('?') !== -1 ? _url : _url + `&r=${new Date().getTime()}`
}
return _url;
}
if (!this.checkIsUrl(avatar)) return HaloConfig.apiUrl + avatar;
return avatar