重置settings为undefined

This commit is contained in:
caishi 2021-03-31 14:35:23 +08:00
parent ecb1691b4d
commit c554d2c00d
2 changed files with 3 additions and 29 deletions

View File

@ -56,7 +56,7 @@ window._debugType = debugType;
export function initAxiosInterceptors(props) {
initOnlineOfflineListener();
var proxy = "http://localhost:3000";
proxy = "https://testforgeplus.trustie.net";
proxy = "http://192.168.1.37:3000";
const requestMap = {};
window.setfalseInRequestMap = function (keyName) {

View File

@ -403,39 +403,13 @@ class NewHeader extends Component {
visiblemyss: boll,
})
}
getAppdata = () => {
try {
var chromesettingArray = JSON.parse(localStorage.getItem('chromesetting'));
var chromesettingresponseArray = JSON.parse(localStorage.getItem('chromesettingresponse'));
this.setState({
settings: chromesettingArray
});
if (chromesettingArray.tab_logo_url) {
this.gettablogourldata(chromesettingresponseArray);
} else {
this.gettablogourlnull();
}
} catch (e) {
this.geturlsdata();
}
};
geturlsdata = () => {
let url = "/setting.json";
axios.get(url).then((response) => {
if (response && response.data) {
this.setState({ settings: response.data.setting });
// localStorage.setItem('chromesetting', JSON.stringify(response.data.setting));
// localStorage.setItem('chromesettingresponse', JSON.stringify(response));
try {
if (response.data.setting.tab_logo_url) {
this.gettablogourldata(response);
} else {
this.gettablogourlnull();
}
} catch (e) {
this.gettablogourlnull();
if (response.data.setting.tab_logo_url) {
this.gettablogourldata(response);
}
} else {
this.gettablogourlnull();