reza changed qr tail

master
RezaAshrafi77 3 years ago
parent 6d0e852267
commit 6f05664810
  1. 7
      src/AppRouter.js
  2. 5
      src/views/QR/index.js

@ -98,7 +98,12 @@ class AppRouter extends Component {
<Redirect <Redirect
to={{ to={{
pathname: "/qr", pathname: "/qr",
search: "?id=" + window.location.pathname, search:
"?id=" +
window.location.pathname.slice(
window.location.pathname.lastIndexOf("/") + 1,
window.location.pathname.length
),
}} }}
/> />
</Route> </Route>

@ -50,10 +50,7 @@ class QR extends Component {
componentDidMount() { componentDidMount() {
if (window.location.search) { if (window.location.search) {
let tail = window.location.search.slice( let tail = window.location.search;
window.location.search.lastIndexOf("/") + 1,
window.location.search.length
);
this.props.info({ tail: tail }); this.props.info({ tail: tail });
} }
} }

Loading…
Cancel
Save