快捷动作【REFILL】修复

This commit is contained in:
Liwanyi 2024-04-03 09:33:54 +08:00
parent 2285b3f41e
commit 6234424aa6
4 changed files with 78 additions and 61 deletions

View File

@ -1,5 +1,13 @@
# CHANGE
## 1.2.1
2024年04月03日
### 修改
- 快捷动作【REFILL】修复
## 1.2.0
2024年03月29日

View File

@ -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

View File

@ -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,7 +18,7 @@
<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>
@ -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,7 +101,7 @@
<el-tooltip content="更新?" placement="bottom-start">
<el-button link @click="menuClick({ title: '关于助手', template: UpdateDate })">芜湖助手
<el-icon>
<Refresh />
<Refresh/>
</el-icon>
</el-button>
</el-tooltip>
@ -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',
.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
}))
.catch(e => ElMessage.error(e.toString))
})
throw new TypeError('REFILL异常: ' + res.error)
})
}
// fast travel