Merge commit 'fcf1d45522e3ba6e6faf2590b60f2db1ef90e73c' into dev_jacy
This commit is contained in:
@@ -13,7 +13,8 @@ import BillsPage from './pages/BillsPage';
|
||||
import ReshipPage from './pages/ReshipPage';
|
||||
import WeeklyReportPage from './pages/WeeklyReportPage';
|
||||
import LeaderboardPage from './pages/LeaderboardPage';
|
||||
import { handlePartnerWechatCallback, savePartnerWechatAuth } from './lib/wechat-auth';
|
||||
import { handlePartnerWechatCallback, handlePartnerWechatLoginResult } from './lib/wechat-auth';
|
||||
import { isLoggedIn } from './lib/api';
|
||||
import { isWechatEnv } from './lib/weixin';
|
||||
|
||||
function WechatOAuthHandler() {
|
||||
@@ -25,7 +26,7 @@ function WechatOAuthHandler() {
|
||||
if (location.pathname === '/login') return;
|
||||
void handlePartnerWechatCallback()
|
||||
.then((result) => {
|
||||
if (!result || !savePartnerWechatAuth(result)) return;
|
||||
if (!result || !handlePartnerWechatLoginResult(result)) return;
|
||||
const params = new URLSearchParams(location.search);
|
||||
params.delete('code');
|
||||
params.delete('state');
|
||||
@@ -59,7 +60,7 @@ export default function App() {
|
||||
<Route path="/leaderboard" element={<LeaderboardPage />} />
|
||||
<Route path="/stores/:id" element={<StoreDetailPage />} />
|
||||
<Route path="/orders/:id" element={<OrderDetailPage />} />
|
||||
<Route path="*" element={<Navigate to="/" replace />} />
|
||||
<Route path="*" element={<Navigate to={isLoggedIn() ? '/' : '/login'} replace />} />
|
||||
</Routes>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user