Commit ae2a58d0 authored by 愚道's avatar 愚道 Committed by 偏右

rebase and fix review issue

parent 6d0a622f
......@@ -118,7 +118,7 @@ function getFakeList(req, res) {
const result = fakeList(count);
sourceData = result;
res.json(result);
return res.json(result);
}
function postFakeList(req, res) {
......@@ -150,7 +150,7 @@ function postFakeList(req, res) {
break;
}
res.json(result);
return res.json(result);
}
const getNotice = [
......@@ -318,7 +318,7 @@ const getActivities = [
];
function getFakeCaptcha(req, res) {
res.json('captcha-xxx');
return res.json('captcha-xxx');
}
export default {
......
......@@ -2,11 +2,11 @@ import city from './geographic/city.json';
import province from './geographic/province.json';
function getProvince(req, res) {
res.json(province);
return res.json(province);
}
function getCity(req, res) {
res.json(city[req.params.province]);
return res.json(city[req.params.province]);
}
export default {
......
const getNotices = (req, res) => {
const getNotices = (req, res) =>
res.json([
{
id: '000000001',
......@@ -93,7 +93,6 @@ const getNotices = (req, res) => {
type: '待办',
},
]);
};
export default {
'GET /api/notices': getNotices,
......
......@@ -72,7 +72,7 @@ function getRule(req, res, u) {
},
};
res.json(result);
return res.json(result);
}
function postRule(req, res, u, b) {
......@@ -129,7 +129,7 @@ function postRule(req, res, u, b) {
},
};
res.json(result);
return res.json(result);
}
export default {
......
......@@ -12,6 +12,24 @@ const updateTheme = primaryColor => {
return;
}
const hideMessage = message.loading('正在编译主题!', 0);
function buildIt() {
if (!window.less) {
return;
}
setTimeout(() => {
window.less
.modifyVars({
'@primary-color': primaryColor,
})
.then(() => {
hideMessage();
})
.catch(() => {
message.error('Failed to update theme');
hideMessage();
});
}, 200);
}
if (!lessNodesAppended) {
const lessStyleNode = document.createElement('link');
const lessConfigNode = document.createElement('script');
......@@ -38,24 +56,6 @@ const updateTheme = primaryColor => {
} else {
buildIt();
}
function buildIt() {
if (!window.less) {
return;
}
setTimeout(() => {
window.less
.modifyVars({
'@primary-color': primaryColor,
})
.then(() => {
hideMessage();
})
.catch(() => {
message.error('Failed to update theme');
hideMessage();
});
}, 200);
}
};
const updateColorWeak = colorWeak => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment