Skip to content

Commit

Permalink
修复登陆,再更加保险一点
Browse files Browse the repository at this point in the history
  • Loading branch information
zythum committed Feb 17, 2018
1 parent f927156 commit 4c48128
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "weibotuchuang",
"productName": "围脖是个好图床",
"version": "0.0.7",
"version": "0.0.8",
"description": "围脖是个好图床",
"main": "src/main.js",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function doUpload (cookies, files) {
weiboLogin((err, cookies) => {
storage.set('weibo_cookies', cookies)
updateMenu()
doUpload(cookies, files)
})
})
return
Expand Down Expand Up @@ -415,6 +416,7 @@ function updateMenu () {
weiboLogin((err, cookies) => {
storage.set('weibo_cookies', cookies)
updateMenu()
notify('微博已登陆成功!', { body: '上传图片请拖拽图片到菜单栏图片' })
})
}
})
Expand Down
6 changes: 3 additions & 3 deletions src/weiboLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { URL } = require('url')
const { noop, md5 } = require('./utils')

const WEIBO_BASE = 'https://weibo.com'
const SUCCESS_URL = '/weibo_is_a_good_image_bed'
const SUCCESS_URL = '/aj/static/weibo_is_a_good_image_bed.html'
const LOGIN_URL = '/aj/static/upimgback.html'

const cookieString = cookies => {
Expand Down Expand Up @@ -122,7 +122,7 @@ const INSERT_CSS = `
const EXECUTE_JAVASCRIPT = `;(function () {
var help = document.createElement('div')
help.className = 'help'
help.innerHTML = '微博登陆加载中...'
help.innerHTML = '微博登陆组件加载中...'
help.onclick = doLogin
document.body.insertBefore(help, document.body.firstChild)
Expand Down Expand Up @@ -151,7 +151,7 @@ const EXECUTE_JAVASCRIPT = `;(function () {
loginSuccessUrl: '${WEIBO_BASE + SUCCESS_URL}'
});
setTimeout(function () {
help.innerHTML = '<a href="javascropt:;">点击我,完成微博登陆</a>'
help.innerHTML = '<a href="javascropt:;">点击我,完成微博登陆</a>';
}, 1000);
}
}());`

0 comments on commit 4c48128

Please sign in to comment.