Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
biz.qingxiao.com
Project
Project
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
wangxuelai
biz.qingxiao.com
Commits
61575590
Commit
61575590
authored
Aug 23, 2019
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
''
parent
625c66fa
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
81 additions
and
177 deletions
+81
-177
.webpackrc.js
.webpackrc.js
+1
-1
index.html
index.html
+2
-29
CallStudents.js
src/components/CallStudents.js
+1
-1
callstudents.js
src/models/callstudents.js
+1
-1
login.js
src/models/login.js
+1
-112
register.js
src/models/register.js
+1
-0
schoollist.js
src/models/schoollist.js
+1
-1
webapp.js
src/models/webapp.js
+60
-22
index.js
src/pages/404/index.js
+1
-1
SjdIndex.js
src/pages/SjdIndex.js
+7
-7
EditClassModal.js
src/pages/classmgt/EditClassModal.js
+1
-0
router.js
src/router.js
+2
-2
login.js
src/services/login.js
+1
-0
register.js
src/services/register.js
+1
-0
No files found.
.webpackrc.js
View file @
61575590
...
...
@@ -20,7 +20,7 @@ export default {
],
"theme"
:
{
"primary-color"
:
"#1890FF"
,
"imagepath"
:
process
.
env
.
NODE_ENV
!
==
'production'
?
"'https://cdn.img.shangjiadao.cn/qingxiao/biz/image/'"
:
"'http://localhost:80/image/'"
,
"imagepath"
:
process
.
env
.
NODE_ENV
==
'production'
?
"'https://cdn.img.shangjiadao.cn/qingxiao/biz/image/'"
:
"'http://localhost:80/image/'"
,
},
es5ImcompatibleVersions
:
true
,
"proxy"
:
{
...
...
index.html
View file @
61575590
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
轻校
</title>
<link
rel=
"shortcut icon"
href=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/image/qxlogo4.png"
>
<meta
content=
"width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0;"
name=
"viewport"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<!-- Polyfills -->
<!--[if lt IE 10]>
<!DOCTYPE html>
<html
lang=
"en"
><head><meta
charset=
"UTF-8"
><title>
轻校
</title><link
rel=
"shortcut icon"
href=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/image/qxlogo4.png"
><meta
content=
"width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0;"
name=
"viewport"
><meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<!-- Polyfills --><!--[if lt IE 10]>
<script src="js/console-polyfill.js"></script>
<![endif]-->
<script
charset=
"utf-8"
src=
"https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"
></script>
<link
href=
"/dist/index.css?1566523768377"
rel=
"stylesheet"
>
<script
src=
"/lib/vendor.dll.js?3"
charset=
"utf-8"
></script>
<script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/console-polyfill.js?3"
charset=
"utf-8"
></script>
<script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es6-shim.min.js?3"
charset=
"utf-8"
></script>
<script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-shim.js?3"
charset=
"utf-8"
></script>
<script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-sham.min.js?3"
charset=
"utf-8"
></script>
<script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/json3.min.js?3"
charset=
"utf-8"
></script>
<script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/html5shiv.min.js?3"
charset=
"utf-8"
></script>
<script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/polyfill.js?3"
charset=
"utf-8"
></script>
</head>
<body>
<div
id=
"root"
></div>
<script
src=
"/dist/index.js?1566523768377"
charset=
"utf-8"
></script>
</body>
</html>
\ No newline at end of file
<![endif]-->
<script
charset=
"utf-8"
src=
"https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"
></script><link
href=
"/dist/index.css?1566539046840"
rel=
"stylesheet"
><script
src=
"/lib/vendor.dll.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/console-polyfill.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es6-shim.min.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-shim.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-sham.min.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/json3.min.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/html5shiv.min.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/polyfill.js?3"
charset=
"utf-8"
></script></head><body><div
id=
"root"
></div><script
src=
"/dist/index.js?1566539046840"
charset=
"utf-8"
></script></body></html>
\ No newline at end of file
src/components/CallStudents.js
View file @
61575590
...
...
@@ -315,7 +315,7 @@ class CallStudentsForm extends React.Component {
render
:
(
text
,
record
,
index
)
=>
{
return
(
<
div
className
=
{
pageStyle
.
classNamebox
}
>
{
record
.
surplus
}
课时
{
(
record
.
surplus
)
||
0
}
课时
<
/div
>
);
},
...
...
src/models/callstudents.js
View file @
61575590
...
...
@@ -318,7 +318,7 @@ export default {
ELE
.
remark
=
decodeURIComponent
(
ele
.
remark
);
ELE
.
name
=
ele
.
formal_school_student
.
name
;
ELE
.
mobile
=
ele
.
formal_school_student
.
mobile
;
ELE
.
surplus
=
ele
.
surplus
;
ELE
.
surplus
=
(
ele
.
student_course
&&
ele
.
student_course
.
surplus
)
||
0
;
callStudentOperateList
.
push
(
ELE
);
});
yield
put
({
...
...
src/models/login.js
View file @
61575590
...
...
@@ -42,55 +42,6 @@ export default {
},
});
},
*
generateteacherqrcode
({
payload
},
{
call
,
put
})
{
// eslint-disable-line
yield
put
({
type
:
'generateQrcodeFunction'
,
payload
:
{
needQuery
:
false
,
},
});
},
*
generateQrcodeFunction
({
payload
},
{
call
,
put
})
{
const
{
needQuery
}
=
payload
;
const
randomString
=
getRandomString
();
const
Qrcode
=
yield
call
(
commonAjax
.
generateQrcode
,
{
scene
:
`code=
${
randomString
}
`
,
page
:
'src/pages/teacherpclogin/index'
,
});
if
(
Qrcode
.
data
.
url
)
{
yield
put
({
type
:
'updateState'
,
payload
:
{
randomString
,
generateing
:
false
,
teacherLoginQrcode
:
Qrcode
.
data
.
url
,
generateSuccess
:
true
,
},
});
if
(
!
needQuery
)
return
;
let
loginStatusCheck
=
true
;
while
(
loginStatusCheck
)
{
const
teachertoken
=
yield
call
(
login
.
getTeachertoken
,
{
code
:
randomString
});
if
(
teachertoken
.
data
.
token
)
{
// 成功了
loginStatusCheck
=
false
;
LocalStorage
.
setItem
(
'teacher'
,
{
token
:
teachertoken
.
data
.
token
,
});
}
yield
delay
(
3000
);
}
}
else
{
yield
put
({
type
:
'updateState'
,
payload
:
{
randomString
,
generateing
:
false
,
teacherLoginQrcode
:
''
,
generateSuccess
:
false
,
},
});
}
},
*
fetch
({
payload
},
{
call
,
put
})
{
// eslint-disable-line
yield
put
({
type
:
'save'
});
},
...
...
@@ -142,6 +93,7 @@ export default {
id
:
(
newLoginData
.
data
.
business
&&
newLoginData
.
data
.
business
.
id
)
||
0
,
memberId
:
(
newLoginData
.
data
.
business
&&
newLoginData
.
data
.
business
.
member_id
)
||
0
,
mobile
:
(
newLoginData
.
data
.
business
&&
newLoginData
.
data
.
business
.
mobile
)
||
''
,
expiresDateTime
:
newLoginData
.
data
.
expiresDateTime
||
''
,
nickname
:
(
newLoginData
.
data
.
business
&&
newLoginData
.
data
.
business
.
nickname
)
||
''
,
});
message
.
success
(
'登录成功!'
,
1
);
...
...
@@ -180,69 +132,6 @@ export default {
}
setTimeout
(
loadmessage
);
},
*
tabshift
({
payload
},
{
call
,
put
,
select
})
{
const
{
type
}
=
payload
;
const
{
teacherLoginQrcode
,
randomString
}
=
yield
select
(
state
=>
state
.
login
);
yield
put
({
type
:
'updateState'
,
payload
:
{
tabtype
:
type
,
},
});
if
(
type
==
1
)
{
if
(
teacherLoginQrcode
==
''
)
{
// 重新生成qrcode
yield
put
({
type
:
'generateQrcodeFunction'
,
payload
:
{
needQuery
:
true
,
},
});
}
else
{
// 直接调用轮询接口
let
loginStatusCheck
=
true
;
while
(
loginStatusCheck
)
{
const
teachertoken
=
yield
call
(
login
.
getTeachertoken
,
{
code
:
randomString
});
if
(
teachertoken
.
data
.
token
)
{
// 成功了
loginStatusCheck
=
false
;
LocalStorage
.
setItem
(
'teacher'
,
{
token
:
teachertoken
.
data
.
token
,
});
LocalStorage
.
setItem
(
'dakarole'
,
2
);
yield
put
({
type
:
'webapp/updateState'
,
payload
:
{
dakarole
:
2
,
},
});
const
teachersSchools
=
yield
call
(
users
.
teachersSchools
);
if
(
teachersSchools
.
data
.
list
.
length
>
0
)
{
LocalStorage
.
setItem
(
'sid'
,
teachersSchools
.
data
.
list
[
0
].
id
);
yield
put
({
type
:
'updateState'
,
payload
:
{
logining
:
false
,
},
});
yield
put
({
type
:
'webapp/updateState'
,
payload
:
{
sid
:
teachersSchools
.
data
.
list
[
0
].
id
,
},
});
yield
put
(
routerRedux
.
push
({
pathname
:
'/sjd/indexstaic'
,
}));
}
else
{
// yield put(routerRedux.push({
// pathname: '/sjd/schooladd',
// }));
}
}
yield
delay
(
3000
);
}
}
}
},
*
goregister
({
payload
},
{
put
})
{
yield
put
(
routerRedux
.
push
({
pathname
:
'/register'
,
...
...
src/models/register.js
View file @
61575590
...
...
@@ -80,6 +80,7 @@ export default {
memberId
:
(
newLoginData
.
data
.
business
&&
newLoginData
.
data
.
business
.
member_id
)
||
0
,
mobile
:
(
newLoginData
.
data
.
business
&&
newLoginData
.
data
.
business
.
mobile
)
||
''
,
nickname
:
(
newLoginData
.
data
.
business
&&
newLoginData
.
data
.
business
.
nickname
)
||
''
,
expiresDateTime
:
newLoginData
.
data
.
expiresDateTime
||
''
,
});
message
.
success
(
'注册成功!'
,
1
);
yield
put
({
...
...
src/models/schoollist.js
View file @
61575590
...
...
@@ -53,7 +53,7 @@ export default {
*
goSchoolSystem
({
payload
},
{
call
,
put
,
select
})
{
const
{
school
,
sid
}
=
payload
;
LocalStorage
.
setItem
(
'sid'
,
sid
||
school
.
id
);
LocalStorage
.
setItem
(
'role'
,
school
.
school_teacher
?
school
.
school_teacher
.
type
:
''
);
LocalStorage
.
setItem
(
'role'
,
school
.
school_teacher
?
school
.
school_teacher
.
type
:
5
);
if
(
school
.
school_teacher
)
{
LocalStorage
.
setItem
(
'rootMap'
,
rootMap
.
rootMap
);
}
else
{
...
...
src/models/webapp.js
View file @
61575590
import
{
routerRedux
}
from
'dva/router'
;
import
queryString
from
'query-string'
;
import
{
message
}
from
'antd'
;
import
{
message
,
Modal
}
from
'antd'
;
import
{
delay
}
from
'redux-saga'
;
import
errorcode
from
'../common/errorcode'
;
import
menuConfig
from
'../common/menuconfig'
;
...
...
@@ -55,6 +55,54 @@ export default {
return
history
.
listen
(({
pathname
,
search
,
query
,
})
=>
{
const
user
=
LocalStorage
.
getItem
(
'user'
);
const
departmentid
=
LocalStorage
.
getItem
(
'departmentid'
);
const
role
=
LocalStorage
.
getItem
(
'role'
);
const
rootMap
=
LocalStorage
.
getItem
(
'rootMap'
);
const
sid
=
LocalStorage
.
getItem
(
'sid'
);
let
userUserful
=
true
;
if
(
!
user
||
!
user
.
token
||
(
new
Date
()).
getTime
()
>
user
.
expiresDateTime
*
1000
)
{
userUserful
=
false
;
}
else
{
userUserful
=
true
;
if
(
pathname
==
'/login'
)
{
dispatch
(
routerRedux
.
replace
({
pathname
:
'/schoollist'
,
}));
}
}
if
([
'/joinschooladd'
,
'/schoollist'
,
'/schooladd'
,
'/usersetting'
].
indexOf
(
pathname
)
!=
-
1
||
pathname
.
indexOf
(
'sjd'
)
!=
-
1
)
{
if
(
!
userUserful
)
{
// 检测已sjd开头的url或者headquarters开头的路由
Modal
.
warn
({
title
:
'登录信息丢失,请重新登录'
,
onOk
:
()
=>
{
dispatch
(
routerRedux
.
replace
({
pathname
:
'/login'
,
}));
localStorage
.
clear
();
},
});
return
;
}
}
console
.
log
(
role
===
null
,
'role === null'
);
if
(
pathname
.
indexOf
(
'sjd'
)
!=
-
1
&&
pathname
.
indexOf
(
'headquarters'
)
==
-
1
)
{
if
(
!
role
||
!
rootMap
||
!
sid
)
{
dispatch
(
routerRedux
.
replace
({
pathname
:
'/schoollist'
,
}));
return
;
}
}
if
(
pathname
.
indexOf
(
'headquarters'
)
!=
-
1
)
{
if
(
!
departmentid
)
{
dispatch
(
routerRedux
.
replace
({
pathname
:
'/schoollist'
,
}));
return
;
}
}
// 监听路由变化 判断缓存是否存在 实现路由守卫的功能
if
(
pathname
.
indexOf
(
'headquarters'
)
==
-
1
)
{
dispatch
({
type
:
'updateState'
,
...
...
@@ -87,31 +135,13 @@ export default {
},
});
if
(
pathname
===
'/login'
)
{
dispatch
({
type
:
'webapp/judgeexpire'
,
payload
:
{
isLogin
:
true
,
},
});
dispatch
({
type
:
'login/generateteacherqrcode'
,
});
console
.
log
(
'/login'
);
}
if
(
pathname
===
'/register'
)
{
dispatch
({
type
:
'webapp/judgeexpire'
,
payload
:
{
isLogin
:
false
,
},
});
console
.
log
(
'/register'
);
}
if
(
pathname
===
'/resetpsd'
)
{
dispatch
({
type
:
'webapp/judgeexpire'
,
payload
:
{
isLogin
:
false
,
},
});
console
.
log
(
'/resetpsd'
);
}
if
(
pathname
===
'/sjd/registerinfo'
)
{
dispatch
({
...
...
@@ -577,6 +607,14 @@ export default {
type
:
'thememgt/pageInit'
,
});
},
*
onPageEnter
({
payload
},
{
put
,
call
,
select
})
{
console
.
log
(
'dddddddddddd'
);
const
{
pathname
}
=
payload
;
console
.
log
(
pathname
,
'pathname'
);
yield
put
({
type
:
'updateState'
,
});
},
*
judgeexpire
({
payload
},
{
put
,
call
,
select
})
{
// const webapp = yield select(state => state.webapp);
// const { userInfo } = webapp;
...
...
src/pages/404/index.js
View file @
61575590
...
...
@@ -14,7 +14,7 @@ class Errorpage extends React.Component {
<
div
>
<
h1
className
=
"fade"
>
温馨提示:您访问的地址不存在!
<
/h1
>
<
p
className
=
"fade"
>
你正在寻找的页面无法找到。
<
a
style
=
{{
opacity
:
'1'
}}
className
=
"link"
href
=
"#/sjd/
activemanager
"
>
返回首页
<
/a
>
<
a
style
=
{{
opacity
:
'1'
}}
className
=
"link"
href
=
"#/sjd/
indexstaic
"
>
返回首页
<
/a
>
<
/p
>
<
/div
>
<
/div
>
...
...
src/pages/SjdIndex.js
View file @
61575590
...
...
@@ -39,11 +39,11 @@ class SjdIndex extends React.Component {
const
{
collapsed
,
location
,
userInfo
,
showExpired
,
menuDrawerShow
,
screenIsBig
,
}
=
this
.
props
;
let
hasRoot
=
false
;
if
((
LocalStorage
.
getItem
(
'user'
)
&&
LocalStorage
.
getItem
(
'user'
).
token
)
||
(
LocalStorage
.
getItem
(
'teacher'
)
&&
LocalStorage
.
getItem
(
'teacher'
).
token
))
{
hasRoot
=
true
;
}
const
redirectDom
=
(
<
Redirect
to
=
{{
pathname
:
'/login'
,
state
:
{
from
:
location
}
}}
/>
)
;
//
let hasRoot = false;
//
if ((LocalStorage.getItem('user') && LocalStorage.getItem('user').token) || (LocalStorage.getItem('teacher') && LocalStorage.getItem('teacher').token)) {
//
hasRoot = true;
//
}
//
const redirectDom = (<Redirect to={{ pathname: '/login', state: { from: location } }} />);
let
contentMarginLeft
=
0
;
let
paddingRight
=
20
;
let
paddingLeft
=
20
;
...
...
@@ -116,9 +116,9 @@ class SjdIndex extends React.Component {
<
/Modal
>
<
/div
>
);
const
renderDom
=
hasRoot
?
mainDom
:
redirectDom
;
//
const renderDom = hasRoot ? mainDom : redirectDom;
return
(
render
Dom
main
Dom
);
}
}
...
...
src/pages/classmgt/EditClassModal.js
View file @
61575590
...
...
@@ -215,6 +215,7 @@ class EditClassModal extends React.Component {
pattern
:
/^
[
1-9
]\d
*$/
,
message
:
'请输入大于0的整数'
,
},
// { required: true, message: '上课次数不能为空' },
],
})(
<
InputNumber
placeholder
=
"请输入上课次数"
style
=
{{
width
:
'100%'
}}
/>
)
}
<
/Form.Item
>
...
...
src/router.js
View file @
61575590
...
...
@@ -153,7 +153,7 @@ function RouterConfig({ history }) {
path
=
"/sjd"
render
=
{()
=>
(
<
SjdIndex
>
<
Route
path
=
"/sjd/officialweb"
exact
component
=
{
Officialweb
}
/
>
<
Route
path
=
"/sjd/officialweb"
config
=
{{
needAuth
:
true
}}
exact
component
=
{
Officialweb
}
/
>
<
Route
path
=
"/sjd/officialwebeditor"
exact
component
=
{
OfficialwebEditor
}
/
>
<
Route
path
=
"/sjd"
exact
render
=
{()
=>
(
<
Redirect
to
=
"/sjd/indexstaic"
/>
)}
/
>
<
Route
path
=
"/sjd/404"
exact
component
=
{
Errorpage
}
/
>
...
...
@@ -184,7 +184,7 @@ function RouterConfig({ history }) {
<
Route
path
=
"/register"
exact
component
=
{
Register
}
/
>
<
Route
path
=
"/resetpsd"
exact
component
=
{
ResetPsd
}
/
>
<
Route
path
=
"/usersetting"
exact
component
=
{
UserSetting
}
/
>
<
Route
render
=
{()
=>
(
<
Errorpage
/>
)}
/
>
<
Route
path
=
"/404"
render
=
{()
=>
(
<
Errorpage
/>
)}
/
>
<
/Switch
>
<
/Router
>
<
/LocaleProvider
>
...
...
src/services/login.js
View file @
61575590
...
...
@@ -6,6 +6,7 @@ export function login(params) {
return
request
({
url
:
`
${
api
.
login
}
`
,
method
:
'POST'
,
needAuth
:
false
,
data
,
});
}
...
...
src/services/register.js
View file @
61575590
...
...
@@ -7,6 +7,7 @@ export function register(params) {
url
:
`
${
api
.
userRegister
}
`
,
method
:
'POST'
,
data
,
needAuth
:
false
,
});
}
export
function
getVerifyCode
(
params
)
{
...
...
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