import React from 'react'; import * as ycore from 'ycore' import * as antd from 'antd' import * as Icons from '@ant-design/icons'; import jwt from 'jsonwebtoken' import styles from './style.less' import MainFeed from '../../components/MainFeed'; const UserData = ycore.userData() export default class __m extends React.Component { constructor(props){ super(props), this.state = { s_id: '', coninfo: 'Getting info...', s_token: '', s_ses: '' }; } componentDidMount() { if (ycore.IsThisUser.dev() == false || ycore.IsThisUser.admin() == false) { return ycore.crouter.native('main') } this.handleSID() this.handleToken() } handleSID(){ ycore.get_app_session.get_id((err, response)=> { if (err){ return ycore.notifyError(err) } this.setState({ s_id: response}) }) } handleToken(){ const a = ycore.handlerYIDT.getRaw() const b = jwt.decode(a) this.setState({ s_token: b}) {ycore.ValidLoginSession(res => { this.setState({s_ses: res}) })} } DescompileSDCP(){ let result = {}; for (var i = 0; i < UserData.length; i++) { result[UserData[i].key] = UserData[i].value; } console.log([result]) } render() { const arrayOfSDCP = Object.entries(UserData).map((e) => ( { [e[0]]: e[1] } )); const { UserID, UserToken, expiresIn } = this.state.s_token const { ValidSDCP, ValidCookiesToken, final } = this.state.s_ses const AddDummy = {id: "3", publisher: {id: "1"},post_id: "1", user_id: "48", recipient_id: "0", postText: "New by ID Dummy Payload"} return (
Raw => {JSON.stringify(this.state.s_token)}
UID => {UserID}
Session Token => {UserToken}
expiresIn => {expiresIn}
ValidSDCP => {JSON.stringify(ValidSDCP)}
ValidCookiesToken => {JSON.stringify(ValidCookiesToken)}
Valid? => {JSON.stringify(final)}