Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wechat-common
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
wechat-common
Commits
807785dd
Commit
807785dd
authored
Apr 06, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Plain Diff
feat:解决合并代码后的冲突
parents
8a8d5d07
e89731f4
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
132 additions
and
13 deletions
+132
-13
src/common/js/config.ts
+4
-4
src/domains/basic-domain/constants.ts
+4
-4
src/domains/basic-domain/upload.ts
+1
-1
src/index.tsx
+1
-1
src/modules/authorize/index.jsx
+3
-0
src/modules/authorize/index.less
+1
-0
src/modules/workWxAuthorize/index.jsx
+82
-0
src/modules/workWxAuthorize/index.less
+27
-0
src/routes/config/cloudClass.tsx
+9
-3
No files found.
src/common/js/config.ts
View file @
807785dd
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: zhangleyuan
* @Author: zhangleyuan
* @Date: 2021-01-05 10:55:02
* @Date: 2021-01-05 10:55:02
* @LastEditors: zhangleyuan
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-01-
05 11:02:06
* @LastEditTime: 2021-01-
18 21:18:52
* @Description: 描述一下
* @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -17,11 +17,11 @@
...
@@ -17,11 +17,11 @@
const
APP_ID_MAP
=
{
const
APP_ID_MAP
=
{
dev
:
'wx3ea60e78ddfa277e'
,
dev
:
'wx3ea60e78ddfa277e'
,
rc
:
'wx5c5a1fb71ecab7bc'
,
rc
:
'wx5c5a1fb71ecab7bc'
,
gray
:
'wx
e9f022ccb4d24a51
'
,
gray
:
'wx
3dda02036493ada6
'
,
prod
:
'wx
5098ed9a6e115469
'
prod
:
'wx
3dda02036493ada6
'
}
}
// 调试环境,默认dev
// 调试环境,默认dev
const
ENV
=
'
dev
'
;
const
ENV
=
'
prod
'
;
export
const
AppId
=
APP_ID_MAP
[
ENV
];
export
const
AppId
=
APP_ID_MAP
[
ENV
];
src/domains/basic-domain/constants.ts
View file @
807785dd
/*
/*
* @Author: 陈剑宇
* @Author: 陈剑宇
* @Date: 2020-05-07 14:43:01
* @Date: 2020-05-07 14:43:01
* @LastEditTime: 202
0-11-09 09:52:03
* @LastEditTime: 202
1-01-21 11:29:39
* @LastEditors:
吴文洁
* @LastEditors:
zhangleyuan
* @Description:
* @Description:
* @FilePath: /wheat-web-demo/src/domains/basic-domain/constants.ts
* @FilePath: /wheat-web-demo/src/domains/basic-domain/constants.ts
*/
*/
import
{
MapInterface
}
from
'@/domains/basic-domain/interface'
import
{
MapInterface
}
from
'@/domains/basic-domain/interface'
// 默认是 dev 环境
// 默认是 dev 环境
const
ENV
:
string
=
process
.
env
.
DEPLOY_ENV
||
'
dev
'
;
const
ENV
:
string
=
process
.
env
.
DEPLOY_ENV
||
'
prod
'
;
const
BASIC_HOST_MAP
:
MapInterface
=
{
const
BASIC_HOST_MAP
:
MapInterface
=
{
dev
:
'https://dev-heimdall.xiaomai5.com/'
,
dev
:
'https://dev-heimdall.xiaomai5.com/'
,
dev1
:
'https://dev1-heimdall.xiaomai5.com/'
,
dev1
:
'https://dev1-heimdall.xiaomai5.com/'
,
rc
:
'https://rc-heimdall.xiaomai5.com/'
,
rc
:
'https://rc-heimdall.xiaomai5.com/'
,
gray
:
'https://gray-heimdall.xiaomai5.com/'
,
gray
:
'https://gray-heimdall.xiaomai5.com/'
,
prod
:
'https://
gateway-
heimdall.xiaomai5.com/'
prod
:
'https://heimdall.xiaomai5.com/'
};
};
// axios headers config
// axios headers config
...
...
src/domains/basic-domain/upload.ts
View file @
807785dd
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-10-27 18:53:43
* @Date: 2020-10-27 18:53:43
* @LastEditors: zhangleyuan
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-01-
05 14:17:13
* @LastEditTime: 2021-01-
14 10:45:21
* @Description:
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
*/
...
...
src/index.tsx
View file @
807785dd
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-04-27 20:35:34
* @Date: 2020-04-27 20:35:34
* @LastEditors: zhangleyuan
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-0
1-05 17:37:20
* @LastEditTime: 2021-0
4-06 11:23:12
* @Description:
* @Description:
*/
*/
...
...
src/modules/authorize/index.jsx
View file @
807785dd
...
@@ -15,6 +15,9 @@ class Authorize extends React.Component {
...
@@ -15,6 +15,9 @@ class Authorize extends React.Component {
}
}
}
}
componentDidMount
()
{
componentDidMount
()
{
// console.log("ticket",window.getParameterByName('ticket'))
// const searchParams = this.props.location.search;
// const {code,ticket} = queryString.parse(searchParams);
const
code
=
window
.
getParameterByName
(
'code'
);
const
code
=
window
.
getParameterByName
(
'code'
);
const
ticket
=
window
.
getParameterByName
(
'ticket'
);
const
ticket
=
window
.
getParameterByName
(
'ticket'
);
this
.
setState
({
this
.
setState
({
...
...
src/modules/authorize/index.less
View file @
807785dd
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
.avatar-img{
.avatar-img{
width:16vw;
width:16vw;
height:16vw;
height:16vw;
border-radius:50%;
}
}
.login-btn{
.login-btn{
width: 91.2vw;
width: 91.2vw;
...
...
src/modules/workWxAuthorize/index.jsx
0 → 100644
View file @
807785dd
import
React
from
'react'
;
import
Service
from
'@/common/js/service'
;
import
'./index.less'
;
class
WorkWxAuthorize
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
scanState
:
''
,
messageText
:
''
}
}
componentDidMount
()
{
const
code
=
window
.
getParameterByName
(
'code'
);
if
(
!
code
){
this
.
workWechatAuthorize
();
}
else
{
this
.
workWechatLogin
();
}
}
workWechatLogin
=
()
=>
{
const
code
=
window
.
getParameterByName
(
'code'
);
const
ticket
=
window
.
getParameterByName
(
'ticket'
);
const
storeId
=
window
.
getParameterByName
(
'storeId'
);
Service
.
hades
(
"/anon/hades/wXWorkUserTicketLogin"
,
{
appTermEnum
:
'XIAOMAI_CLOUD_CLASS_PC_WEB_CUSTOMER'
,
code
,
ticket
,
storeId
},
(
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
setState
({
scanState
:
'success'
})
}
else
{
let
message
=
res
.
message
.
split
(
','
).
join
(
'<br />'
)
this
.
setState
({
scanState
:
'error'
,
messageText
:
message
})
}
})
}
workWechatAuthorize
=
()
=>
{
const
params
=
{}
Service
.
hades
(
'/anon/hades/getCorpTrainSuiteId'
,
params
).
then
((
res
)
=>
{
let
path
=
window
.
location
.
href
;
const
htmlUrl
=
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=
${
res
.
result
}
&redirect_uri=
${
encodeURIComponent
(
path
)}
&response_type=code&scope=snsapi_privateinfo&state=STATE#wechat_redirect`
window
.
location
.
href
=
htmlUrl
;
})
}
render
()
{
const
{
scanState
,
messageText
}
=
this
.
state
;
return
(
<
div
className=
"work-authorize-page"
>
<
div
className=
"box"
>
{
scanState
===
'success'
&&
<
div
className=
"success"
>
<
img
src=
"https://image.xiaomaiketang.com/xm/iRkcMHPHba.png"
alt=
""
/>
<
p
>
扫码成功
</
p
>
</
div
>
}
{
scanState
===
'error'
&&
<
div
className=
"error"
>
<
img
src=
"https://image.xiaomaiketang.com/xm/6kSAYFMm2r.png
"
alt=
""
/>
<
p
className=
'message'
>
{
messageText
}
</
p
>
</
div
>
}
</
div
>
</
div
>
)
}
}
export
default
WorkWxAuthorize
;
src/modules/workWxAuthorize/index.less
0 → 100644
View file @
807785dd
.work-authorize-page{
.box {
width: 100%;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: rgba(244, 246, 250, 1);
}
img{
width:60px;
}
p {
font-size: 17px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 24px;
margin-top: 12px;
}
.hide {
display: none;
text-align: center;
}
}
src/routes/config/cloudClass.tsx
View file @
807785dd
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-04-29 10:26:32
* @Date: 2020-04-29 10:26:32
* @LastEditors: zhangleyuan
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-0
1-05 10:23:51
* @LastEditTime: 2021-0
3-31 16:31:55
* @Description: 内容线路由配置
* @Description: 内容线路由配置
*/
*/
import
{
MenuConfig
}
from
'@/routes/interface'
;
import
{
MenuConfig
}
from
'@/routes/interface'
;
import
Authorize
from
'@/modules/authorize'
;
import
Authorize
from
'@/modules/authorize'
;
import
WorkWxAuthorize
from
'@/modules/workWxAuthorize'
;
const
CloudClassConfig
:
MenuConfig
=
{
const
CloudClassConfig
:
MenuConfig
=
{
key
:
'cloudClass'
,
key
:
'cloudClass'
,
name
:
'云课堂'
,
name
:
'云课堂'
,
...
@@ -19,7 +19,13 @@ const CloudClassConfig: MenuConfig = {
...
@@ -19,7 +19,13 @@ const CloudClassConfig: MenuConfig = {
name
:
'授权登录'
,
name
:
'授权登录'
,
path
:
'/wechat-authorize'
,
path
:
'/wechat-authorize'
,
component
:
Authorize
,
component
:
Authorize
,
}
},
{
key
:
'authorize'
,
name
:
'授权登录'
,
path
:
'/work-wechat-authorize'
,
component
:
WorkWxAuthorize
,
},
]
]
};
};
export
default
CloudClassConfig
;
export
default
CloudClassConfig
;
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