Skip to content

Commit

Permalink
Merge pull request #12 from YaoZeyuan/fix_error
Browse files Browse the repository at this point in the history
Fix error
  • Loading branch information
YaoZeyuan authored Mar 1, 2020
2 parents b76b9b1 + 9b836ae commit 96d0b85
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

# 软件下载

最新版本: 1.6.0
最新版本: 1.7.0

[点击下载-win](http://stablog.bookflaneur.cn/release/%E7%A8%B3%E9%83%A8%E8%90%BD%20Setup%201.6.1.exe)
[点击下载-win](http://stablog.bookflaneur.cn/release/%E7%A8%B3%E9%83%A8%E8%90%BD%20Setup%201.7.0.exe)

[点击下载-mac](http://stablog.bookflaneur.cn/release/%E7%A8%B3%E9%83%A8%E8%90%BD-1.6.0.dmg)

Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.7.0

1. 解决用户未登录问题. 现在账号被封的微博 id 也能通过稳部落备份微博记录了(感谢知乎网友@孙老师 的帮助)
2. 添加打开电子书所在目录按钮, 方便用户找到电子书所在位置
3. 微博备份的截至日期默认值修改成始终为当前日期的下一天, 方便用户使用

# 1.6.0

1. 解决 mac 上不能生成 pdf 文件问题
Expand Down
13 changes: 11 additions & 2 deletions gui/src/view/customer_task/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
<el-form-item label="操作">
<el-button type="primary" @click="asyncHandleStartTask">开始备份</el-button>
<el-button type="success" @click="asyncData()">同步用户信息</el-button>
<el-button type="primary" @click="openOutputDir">打开电子书所在目录</el-button>
<el-button type="danger" @click="asyncCheckUpdate">检查更新</el-button>
</el-form-item>
</el-form>
Expand Down Expand Up @@ -297,15 +298,19 @@ export default Vue.extend({
mergeCount: 1000,
fetchStartAtPageNo: 0,
fetchEndAtPageNo: 100000,
outputStartAtMs: moment('2010-01-01 00:00:00').unix() * 1000,
outputStartAtMs: moment('2001-01-01 00:00:00').unix() * 1000,
outputEndAtMs:
moment()
.add(1, 'year')
.add(1, 'day')
.unix() * 1000,
}
try {
taskConfig = JSON.parse(jsonContent)
} catch (e) {}
// 始终重置为次日
taskConfig.outputEndAtMs = moment()
.add(1, 'day')
.unix() * 1000
this.database.taskConfig = taskConfig
if (this.database.taskConfig.configList.length === 0) {
this.database.taskConfig.configList.push(_.clone(defaultConfigItem))
Expand Down Expand Up @@ -401,6 +406,10 @@ export default Vue.extend({
// 将面板切换到log上
this.$emit('update:currentTab', 'log')
},
async openOutputDir() {
// 打开电子书存储目录
ipcRenderer.sendSync('openOutputDir')
},
matchTaskId(content: string) {
let parseResult = querystring.parseUrl(content)
let rawId = ''
Expand Down
4 changes: 4 additions & 0 deletions gui/src/view/manage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -364,5 +364,9 @@ export default {
// 所有元素顶部对齐
vertical-align: top;
}
.weibo-raw-item{
// 禁止点a标签跳转(跳过去就回不来了)
pointer-events: none;
}
}
</style>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stablog",
"version": "1.6.0",
"version": "1.7.0",
"description": "稳部落. 专业备份微blog, 老铁, 稳!",
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion src/config/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ let config = CommonUtil.getConfig()

class Request {
static timeoutMs = 20 * 1000
static ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36'
static ua =
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36'
static cookie = _.get(config, ['request', 'cookie'], '')
}
export default Request
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ ipcMain.on('start', async (event, taskConfigList) => {
isRunning = false
})

ipcMain.on('openOutputDir', async event => {
shell.showItemInFolder(PathConfig.outputPath)
event.returnValue = true
return
})

ipcMain.on('startCustomerTask', async event => {
if (isRunning) {
event.returnValue = '目前尚有任务执行, 请稍后'
Expand Down
4 changes: 2 additions & 2 deletions src/library/util/config_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import _ from 'lodash'

class ConfigHelper {
// 重新载入配置文件
static reloadConfig () {
static reloadConfig() {
let config = CommonUtil.getConfig()
RequestConfig.cookie = _.get(config, ['config', 'cookie'], '')
RequestConfig.cookie = _.get(config, ['request', 'cookie'], '')
}
}

Expand Down

0 comments on commit 96d0b85

Please sign in to comment.