Skip to content

Commit 10df392

Browse files
authored
充值,续费等跳转官网 (#142)
* 充值,续费等跳转官网 * 书写规范 * 解决build报错
1 parent 4edf3e7 commit 10df392

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

src/api/auth.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { customFetch } from '@/utils/customFetch'
2+
3+
// 获取跳转官网的 temp_auth_token
4+
export function get_plugin_tmp_token() {
5+
return customFetch('/bizyair/auth/plugin_tmp_token', {
6+
method: 'POST',
7+
credentials: 'include'
8+
})
9+
}

src/views/btnProfile/DialogInfo.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@
223223
import { useI18n } from 'vue-i18n'
224224
import { computed } from 'vue'
225225
import { useConfirm } from '@/components/modules/vConfirm'
226+
import { get_plugin_tmp_token } from '@/api/auth'
226227
227228
useI18n()
228229
const statusStore = useStatusStore()
@@ -284,7 +285,11 @@
284285
cancelText: '取消',
285286
continueText: '前往 bizyair.cn'
286287
})
287-
if (res) window.open('https://bizyair.cn/user/topup', '_blank')
288+
if (res) {
289+
const tmp_token = await get_plugin_tmp_token()
290+
// window.open(`http://localhost:3000/user/topup?tmp_auth=${tmp_token.data.token}`, '_blank')
291+
window.open(`https://bizyair.cn/user/topup?tmp_token=${tmp_token.data.token}`, '_blank')
292+
}
288293
}
289294
290295
const handleRenewClick = async () => {
@@ -294,7 +299,11 @@
294299
cancelText: '取消',
295300
continueText: '前往 bizyair.cn'
296301
})
297-
if (res) window.open('https://bizyair.cn/user/topup', '_blank')
302+
if (res) {
303+
const tmp_token = await get_plugin_tmp_token()
304+
// window.open(`http://localhost:3000/user/topup?tmp_auth=${tmp_token.data.token}`, '_blank')
305+
window.open(`https://bizyair.cn/user/topup?tmp_token=${tmp_token.data.token}`, '_blank')
306+
}
298307
}
299308
</script>
300309
<style scoped lang="less">

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.72
1+
1.2.74

0 commit comments

Comments
 (0)