From 0c87c271c87ce47c17421e4da49fe7f185093ec0 Mon Sep 17 00:00:00 2001 From: tmrwdao-zz Date: Thu, 11 Dec 2025 17:58:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20bp=20team=20info=20add?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/request/api-server.ts | 1 + src/app/network-dao/vote/KeyInTeamInfo/index.js | 11 ++++++----- src/app/network-dao/vote/[path]/_page.jsx | 4 +++- src/hooks/useGetToken.ts | 1 + 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/api/request/api-server.ts b/src/api/request/api-server.ts index 32ade809..317e64d8 100644 --- a/src/api/request/api-server.ts +++ b/src/api/request/api-server.ts @@ -17,6 +17,7 @@ const authList = [ '/discussion/new-comment', 'networkdao/contract/add', 'networkdao/contract/update', + 'networkdao/vote/addTeamDesc', ...tmrwNeedAuthList, ...telegramNeedAuthList, ]; diff --git a/src/app/network-dao/vote/KeyInTeamInfo/index.js b/src/app/network-dao/vote/KeyInTeamInfo/index.js index 733d8e4a..9e3a162b 100644 --- a/src/app/network-dao/vote/KeyInTeamInfo/index.js +++ b/src/app/network-dao/vote/KeyInTeamInfo/index.js @@ -310,7 +310,7 @@ class KeyInTeamInfo extends PureComponent { const { currentWallet } = this.props; apiServer.get("/networkdao/vote/getTeamDesc", { - publicKey: currentWallet.publicKey, + publicKey: currentWallet.publicKey || localStorage.getItem('currentPublicKey'), chainId: chain.chainId }) .then((res) => { @@ -385,17 +385,18 @@ class KeyInTeamInfo extends PureComponent { console.log('currentWallet.address', currentWallet.address) + const _publicKey = publicKey || localStorage.getItem('currentPublicKey'); apiServer.post("/networkdao/vote/addTeamDesc", { chainId: chain.chainId, isActive: true, - publicKey, + publicKey: _publicKey, address: currentWallet.address, random: randomNum, signature, ...submitValues, }).then((res) => { - if (res.code === '2000') { - this.props.navigate(`/vote/team?pubkey=${publicKey}`); + if (res.code === '20000') { + this.props.navigate(`/vote/team?pubkey=${_publicKey}`); } else { toast.error(res.msg); } @@ -436,4 +437,4 @@ const KeyInTeamInfoConnect = connect(mapStateToProps)((KeyInTeamInfo)); export default function WrapKeyInTeamInfo(props) { const router = useNetworkDaoRouter() return -} \ No newline at end of file +} diff --git a/src/app/network-dao/vote/[path]/_page.jsx b/src/app/network-dao/vote/[path]/_page.jsx index 56db04cf..c7ec978b 100644 --- a/src/app/network-dao/vote/[path]/_page.jsx +++ b/src/app/network-dao/vote/[path]/_page.jsx @@ -454,7 +454,9 @@ class VoteContainer extends Component { } async getCandidateInfo(currentWallet, electionContract) { - const { publicKey, address } = currentWallet; + const { publicKey: publicKeyFromWallet, address } = currentWallet; + const publicKeyLocal = localStorage.getItem('currentPublicKey'); + const publicKey = publicKeyFromWallet || publicKeyLocal; if (!publicKey && !address) { return null; } diff --git a/src/hooks/useGetToken.ts b/src/hooks/useGetToken.ts index 037c3848..8a16385e 100644 --- a/src/hooks/useGetToken.ts +++ b/src/hooks/useGetToken.ts @@ -132,6 +132,7 @@ export const useGetToken = () => { source = 'portkey'; } } + localStorage.setItem('currentPublicKey', publicKey); // ------------------------------------- request api ------------------------------------- const reqParams = { grant_type: 'signature',