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

rebase and fix review issue

parent 6d0a622f
...@@ -118,7 +118,7 @@ function getFakeList(req, res) { ...@@ -118,7 +118,7 @@ function getFakeList(req, res) {
const result = fakeList(count); const result = fakeList(count);
sourceData = result; sourceData = result;
res.json(result); return res.json(result);
} }
function postFakeList(req, res) { function postFakeList(req, res) {
...@@ -150,7 +150,7 @@ function postFakeList(req, res) { ...@@ -150,7 +150,7 @@ function postFakeList(req, res) {
break; break;
} }
res.json(result); return res.json(result);
} }
const getNotice = [ const getNotice = [
...@@ -318,7 +318,7 @@ const getActivities = [ ...@@ -318,7 +318,7 @@ const getActivities = [
]; ];
function getFakeCaptcha(req, res) { function getFakeCaptcha(req, res) {
res.json('captcha-xxx'); return res.json('captcha-xxx');
} }
export default { export default {
......
...@@ -2,11 +2,11 @@ import city from './geographic/city.json'; ...@@ -2,11 +2,11 @@ import city from './geographic/city.json';
import province from './geographic/province.json'; import province from './geographic/province.json';
function getProvince(req, res) { function getProvince(req, res) {
res.json(province); return res.json(province);
} }
function getCity(req, res) { function getCity(req, res) {
res.json(city[req.params.province]); return res.json(city[req.params.province]);
} }
export default { export default {
......
const getNotices = (req, res) => { const getNotices = (req, res) =>
res.json([ res.json([
{ {
id: '000000001', id: '000000001',
...@@ -93,7 +93,6 @@ const getNotices = (req, res) => { ...@@ -93,7 +93,6 @@ const getNotices = (req, res) => {
type: '待办', type: '待办',
}, },
]); ]);
};
export default { export default {
'GET /api/notices': getNotices, 'GET /api/notices': getNotices,
......
...@@ -72,7 +72,7 @@ function getRule(req, res, u) { ...@@ -72,7 +72,7 @@ function getRule(req, res, u) {
}, },
}; };
res.json(result); return res.json(result);
} }
function postRule(req, res, u, b) { function postRule(req, res, u, b) {
...@@ -129,7 +129,7 @@ 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 { export default {
......
...@@ -12,6 +12,24 @@ const updateTheme = primaryColor => { ...@@ -12,6 +12,24 @@ const updateTheme = primaryColor => {
return; return;
} }
const hideMessage = message.loading('正在编译主题!', 0); 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) { if (!lessNodesAppended) {
const lessStyleNode = document.createElement('link'); const lessStyleNode = document.createElement('link');
const lessConfigNode = document.createElement('script'); const lessConfigNode = document.createElement('script');
...@@ -38,24 +56,6 @@ const updateTheme = primaryColor => { ...@@ -38,24 +56,6 @@ const updateTheme = primaryColor => {
} else { } else {
buildIt(); 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 => { 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