Skip to content

Commit

Permalink
fixed bug touno server.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvgamerr committed Jul 15, 2019
1 parent 60b0f8e commit 8fb8ded
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 24 deletions.
41 changes: 30 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions src/plugins/ehentai.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ const logs = (...msg) => {
let allCookie = []
const jarCookieSession = () => allCookie.map(cookie => cookie.split(';')[0]).join('; ')

const exHentaiHistory = (uri, data) => touno.api({
url: uri,
data: data
})
const exHentaiHistory = (uri, data) => {
return {
url: uri,
data: data
}
}

let getFilename = (index, total) => {
return `${Math.pow(10, (total.toString().length - index.toString().length) + 1).toString().substr(2, 10) + index}`
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as hentai from './ehentai.js'
import Q from 'q'

const settings = require('electron-settings')
const touno = require('./config')
// const touno = require('./config')
const isDev = process.env.NODE_ENV === 'development'
console.log('development:', isDev)
// process.env.NODE_ENV === 'development'
Expand All @@ -26,10 +26,10 @@ export function server (mainWindow) {
ipcMain.on('URL_VERIFY', function (e, url) {
hentai.init(url, e.sender).then(async manga => {
// Request Send Manga
await touno.api({
url: '/exhentai',
data: {}
})
// await touno.api({
// url: '/exhentai',
// data: {}
// })

e.sender.send('URL_VERIFY', { error: false, data: manga })
}).catch(ex => {
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -391,16 +391,16 @@
config.guest = readFileSync(join(appDir, vm.folder.id), 'utf-8').toString()
}
let res = config.guest ? await vm.TounoIO(`exhentai/user`, { g: config.guest }) : { data: { error: true } }
let res = config.guest ? { data: { error: true } } : { data: { error: true } }
if (res.data.error) {
let { data } = await vm.TounoIO('exhentai/user')
let { data } = { data: {} }
vm.sign.nickname = data.guest
vm.ConfigSaved({
user_id: data.guest,
nickname: data.guest
})
await vm.TounoIO('exhentai/user/register', { guest: data.guest })
await vm.TounoIO(`exhentai/user`, { g: data.guest })
// await vm.TounoIO('exhentai/user/register', { guest: data.guest })
// await vm.TounoIO(`exhentai/user`, { g: data.guest })
// write file in ./ > g_78ca1b844c
let dir = join(appDir)
if (!existsSync(dir)) mkdirSync(dir)
Expand Down

0 comments on commit 8fb8ded

Please sign in to comment.