Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
changeComponent = (value, record, name, fieldRecord) => {//验证才有fieldRecord
if(!value) return ;
var originComponent = this.props.component.data.list.find(item => item.name == value);
var component = _.cloneDeep(originComponent);
if(originComponent.dependent == 0){
message.warning('不可添加非独立组件');
record[value] = '';
return ;
}
component.key = component.key || uuid();
component.origin_extra_field = [...component.extra_field];
component.extra_field = [];
let prevComponent = record.children[0];
let newComponent = {
...prevComponent,
...component,
};
record.children = [newComponent];
// this.change(value, record, name, fieldRecord);
// this.change(component, record, 'component', fieldRecord);//字段得有组件
copyZhihu = () => {
if (window.localStorage.getItem(CODE_NUM) === "0") {
message.warning('您当前使用的是微信主题,请切换其他主题后再试哦');
return;
}
const layout = document.getElementById(LAYOUT_ID); // 保护现场
const html = layout.innerHTML;
solveZhihuMath();
this.html = solveHtml();
copySafari(this.html);
message.success("已复制,请到知乎粘贴");
layout.innerHTML = html; // 恢复现场
};
api.request2({backendTags: params.tag}, (resJson) => {
console.log(resJson)
console.log(params.tag)
if (resJson["backendTags"].includes(params.tag)) {
message.success("Set Default backend success", 3)
} else {
message.warning("Set Default backend fail:" + resJson["backendTags"], 10)
}
}, (failStr) => {
message.error("Set Default backend fail:" + failStr, 10)
handleTestWebSite=url => {
if (!url) {
message.warning('请输入需测试网址');
return;
}
console.log('打开测试网页:', url);
chrome.runtime.sendMessage(targetExtensionId, { type: 'openTestWebSite', url }, WinId => {
console.log(WinId);
});
}
onClick={() => {
const success = shell.showItemInFolder(text);
if (!success) {
message.warning(i18n.translate('file original missing'));
}
}}
>
function* list({ params }) {
yield put({
type: types.express.START_GET_EXPRESS_LIST
})
const e = yield call(Fetch.fetch, { api: ExpressApi.list, params })
if (e.code === 0) {
yield put(saveList({ result: e.result, params }))
} else {
message.warning(e.msg)
}
}
postAdminPassword(dispatch, postAdminPasswordUrl(), {password: md5(password)}).then(res => {
const {postAdminPasswordData = []} = res;
if (!postAdminPasswordData.length) {
message.warning('密码不正确,重新输入!!!')
return;
}
const {password} = postAdminPasswordData[0];
sessionStorage.setItem('password', password)
this.setState({
isLogin: true
})
location.reload()
})
}
checkIsDownloadProject: function(id) {
let project = this.getProject(id);
let isDownloaded = !!(project && project.projectPath);
if (!isDownloaded) {
message.warning({
message: '请先下载app到本地'
});
}
return isDownloaded;
},
getProject: function(id) {
is_required: !!this.state.fromData.is_flexible,
msg:'请输入上/下班时间之前的弹性时间'
},
last_time:{
is_required: !!this.state.fromData.is_flexible,
msg:'请输入上/下班时间之后的弹性时间'
}
}
}[step];
const verifyKey = Object.keys(needVerifyData);
const len = verifyKey.length;
for(let i = 0;i < len ;i++){
const curKey = verifyKey[i];
const is_required = needVerifyData[curKey].is_required;
if(is_required && (this.state.fromData[curKey] + '').length <= 0){
message.warning(needVerifyData[curKey].msg);
return false;
}
}
return true;
}
changeStep(flag){
addMessage({ email, name, phone, content }) {
if (this.state.times > 3) {
message.warning('您今天留言的次数已经用完,明天再来留言吧!', 1);
return;
}
let now = new Date();
let nowTime = now.getTime();
if (nowTime - this.state.cacheTime < 60000) {
message.warning('您留言太过频繁,1 分钟后再来留言吧!', 1);
return;
}
this.setState({
isLoading: true,
});
https
.post(
urls.addMessage,
{