Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pro-blocks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
pro-blocks
Commits
ae2a58d0
Commit
ae2a58d0
authored
Aug 29, 2018
by
愚道
Committed by
偏右
Aug 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rebase and fix review issue
parent
6d0a622f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
27 deletions
+26
-27
mock/api.js
mock/api.js
+3
-3
mock/geographic.js
mock/geographic.js
+2
-2
mock/notices.js
mock/notices.js
+1
-2
mock/rule.js
mock/rule.js
+2
-2
src/models/setting.js
src/models/setting.js
+18
-18
No files found.
mock/api.js
View file @
ae2a58d0
...
@@ -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
);
re
turn
re
s
.
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
);
re
turn
re
s
.
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
'
);
re
turn
re
s
.
json
(
'
captcha-xxx
'
);
}
}
export
default
{
export
default
{
...
...
mock/geographic.js
View file @
ae2a58d0
...
@@ -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
);
re
turn
re
s
.
json
(
province
);
}
}
function
getCity
(
req
,
res
)
{
function
getCity
(
req
,
res
)
{
res
.
json
(
city
[
req
.
params
.
province
]);
re
turn
re
s
.
json
(
city
[
req
.
params
.
province
]);
}
}
export
default
{
export
default
{
...
...
mock/notices.js
View file @
ae2a58d0
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
,
...
...
mock/rule.js
View file @
ae2a58d0
...
@@ -72,7 +72,7 @@ function getRule(req, res, u) {
...
@@ -72,7 +72,7 @@ function getRule(req, res, u) {
},
},
};
};
res
.
json
(
result
);
re
turn
re
s
.
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
);
re
turn
re
s
.
json
(
result
);
}
}
export
default
{
export
default
{
...
...
src/models/setting.js
View file @
ae2a58d0
...
@@ -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
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment