Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
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
xiaomai-cloud-class-web
Commits
18e64979
Commit
18e64979
authored
Aug 01, 2021
by
zhujian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
60bcf37b
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
25 deletions
+30
-25
config/env.js
+1
-1
package.json
+2
-2
public/h5.html
+2
-1
src/common/js/axios.ts
+2
-2
src/domains/brand/constants.ts
+18
-14
src/index.tsx
+2
-2
src/modules/root/WechatLogin.tsx
+3
-3
No files found.
config/env.js
View file @
18e64979
...
...
@@ -72,7 +72,7 @@ function getClientEnvironment(publicUrl) {
// Useful for determining whether we’re running in production mode.
// Most importantly, it switches React into the correct mode.
NODE_ENV
:
process
.
env
.
NODE_ENV
||
'development'
,
BR
END
:
process
.
env
.
BRE
ND
||
'xiaomai'
,
BR
AND
:
process
.
env
.
BRA
ND
||
'xiaomai'
,
DEPLOY_ENV
:
process
.
env
.
DEPLOY_ENV
,
// Useful for resolving the correct path to static assets in `public`.
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
...
...
package.json
View file @
18e64979
...
...
@@ -125,14 +125,14 @@
"command"
:
"node scripts/start.js"
,
"env"
:
{
"DEPLOY_ENV"
:
""
,
"BR
E
ND"
:
"syoo"
"BR
A
ND"
:
"syoo"
}
},
"build:syoo"
:
{
"command"
:
"node scripts/build.js"
,
"env"
:
{
"DEPLOY_ENV"
:
"prod"
,
"BR
E
ND"
:
"syoo"
"BR
A
ND"
:
"syoo"
}
}
},
...
...
public/h5.html
View file @
18e64979
...
...
@@ -104,11 +104,12 @@
const
appTermEnum
=
getParameterByName
(
'appTermEnum'
);
const
code
=
getParameterByName
(
'code'
);
const
ticket
=
getParameterByName
(
'ticket'
);
const
corpType
=
getParameterByName
(
'corpType'
);
if
(
!
code
)
{
postJSON
(
'hades/anon/hades/getCorpTrainSuiteId'
,
{},
(
res
)
=>
{
postJSON
(
'hades/anon/hades/getCorpTrainSuiteId'
,
{
corpType
},
(
res
)
=>
{
const
url
=
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=
${
res
.
result
}
&redirect_uri=
${
encodeURIComponent
(
location
.
href
)}
&response_type=code&scope=snsapi_privateinfo&state=STATE#wechat_redirect`
location
.
href
=
url
})
...
...
src/common/js/axios.ts
View file @
18e64979
...
...
@@ -8,7 +8,7 @@
*/
import
axios
,
{
AxiosInstance
,
AxiosRequestConfig
,
AxiosResponse
,
AxiosPromise
,
AxiosError
}
from
'axios'
;
import
{
message
,
Modal
}
from
'antd'
;
import
{
corpType
}
from
'@/domains/brand/constants'
import
{
BASIC_HOST
,
TIME_OUT
,
USER_TYPE
,
VERSION
,
PROJECT
}
from
'@/domains/basic-domain/constants'
;
import
User
from
'./user'
;
...
...
@@ -130,7 +130,7 @@ class Axios {
if
(
method
===
'GET'
)
{
config
=
Object
.
assign
({
params
,
url
:
`
${
BASIC_HOST
}${
_url
}
`
,
method
});
}
else
{
config
=
Object
.
assign
({
data
:
params
,
url
:
`
${
BASIC_HOST
}${
_url
}
`
,
method
});
config
=
Object
.
assign
({
data
:
{
corpType
,
...(
params
||
{})
}
,
url
:
`
${
BASIC_HOST
}${
_url
}
`
,
method
});
}
instance
(
config
).
then
((
res
:
AxiosResponse
):
void
=>
{
...
...
src/domains/brand/constants.ts
View file @
18e64979
export
const
BR
END
:
any
=
process
.
env
.
BRE
ND
;
export
const
BR
AND
:
any
=
process
.
env
.
BRA
ND
;
const
BrandNameMap
:
any
=
{
xiaomai
:
'小麦企学院'
,
...
...
@@ -27,21 +27,25 @@ const PATH_MAP: any = {
}
const
LIVE_SHARE_MAP
:
any
=
{
dev
:
'https://dev.xiaomai5.com/store-live/index.html#/'
,
dev1
:
'https://dev.xiaomai5.com/store-live/index.html#/'
,
rc
:
'https://rc.xiaomai5.com/store-live/index.html#/'
,
gray
:
'https://res.xiaomai0.com/store-live/gray/index.html#/'
,
prod
:
'https://res.xiaomai0.com/store-live/index.html#/'
,
}
xiaomai
:
'https://res.xiaomai0.com/store-live/index.html#/'
,
syoo
:
'https://res.xiaomai0.com/store-live/index.html#/'
,
}
const
CorpType_MAP
:
any
=
{
xiaomai
:
'X_Mai'
,
syoo
:
'S_You'
,
}
export
const
brandName
:
string
=
BrandNameMap
[
BREND
];
export
const
brandIcon
:
string
=
BrandIconMap
[
BREND
];
export
const
brandLogo
:
string
=
BrandLogoMap
[
BREND
];
export
const
brandBanner
:
string
=
BrandBannerMap
[
BREND
];
export
const
path
:
string
=
PATH_MAP
[
BREND
];
export
const
live
:
string
=
LIVE_SHARE_MAP
[
BREND
];
window
.
brandName
=
BrandNameMap
[
BREND
];
export
const
brandName
:
string
=
BrandNameMap
[
BRAND
];
export
const
brandIcon
:
string
=
BrandIconMap
[
BRAND
];
export
const
brandLogo
:
string
=
BrandLogoMap
[
BRAND
];
export
const
brandBanner
:
string
=
BrandBannerMap
[
BRAND
];
export
const
path
:
string
=
PATH_MAP
[
BRAND
];
export
const
live
:
string
=
LIVE_SHARE_MAP
[
BRAND
];
export
const
corpType
:
string
=
CorpType_MAP
[
BRAND
];
window
.
brandName
=
BrandNameMap
[
BRAND
];
src/index.tsx
View file @
18e64979
...
...
@@ -23,7 +23,7 @@ import '@/core/xmTD';
import
User
from
'@/common/js/user'
;
import
Service
from
"@/common/js/service"
;
import
BaseService
from
'@/domains/basic-domain/baseService'
;
import
{
brandName
,
BR
E
ND
,
brandIcon
}
from
'@/domains/brand/constants'
import
{
brandName
,
BR
A
ND
,
brandIcon
}
from
'@/domains/brand/constants'
declare
var
getParameterByName
:
any
;
declare
var
window
:
any
;
...
...
@@ -32,7 +32,7 @@ const history = createHashHistory();
document
.
title
=
brandName
;
var
iconUrl
=
'https://image.xiaomaiketang.com/xm/WGWCtxiGzE.png'
if
(
BR
E
ND
!=
'xiaomai'
){
if
(
BR
A
ND
!=
'xiaomai'
){
iconUrl
=
brandIcon
}
...
...
src/modules/root/WechatLogin.tsx
View file @
18e64979
...
...
@@ -2,9 +2,9 @@ import React, { useState, useRef, useEffect } from 'react';
import
qrcode
from
'@/libs/qrcode/qrcode.js'
;
import
Service
from
'@/common/js/service'
;
import
User
from
'@/common/js/user'
;
import
{
PATH
}
from
'@/domains/basic-domain/constants'
;
import
{
PATH
,
corpType
}
from
'@/domains/basic-domain/constants'
;
import
'./WechatLogin.less'
;
import
{
brandName
,
BREND
,
brandIcon
,
brandLogo
}
from
'@/domains/brand/constants'
import
{
brandName
,
BRAND
,
brandIcon
,
brandLogo
}
from
'@/domains/brand/constants'
declare
var
location
:
any
;
declare
var
window
:
any
;
...
...
@@ -27,7 +27,7 @@ export default function WechatLogin(props: any) {
if
(
status
===
0
)
{
Service
.
Hades
(
'anon/hades/getTicket'
,
{}).
then
((
res
:
any
)
=>
{
setTicket
(
res
.
result
);
const
redirect
=
`
${
PATH
}
?ticket=
${
res
.
result
}
&appTermEnum=XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN&env=
${
process
.
env
.
DEPLOY_ENV
||
'dev'
}
`
;
const
redirect
=
`
${
PATH
}
?ticket=
${
res
.
result
}
&appTermEnum=XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN&env=
${
process
.
env
.
DEPLOY_ENV
||
'dev'
}
&corpType=
${
corpType
}
`
;
const
qrcodeWrapDom
:
any
=
document
.
querySelector
(
'#qrcode'
);
let
qrnode
=
new
qrcode
({
text
:
redirect
,
...
...
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