diff --git a/.env.development b/.env.development index 4aab0f5..6bbcda6 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,7 @@ VITE_PORT=9100 VITE_PUBLIC_PATH=/ # 跨域代理,可以配置多个,请注意不要换行 - VITE_PROXY=[["/server","http://localhost:9000"]] + VITE_PROXY=[["/server","http://localhost:10880"]] # API 接口地址 VITE_GLOB_API_URL= diff --git a/.env.production b/.env.production index 254f0da..5e25a52 100644 --- a/.env.production +++ b/.env.production @@ -1,5 +1,5 @@ # 独立部署模式 -VITE_PUBLIC_PATH = /h5 +VITE_PUBLIC_PATH = / # API 接口前缀 VITE_GLOB_API_URL_PREFIX = /api diff --git a/eslint.config.js b/eslint.config.js index f21091d..cf68b60 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -57,5 +57,13 @@ export default antfu({ 'node/prefer-global/process': 'off', // 对所有控制语句强制执行一致的大括号样式,(只有一行的时候eslint默认是不需要大括号的,这样会降低代码清晰度) 'curly': ['error', 'all'], + // 'indent': 'off', + // 'vue/script-indent': [ + // 'error', + // 2, + // { + // baseIndent: 1, + // }, + // ], }, }) diff --git a/src/router/index.ts b/src/router/index.ts index 21b9439..bb92f41 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,6 +1,6 @@ import type { App } from 'vue' import type { RouteRecordRaw } from 'vue-router' -import { createRouter, createWebHashHistory } from 'vue-router' +import { createRouter, createWebHashHistory, createWebHistory } from "vue-router"; import { createRouterGuards } from './router-guards' import { ErrorPageRoute, routeModuleList } from '@/router/base' import { useRouteStoreWidthOut } from '@/store/modules/route' @@ -24,7 +24,8 @@ routeStore.setMenus(routeModuleList) routeStore.setRouters(constantRouter.concat(routeModuleList)) const router = createRouter({ - history: createWebHashHistory(''), + // 重定向时hash模式可能无法跳转,需要使用history模式 + history: createWebHistory(''), routes: constantRouter.concat(...routeModuleList), strict: true, scrollBehavior: () => ({ left: 0, top: 0 }), diff --git a/src/views/daxpay/channel/ChannelAuth.api.ts b/src/views/daxpay/channel/ChannelAuth.api.ts new file mode 100644 index 0000000..9f3d469 --- /dev/null +++ b/src/views/daxpay/channel/ChannelAuth.api.ts @@ -0,0 +1,28 @@ +import { http } from '@/utils/http/axios' +import type { Result } from '#/axios' + +/** + * 通过AuthCode获取并设置认证结果 + * @param param + */ +export function authAndSet(param: AuthCodeParam) { + return http.request({ + url: '/unipay/assist/channel/auth/authAndSet', + method: 'POST', + data: param, + }) +} + +/** + * 通道认证参数 + */ +export interface AuthCodeParam { + // 通道 + channel?: string + // 标识码 + authCode?: string + // 查询Code + queryCode?: string + // 应用号 + appId?: string +} diff --git a/src/views/daxpay/channel/alipay/AlipayAuthCallback.vue b/src/views/daxpay/channel/alipay/AlipayAuthCallback.vue index 69da841..96f8920 100644 --- a/src/views/daxpay/channel/alipay/AlipayAuthCallback.vue +++ b/src/views/daxpay/channel/alipay/AlipayAuthCallback.vue @@ -1,5 +1,6 @@ @@ -7,6 +8,7 @@ import { useRoute } from 'vue-router' const route = useRoute() + const {appId, channel, queryCode, aliAppId} = route.params console.log(appId, channel) diff --git a/src/views/daxpay/channel/wechat/WechatAuthCallback.vue b/src/views/daxpay/channel/wechat/WechatAuthCallback.vue index 423a2b9..15d4a4a 100644 --- a/src/views/daxpay/channel/wechat/WechatAuthCallback.vue +++ b/src/views/daxpay/channel/wechat/WechatAuthCallback.vue @@ -1,13 +1,37 @@ - - + +