feat(h5): unify WeChat OAuth under m.runxian.top path routing

Serve user/shop/partner H5 under /user/, /shop/, /partner/ on a single authorized domain; update nginx, SSL script, and router base paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-07 22:07:47 +08:00
parent e32ccebc80
commit eb961c3a74
19 changed files with 178 additions and 68 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import type { ClientRuntimeConfig, WechatLoginResult } from '@dukang/shared-types';
import { isWxAuthorizeEnabled } from '@dukang/shared-types';
import { toAppPath } from '@dukang/weixin-sdk';
import { isWechatEnv, weixinSdk } from './weixin';
import { request, saveSession, type UserProfile } from './api';
@@ -48,5 +49,5 @@ export async function authorizeWechatForPay(): Promise<WechatLoginResult | void>
}
export function buildLoginReturnUrl(pathname: string, search: string) {
return `/login?return=${encodeURIComponent(`${pathname}${search}`)}`;
return `${toAppPath('/login')}?return=${encodeURIComponent(`${pathname}${search}`)}`;
}
+2 -1
View File
@@ -1,12 +1,13 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';
import { getRouterBasename } from '@dukang/weixin-sdk';
import App from './App';
import './styles.css';
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<BrowserRouter>
<BrowserRouter basename={getRouterBasename()}>
<App />
</BrowserRouter>
</React.StrictMode>,
+1
View File
@@ -3,6 +3,7 @@ import react from '@vitejs/plugin-react';
import path from 'path';
export default defineConfig({
base: '/user/',
plugins: [react()],
resolve: {
alias: {