Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit78e3ae0

Browse files
committed
fix(router): user page subPath
1 parent2beba95 commit78e3ae0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎pages/user.js‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
makeGQClient,
1414
queryStringToJSON,
1515
nilOrEmpty,
16-
getSubPath,
16+
parseURL,
1717
pagedFilter,
1818
ssrAmbulance,
1919
parseTheme,
@@ -47,7 +47,8 @@ async function fetchData(props, opt) {
4747
consttoken=realname ?getJwtToken(props) :null
4848
constgqClient=makeGQClient(token)
4949
constuserHasLogin=nilOrEmpty(token)===false
50-
constlogin=R.toLower(getSubPath(props))
50+
const{ subPath}=parseURL(props)
51+
constlogin=R.toLower(subPath)
5152

5253
constsessionState=gqClient.request(P.sessionState)
5354
constuser=gqClient.request(P.user,{ login, userHasLogin})
@@ -69,6 +70,7 @@ export default class UserPage extends React.Component {
6970
const{ asPath}=props
7071

7172
constquery=queryStringToJSON(asPath)
73+
const{ subPath}=parseURL(props)
7274

7375
letresp
7476
try{
@@ -77,7 +79,7 @@ export default class UserPage extends React.Component {
7779
if(ssrAmbulance.hasLoginError(errors)){
7880
resp=awaitfetchData(props,{realname:false})
7981
}else{
80-
return{statusCode:404,target:getSubPath(props)}
82+
return{statusCode:404,target:subPath}
8183
}
8284
}
8385

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp