mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-09 10:43:44 +08:00
geek payment notify api is ready
This commit is contained in:
@@ -139,9 +139,15 @@ const routes = [
|
||||
{
|
||||
path: '/admin/login',
|
||||
name: 'admin-login',
|
||||
meta: {title: 'Geek-AI 控制台登录'},
|
||||
meta: {title: '控制台登录'},
|
||||
component: () => import('@/views/admin/Login.vue'),
|
||||
},
|
||||
{
|
||||
path: '/payReturn',
|
||||
name: 'pay-return',
|
||||
meta: {title: '支付回调'},
|
||||
component: () => import('@/views/PayReturn.vue'),
|
||||
},
|
||||
{
|
||||
name: 'admin',
|
||||
path: '/admin',
|
||||
|
||||
@@ -106,6 +106,12 @@
|
||||
|
||||
</div>
|
||||
|
||||
<el-dialog v-model="showDialog" :show-close=false hide-footer width="auto">
|
||||
<div style="padding-bottom: 10px">
|
||||
<el-button type="success" @click="payCallback(true)">支付成功</el-button>
|
||||
<el-button type="danger" @click="payCallback(false)">支付失败</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -143,6 +149,7 @@ const payWays = ref([])
|
||||
const vipInfoText = ref("")
|
||||
const store = useSharedStore()
|
||||
const profileKey = ref(0)
|
||||
const showDialog = ref(false)
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
@@ -193,8 +200,9 @@ const pay = (product, payWay) => {
|
||||
user_id: user.value.id,
|
||||
device: "jump"
|
||||
}).then(res => {
|
||||
window.open(res.data, '_blank');
|
||||
window.open(res.data, '_blank');
|
||||
loading.value = false
|
||||
showDialog.value = true
|
||||
}).catch(e => {
|
||||
setTimeout(() => {
|
||||
ElMessage.error("生成支付订单失败:" + e.message)
|
||||
@@ -210,6 +218,13 @@ const redeemCallback = (success) => {
|
||||
}
|
||||
}
|
||||
|
||||
const payCallback = (success) => {
|
||||
showDialog.value = false
|
||||
if (success) {
|
||||
profileKey.value += 1
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
|
||||
13
web/src/views/PayReturn.vue
Normal file
13
web/src/views/PayReturn.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
支付回调
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {useRouter} from "vue-router";
|
||||
|
||||
const router = useRouter()
|
||||
console.log(router.currentRoute.value.query)
|
||||
window.close()
|
||||
</script>
|
||||
Reference in New Issue
Block a user