Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kus-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Кубота
kus-admin
Commits
bbb8d9d8
Commit
bbb8d9d8
authored
Jan 28, 2020
by
talequale
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
7f1e5cd8
c40f8176
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
20 deletions
+41
-20
index.js
index.js
+40
-19
Account.jsx
src/view/page/account/Account.jsx
+1
-1
No files found.
index.js
View file @
bbb8d9d8
...
@@ -115,17 +115,21 @@ var transformTSX = function(code, fileName, cb) {
...
@@ -115,17 +115,21 @@ var transformTSX = function(code, fileName, cb) {
//transformTSX('', 'aga', ()=>{})
//transformTSX('', 'aga', ()=>{})
var
sass
=
require
(
'node-sass'
);
var
sass
=
require
(
'node-sass'
);
var
transformServe
=
function
(
dir
,
anything
)
{
var
transformServe
=
function
(
dir
,
anything
)
{
let
f
ixedUrl
;
let
outerF
ixedUrl
;
let
serve
=
function
(
req
,
res
,
next
)
{
let
serve
=
function
(
req
,
res
,
next
)
{
var
qRes
=
res
;
var
qRes
=
res
;
let
fixedUrl
;
if
(
req
.
url
in
cache
)
{
if
(
req
.
url
in
cache
)
{
return
res
.
end
(
cache
[
req
.
url
])
return
res
.
end
(
cache
[
req
.
url
])
}
}
if
(
!
anything
){
if
(
!
anything
){
fixedUrl
=
req
.
url
;
fixedUrl
=
req
.
url
;
}
else
{
fixedUrl
=
arguments
[
3
];
}
}
if
(
fixedUrl
.
substr
(
-
5
)
===
'.scss'
){
if
(
fixedUrl
.
substr
(
-
5
)
===
'.scss'
){
// not secure
// not secure
//console.log('scss', dir, req.url, __dirname)
//console.log('scss', dir, req.url, __dirname)
...
@@ -133,7 +137,6 @@ var transformServe = function(dir, anything) {
...
@@ -133,7 +137,6 @@ var transformServe = function(dir, anything) {
if
(
err
){
if
(
err
){
next
();
next
();
}
else
{
}
else
{
console
.
log
(
req
.
url
)
if
(
pack
&&
pack
.
scss
&&
pack
.
scss
.
shared
){
if
(
pack
&&
pack
.
scss
&&
pack
.
scss
.
shared
){
data
=
pack
.
scss
.
shared
+
';
\
n'
+
data
;
data
=
pack
.
scss
.
shared
+
';
\
n'
+
data
;
}
}
...
@@ -165,8 +168,9 @@ var transformServe = function(dir, anything) {
...
@@ -165,8 +168,9 @@ var transformServe = function(dir, anything) {
if
(
err
){
if
(
err
){
var
origEnd
=
qRes
.
end
;
var
origEnd
=
qRes
.
end
;
qRes
.
end
=
function
(
data
)
{
qRes
.
end
=
function
(
data
)
{
qRes
.
end
=
origEnd
;
qRes
.
end
(
qRes
,
data
);
console
.
error
(
data
);
console
.
error
(
data
);
origEnd
.
call
(
qRes
,
data
)
};
};
done
(
new
Error
(
'Can not resolve dependency!'
))
done
(
new
Error
(
'Can not resolve dependency!'
))
}
else
{
thisOne
(
fName
,
res
+
''
)
}
}
else
{
thisOne
(
fName
,
res
+
''
)
}
...
@@ -229,7 +233,6 @@ var transformServe = function(dir, anything) {
...
@@ -229,7 +233,6 @@ var transformServe = function(dir, anything) {
}
}
});
});
}*/
else
if
(
fixedUrl
.
substr
(
-
4
)
===
'.svg'
)
{
}*/
else
if
(
fixedUrl
.
substr
(
-
4
)
===
'.svg'
)
{
console
.
log
(
'Serve svg'
,
dir
,
req
.
url
)
fs
.
readFile
(
path
.
join
(
dir
,
fixedUrl
),
function
(
err
,
data
){
fs
.
readFile
(
path
.
join
(
dir
,
fixedUrl
),
function
(
err
,
data
){
if
(
err
){
if
(
err
){
next
();
next
();
...
@@ -275,23 +278,39 @@ var transformServe = function(dir, anything) {
...
@@ -275,23 +278,39 @@ var transformServe = function(dir, anything) {
return
serve
(
req
,
res
,
next
);
return
serve
(
req
,
res
,
next
);
};
};
let
types
=
'scss,jsx,svg'
.
split
(
','
)
let
test
=
0
;
return
function
(
req
,
res
,
next
)
{
let
iterate
=
function
(
req
,
res
,
next
)
{
let
types
=
'scss,jsx,svg'
.
split
(
','
)
fixedUrl
=
req
.
url
+
'.'
+
types
[
test
];
let
test
=
0
;
serve
(
req
,
res
,
function
()
{
let
iterate
=
function
()
{
if
(
test
<
types
.
length
){
let
outerFixedUrl
=
req
.
url
+
'.'
+
types
[
test
];
test
++
;
serve
(
req
,
res
,
function
()
{
iterate
(
req
,
res
,
next
);
}
else
{
if
(
test
<
types
.
length
){
next
();
console
.
log
(
'try serve'
,
outerFixedUrl
);
test
=
0
;
test
++
;
}
iterate
();
});
}
else
{
next
();
test
=
0
;
}
},
outerFixedUrl
);
};
iterate
();
};
};
return
iterate
;
};
};
var
count
=
0
;
var
list
=
[];
app
.
use
(
function
(
req
,
res
,
next
)
{
setTimeout
(
function
()
{
//res.end('{}')
},
1000
)
next
();
});
app
.
use
(
transformServe
(
'src'
));
app
.
use
(
transformServe
(
'src'
));
var
lives
=
[];
var
lives
=
[];
...
@@ -321,7 +340,9 @@ app.use(App.static(dir(pack.src)))
...
@@ -321,7 +340,9 @@ app.use(App.static(dir(pack.src)))
app
.
use
(
transformServe
(
'src'
,
true
));
app
.
use
(
transformServe
(
'src'
,
true
));
app
.
use
(
function
(
req
,
res
,
next
)
{
console
.
error
(
'Not serving'
,
req
.
url
);
});
const
util
=
require
(
'util'
);
const
util
=
require
(
'util'
);
const
readFile
=
util
.
promisify
(
fs
.
readFile
);
const
readFile
=
util
.
promisify
(
fs
.
readFile
);
...
...
src/view/page/account/Account.jsx
View file @
bbb8d9d8
...
@@ -6,7 +6,7 @@ export default D.declare('view.page.Account', ()=>
...
@@ -6,7 +6,7 @@ export default D.declare('view.page.Account', ()=>
<
div
>
<
div
>
Hello,
{
store
.
val
(
'account.name'
)
}
Hello,
{
store
.
val
(
'account.name'
)
}
<
Info
img=
{
<
img
src=
"baba1"
/>
}
buttons=
{
<
button
>
bb
</
button
>
}
>
<
Info
img=
{
<
img
/>
}
buttons=
{
<
button
>
bb
</
button
>
}
>
<
h1
>
olololo
</
h1
>
<
h1
>
olololo
</
h1
>
</
Info
>
</
Info
>
</
div
>
</
div
>
...
...
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