Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render() {
console.log('App.props:', this.props);
if (cookie.load(tokenKey) === undefined) {
console.log('X-Token is missing!');
/* message.error('请先登录系统!');
this.history.pushState(null, '/signin'); */
}
console.log('current user:', this.state.user);
const navMenu = this.state.user ? : '';
return (
<div>
<div>
{navMenu}
<div>
{this.props.children}
</div>
</div></div>
rehydrate(state) {
this.options = state.options;
this.lastVisit = state.lastVisit;
this.isFirstTime = state.isFirstTime;
this.version = state.version;
// TODO: Don't call this everytime.
if (reactCookie.load('isFirstTime') !== state.isFirstTime) {
reactCookie.save('isFirstTime', state.isFirstTime);
}
if (reactCookie.load('version') !== state.version) {
reactCookie.save('version', state.version.replace(/\"/g, '').replace(/\\/g, ''));
}
}
import { AUTH_USER } from './actions/types';
// Import stylesheets
import './public/stylesheets/base.scss';
// Initialize Google Analytics
ReactGA.initialize('UA-000000-01');
function logPageView() {
ReactGA.pageview(window.location.pathname);
}
const createStoreWithMiddleware = applyMiddleware(reduxThunk)(createStore);
const store = createStoreWithMiddleware(reducers);
const token = cookie.load('token');
if (token) {
// Update application state. User has token and is probably authenticated
store.dispatch({ type: AUTH_USER });
}
ReactDOM.render(
,
document.querySelector('.wrapper'));
}
},
routing: {
location: {
query
}
}
} = currentState)
} catch (ex) {
isInitialLoad = true
}
let nextUsfm = `${nextBook}.${nextChapter}`
if (!nextVersion) { nextVersion = cookie.load('version') || '1' }
if (!nextChapter) {
nextUsfm = (cookie.load('last_read') || 'JHN.1').split('.').slice(0, 2).join('.')
}
let parallelVersion
window.location.search.replace('?', '').split('&').forEach((kvPair) => {
const [ key, value ] = kvPair.split('=')
if (key.toLowerCase() === 'parallel') {
parallelVersion = parseInt(value.toString(), 10)
}
})
const hasVersionChanged = isInitialLoad || (currentVersion ? (nextVersion.toString() !== currentVersion.toString()) : true)
const hasChapterChanged = isInitialLoad || hasVersionChanged || (nextUsfm ? (nextUsfm.toLowerCase() !== currentUsfm.toLowerCase()) : true)
const hasParallelVersionChanged = isInitialLoad || ('parallel' in query && !!parallelVersion && (parallelVersion !== currentParallelVersionId))
if (!hasVersionChanged && !hasChapterChanged && !hasParallelVersionChanged && !force) {
callback()
render () {
let self = this;
let pageName = "Payment Setup";
let icon = "fa-credit-card-alt";
let spk = cookie.load("spk");
if(self.props.justPayment) {
return(
<div>
<div>
<div>
<div>
{self.state.form === 'credit_card' &&
<div></div>
}
</div>
</div>
</div>
</div>
export function putData(action, errorType, isAuthReq, url, dispatch, data) {
const requestUrl = API_URL + url;
let headers = {};
if (isAuthReq) {
headers = { headers: { Authorization: cookie.load('token') } };
}
axios.put(requestUrl, data, headers)
.then((response) => {
dispatch({
type: action,
payload: response.data,
});
})
.catch((error) => {
errorHandler(dispatch, error.response, errorType);
});
}
constructor(props){
super(props);
let uid = cookie.load("uid");
let username = cookie.load("username");
let serviceInstance = this.props.myInstance;
this.state = { loading: false,
uid: uid,
email: username,
serviceInstance: serviceInstance,
undo_cancel_url: false,
confirm_cancel_url: false,
reject_cancel_url: false,
current_modal: 'model_undo_cancel',
};
this.onUndoCancel = this.onUndoCancel.bind(this);
this.onConfirmCancel = this.onConfirmCancel.bind(this);
this.onRejectCancel = this.onRejectCancel.bind(this);
}
_refreshDeployments: function() {
this._refreshInProgress();
this._refreshPending();
this._refreshPast();
if (this.state.showHelptips && !cookie.load(this.state.user.id+'-onboarded') && cookie.load(this.state.user.id+'-deploymentID')) {
this._isOnBoardFinished(cookie.load(this.state.user.id+'-deploymentID'));
}
},
_refreshInProgress: function(page, per_page) {
clientInstance.interceptors.request.use((config) => {
const token = cookie.load('token');
if (token) {
config.headers = assign(config.headers, {
'Authorization': token
});
}
return config;
});
constructor(props){
super(props);
let uid = cookie.load("uid");
let username = cookie.load("username");
this.state = { loading: true,
nextInvoice : false,
currentUser: false,
url: `/api/v1/invoices/upcoming/${uid}`,
uid: uid,
email: username,
};
this.fetchNextInvoice = this.fetchNextInvoice.bind(this);
}