Commit e5ebb51d by zhujian

Merge branch 'feature/zhujian/0801/syoo' into 'master'

Feature/zhujian/0801/syoo

See merge request !5
parents 36a38734 c029471a
...@@ -89,7 +89,9 @@ ...@@ -89,7 +89,9 @@
"build:dev1": "cross-env DEPLOY_ENV=dev node scripts/build.js", "build:dev1": "cross-env DEPLOY_ENV=dev node scripts/build.js",
"build:rc": "cross-env DEPLOY_ENV=rc node scripts/build.js", "build:rc": "cross-env DEPLOY_ENV=rc node scripts/build.js",
"build:gray": "cross-env DEPLOY_ENV=gray node scripts/build.js", "build:gray": "cross-env DEPLOY_ENV=gray node scripts/build.js",
"build:prod": "cross-env DEPLOY_ENV=prod node scripts/build.js" "build:prod": "cross-env DEPLOY_ENV=prod node scripts/build.js",
"build:gray-syoo": "cross-env DEPLOY_ENV=prod node scripts/build.js",
"build:prod-syoo": "cross-env DEPLOY_ENV=prod node scripts/build.js"
}, },
"eslintConfig": { "eslintConfig": {
"extends": "react-app" "extends": "react-app"
......
<!-- <!--
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-24 12:20:57 * @Date: 2020-08-24 12:20:57
...@@ -17,10 +16,10 @@ ...@@ -17,10 +16,10 @@
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<!-- <link rel="apple-touch-icon" href="../src/common/images/logo.png" /> --> <!-- <link rel="apple-touch-icon" href="../src/common/images/logo.png" /> -->
<link rel="shortcut icon" href="https://image.xiaomaiketang.com/xm/KGSYFEpcHT.png"> <link rel="shortcut icon" href="https://image.xiaomaiketang.com/xm/KGSYFEpcHT.png">
<title>小麦企培</title> <title>扫码登陆</title>
<script type="text/javascript" charset="utf-8" src="./jquery.min.js"></script> <script type="text/javascript" charset="utf-8" src="./jquery.min.js"></script>
<script src="./lottie.js"></script> <script src="./lottie.js"></script>
<script type="text/javascript" src='./animation.json'></script> <script type="text/javascript" src='./animation.json'></script>
<style type="text/css"> <style type="text/css">
.box { .box {
width: 100%; width: 100%;
...@@ -41,20 +40,24 @@ ...@@ -41,20 +40,24 @@
line-height: 24px; line-height: 24px;
margin-top: 12px; margin-top: 12px;
} }
.desc{
font-size:14px; .desc {
color:#999; font-size: 14px;
color: #999;
} }
.hide { .hide {
display: none; display: none;
text-align: center; text-align: center;
} }
#lottie{
#lottie {
width: 150px; width: 150px;
height: 150px; height: 150px;
margin: 0 auto; margin: 0 auto;
} }
#tenant-config-error-message{
#tenant-config-error-message {
max-width: 70%; max-width: 70%;
margin: 25px auto; margin: 25px auto;
font-size: 14px; font-size: 14px;
...@@ -109,10 +112,10 @@ ...@@ -109,10 +112,10 @@
const code = getParameterByName('code'); const code = getParameterByName('code');
const ticket = getParameterByName('ticket'); const ticket = getParameterByName('ticket');
const storeId = getParameterByName('storeId'); const storeId = getParameterByName('storeId');
const corpType = getParameterByName('corpType');
if (!code) { if (!code) {
postJSON('hades/anon/hades/getCorpTrainSuiteId', {}, (res) => { GetJSON('hades/anon/hades/getCorpTrainSuiteId', {}, (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` 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 location.href = url
}) })
...@@ -123,27 +126,44 @@ ...@@ -123,27 +126,44 @@
appTermEnum: 'XIAOMAI_CLOUD_CLASS_PC_WEB_CUSTOMER', appTermEnum: 'XIAOMAI_CLOUD_CLASS_PC_WEB_CUSTOMER',
code: code, code: code,
ticket: ticket, ticket: ticket,
storeId:storeId corpType,
storeId: storeId
}, (res) => { }, (res) => {
if (res.code == 200) { if (res.code == 200) {
$('#success').show() $('#success').show()
}else if(res.code === 'DEPLOY_CROP_ADD_USER_NO'){ } else if (res.code === 'DEPLOY_CROP_ADD_USER_NO') {
//租户配置到限,跳转空白提示缺省页 //租户配置到限,跳转空白提示缺省页
$('#tenant-config-error').show(); $('#tenant-config-error').show();
$('#tenant-config-error-message').html(res.message) $('#tenant-config-error-message').html(res.message)
emptyAnimation() emptyAnimation()
} else { } else {
$('#error').show(); $('#error').show();
var message = res.message.split(',').join('<br />') var message = res.message.split(',').join('<br />')
if(message === "非当前企业学院"){ if (message === "非当前企业学院") {
$('#message').html("<div><div>非当前企业学院</div><div class='desc'>尝试扫描「企业外部客户」二维码登录</div></div>"); $('#message').html("<div><div>非当前企业学院</div><div class='desc'>尝试扫描「企业外部客户」二维码登录</div></div>");
}else{ } else {
$('#message').html(message); $('#message').html(message);
} }
} }
}) })
} }
function GetJSON(url, data, callback) {
const ajaxOptions = {
type: 'GET',
url: BASIC_HOST_MAP[env] + url + `?corpType=${corpType}`,
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
timeout: 20000,
success(res, status, xhr) {
callback(res)
},
};
$.ajax(ajaxOptions)
}
function postJSON(url, data, callback) { function postJSON(url, data, callback) {
const ajaxOptions = { const ajaxOptions = {
data: JSON.stringify(data), data: JSON.stringify(data),
...@@ -160,7 +180,7 @@ ...@@ -160,7 +180,7 @@
$.ajax(ajaxOptions) $.ajax(ajaxOptions)
} }
function emptyAnimation(){ function emptyAnimation() {
let params = { let params = {
container: document.getElementById('lottie'), container: document.getElementById('lottie'),
renderer: 'svg', renderer: 'svg',
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
work correctly both with client-side routing and a non-root public URL. work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`. Learn how to configure a non-root public URL by running `npm run build`.
--> -->
<title>登录</title> <title>扫码登录</title>
<script type="text/javascript" src="https://image.xiaomaiketang.com/xm/PhotoClip.js"></script> <script type="text/javascript" src="https://image.xiaomaiketang.com/xm/PhotoClip.js"></script>
</head> </head>
<body> <body>
......
...@@ -6,8 +6,9 @@ ...@@ -6,8 +6,9 @@
* @Description: 描述一下 * @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
declare var process:any;
const APP_ID_MAP = { const APP_ID_MAP:any = {
dev: 'wx3ea60e78ddfa277e', dev: 'wx3ea60e78ddfa277e',
rc:'wx5c5a1fb71ecab7bc', rc:'wx5c5a1fb71ecab7bc',
gray:'wx3dda02036493ada6', gray:'wx3dda02036493ada6',
...@@ -15,6 +16,8 @@ const APP_ID_MAP = { ...@@ -15,6 +16,8 @@ const APP_ID_MAP = {
} }
// 调试环境,默认dev // 调试环境,默认dev
const ENV = 'prod'; const ENV: string = process.env.DEPLOY_ENV || 'dev'
console.log( process.env.DEPLOY_ENV,' process.env.DEPLOY_ENV process.env.DEPLOY_ENV')
export const AppId = APP_ID_MAP[ENV]; export const AppId = APP_ID_MAP[ENV];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment