快捷动作【REFILL】修复
This commit is contained in:
parent
2285b3f41e
commit
6234424aa6
@ -1,5 +1,13 @@
|
||||
# CHANGE
|
||||
|
||||
## 1.2.1
|
||||
|
||||
2024年04月03日
|
||||
|
||||
### 修改
|
||||
|
||||
- 快捷动作【REFILL】修复
|
||||
|
||||
## 1.2.0
|
||||
|
||||
2024年03月29日
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "wuhu-torn-helper",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"description": "芜湖助手",
|
||||
"scripts": {
|
||||
"release": "cross-env NODE_ENV=production rollup -c && node build.mjs",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -3,14 +3,14 @@
|
||||
<el-button-group class="wh-menu-button" style="z-index: 1000000;">
|
||||
<el-button circle @click="expanded = !expanded">
|
||||
<el-icon>
|
||||
<MoonNight />
|
||||
<MoonNight/>
|
||||
</el-icon>
|
||||
</el-button>
|
||||
<el-button v-for="item in globVars.buttons" @click="item.func">{{ item.txt }}</el-button>
|
||||
<el-button v-if="editableTabs.length > 0" circle @click="showDrawer">
|
||||
<el-badge :value="editableTabs.length" type="primary">
|
||||
<el-icon>
|
||||
<CopyDocument />
|
||||
<CopyDocument/>
|
||||
</el-icon>
|
||||
</el-badge>
|
||||
</el-button>
|
||||
@ -18,12 +18,12 @@
|
||||
<el-dialog v-model="drawer" :fullscreen="isMobilePhone" :lock-scroll="true" width="65%">
|
||||
<el-tabs v-model="editableTabsValue" closable style="margin-top: -1em" type="border-card" @tab-remove="removeTab">
|
||||
<el-tab-pane v-for="item in editableTabs" :key="item.name" :label="item.title" :name="item.name">
|
||||
<component :is="item.content" />
|
||||
<component :is="item.content"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-dialog>
|
||||
<el-drawer v-model="expanded" :show-close="false" :size="isMobilePhone ? '85%' : '30%'" class="whDrawer"
|
||||
:with-header="false" direction="rtl">
|
||||
:with-header="false" direction="rtl">
|
||||
<el-card :body-style="{ 'padding': '0' }" class="innerCard" style="margin-bottom: 0.5em">
|
||||
<template #header>
|
||||
<div>快捷动作</div>
|
||||
@ -69,11 +69,11 @@
|
||||
<el-icon>♻️</el-icon>
|
||||
<span>REFILL</span>
|
||||
</template>
|
||||
<el-menu-item @click="handleRefil('energyrefill2')">能量E
|
||||
<el-menu-item @click="handleRefil('refillEnergy')">能量E
|
||||
</el-menu-item>
|
||||
<el-menu-item @click="handleRefil('nerverefill2')">犯罪N
|
||||
<el-menu-item @click="handleRefil('refillNerve')">犯罪N
|
||||
</el-menu-item>
|
||||
<el-menu-item @click="handleRefil('casinotokens2')">赌场代币
|
||||
<el-menu-item @click="handleRefil('refillCasinoTokens')">赌场代币
|
||||
</el-menu-item>
|
||||
</el-sub-menu>
|
||||
</el-menu>
|
||||
@ -101,13 +101,13 @@
|
||||
<el-tooltip content="更新?" placement="bottom-start">
|
||||
<el-button link @click="menuClick({ title: '关于助手', template: UpdateDate })">芜湖助手
|
||||
<el-icon>
|
||||
<Refresh />
|
||||
<Refresh/>
|
||||
</el-icon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tag size="small" type="info">{{
|
||||
globVars.version.startsWith('$') ? 'dev' : 'v' + globVars.version
|
||||
}}
|
||||
globVars.version.startsWith('$') ? 'dev' : 'v' + globVars.version
|
||||
}}
|
||||
</el-tag>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -273,30 +273,39 @@ const editableTabsValue = ref('')
|
||||
const editableTabs = shallowRef([])
|
||||
|
||||
// refil
|
||||
const handleRefil = (method: 'nerverefill2' | 'energyrefill2' | 'casinotokens2') => {
|
||||
fetch(window.addRFC('https://www.torn.com/points.php?step=pointsbuy&action=' + method), {
|
||||
const handleRefil = (method: 'refillEnergy' | 'refillNerve' | 'refillCasinoTokens') => {
|
||||
fetch(window.addRFC("https://www.torn.com/page.php?sid=pointsBuildingExchange"), {
|
||||
"headers": {
|
||||
"accept": "text/plain, */*; q=0.01",
|
||||
"sec-ch-ua-mobile": "?0",
|
||||
"accept": "*/*",
|
||||
"accept-language": "zh-CN,zh;q=0.9",
|
||||
"sec-fetch-dest": "empty",
|
||||
"sec-fetch-mode": "cors",
|
||||
"sec-fetch-site": "same-origin",
|
||||
"x-requested-with": "XMLHttpRequest"
|
||||
},
|
||||
"referrer": "https://www.torn.com/points.php",
|
||||
"referrer": "https://www.torn.com/page.php?sid=points",
|
||||
"referrerPolicy": "strict-origin-when-cross-origin",
|
||||
"body": null,
|
||||
"method": "GET",
|
||||
"body": (() => {
|
||||
const data = new FormData();
|
||||
data.append('key', 'refillNerve');
|
||||
return data;
|
||||
})(),
|
||||
"method": "POST",
|
||||
"mode": "cors",
|
||||
"credentials": "include"
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(res => ElMessage({
|
||||
message: `<p>${res.msg}</p><p>剩余次数: ${res["refills"]}</p>`,
|
||||
type: res.state === 'done' ? 'success' : 'error',
|
||||
dangerouslyUseHTMLString: true
|
||||
}))
|
||||
.catch(e => ElMessage.error(e.toString))
|
||||
.then(res => res.json())
|
||||
.catch(e => ElMessage.error('REFILL异常: ' + e.toString))
|
||||
.then(res => {
|
||||
ElMessage({
|
||||
message: res.success ?
|
||||
`<p>成功</p><p>剩余次数: ${ res["specialRefills"] } 剩余点数: ${ res['points'] }</p>` :
|
||||
`REFILL异常: ${ res.error }`,
|
||||
type: res.success ? 'success' : 'error',
|
||||
dangerouslyUseHTMLString: true
|
||||
})
|
||||
throw new TypeError('REFILL异常: ' + res.error)
|
||||
})
|
||||
}
|
||||
|
||||
// fast travel
|
||||
@ -383,25 +392,25 @@ const travelConfirm = (destIndex: number, typeIndex: number) => {
|
||||
const destName = travelData[destIndex].cName;
|
||||
const typeName = ['普通飞机', 'PI飞机', '股票飞机', '商务飞机(机票或内衣店)'][typeIndex];
|
||||
ElMessageBox.confirm(
|
||||
'即将使用「' + typeName + '」飞往「' + destName + '」',
|
||||
'确认',
|
||||
{
|
||||
confirmButtonText: '好',
|
||||
cancelButtonText: '算了',
|
||||
type: 'info',
|
||||
}
|
||||
)
|
||||
.then(async () => {
|
||||
await quickFlyBtnHandler.directFly(destIndex, typeIndex);
|
||||
ElMessageBox.confirm('是否转跳页面?', '确认', {
|
||||
'即将使用「' + typeName + '」飞往「' + destName + '」',
|
||||
'确认',
|
||||
{
|
||||
confirmButtonText: '好',
|
||||
cancelButtonText: '算了',
|
||||
type: 'info'
|
||||
type: 'info',
|
||||
}
|
||||
).then(() => window.location.href = 'https://www.torn.com')
|
||||
.catch(() => null);
|
||||
})
|
||||
.catch(() => null);
|
||||
)
|
||||
.then(async () => {
|
||||
await quickFlyBtnHandler.directFly(destIndex, typeIndex);
|
||||
ElMessageBox.confirm('是否转跳页面?', '确认', {
|
||||
confirmButtonText: '好',
|
||||
cancelButtonText: '算了',
|
||||
type: 'info'
|
||||
}
|
||||
).then(() => window.location.href = 'https://www.torn.com')
|
||||
.catch(() => null);
|
||||
})
|
||||
.catch(() => null);
|
||||
};
|
||||
|
||||
const bazaarControl = {
|
||||
@ -411,23 +420,23 @@ const bazaarControl = {
|
||||
let response;
|
||||
try {
|
||||
response = await (await fetch(
|
||||
"https://www.torn.com/bazaar.php?sid=bazaarData&step=" + (isClose ? "closeBazaar" : "openBazaar"),
|
||||
{
|
||||
"headers": {
|
||||
"accept": "*/*",
|
||||
"sec-ch-ua-mobile": "?0",
|
||||
"sec-fetch-dest": "empty",
|
||||
"sec-fetch-mode": "cors",
|
||||
"sec-fetch-site": "same-origin",
|
||||
"x-requested-with": "XMLHttpRequest"
|
||||
},
|
||||
"referrer": "https://www.torn.com/bazaar.php",
|
||||
"referrerPolicy": "strict-origin-when-cross-origin",
|
||||
"body": null,
|
||||
"method": "GET",
|
||||
"mode": "cors",
|
||||
"credentials": "include"
|
||||
}
|
||||
"https://www.torn.com/bazaar.php?sid=bazaarData&step=" + (isClose ? "closeBazaar" : "openBazaar"),
|
||||
{
|
||||
"headers": {
|
||||
"accept": "*/*",
|
||||
"sec-ch-ua-mobile": "?0",
|
||||
"sec-fetch-dest": "empty",
|
||||
"sec-fetch-mode": "cors",
|
||||
"sec-fetch-site": "same-origin",
|
||||
"x-requested-with": "XMLHttpRequest"
|
||||
},
|
||||
"referrer": "https://www.torn.com/bazaar.php",
|
||||
"referrerPolicy": "strict-origin-when-cross-origin",
|
||||
"body": null,
|
||||
"method": "GET",
|
||||
"mode": "cors",
|
||||
"credentials": "include"
|
||||
}
|
||||
)).json();
|
||||
} catch (e) {
|
||||
logger.error(e.stack);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user