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 @@
"build:dev1": "cross-env DEPLOY_ENV=dev 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: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": {
"extends": "react-app"
......
<!--
* @Author: 吴文洁
* @Date: 2020-08-24 12:20:57
......@@ -17,10 +16,10 @@
<meta name="theme-color" content="#000000" />
<!-- <link rel="apple-touch-icon" href="../src/common/images/logo.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 src="./lottie.js"></script>
<script type="text/javascript" src='./animation.json'></script>
<script type="text/javascript" src='./animation.json'></script>
<style type="text/css">
.box {
width: 100%;
......@@ -41,20 +40,24 @@
line-height: 24px;
margin-top: 12px;
}
.desc{
font-size:14px;
color:#999;
.desc {
font-size: 14px;
color: #999;
}
.hide {
display: none;
text-align: center;
}
#lottie{
#lottie {
width: 150px;
height: 150px;
margin: 0 auto;
}
#tenant-config-error-message{
#tenant-config-error-message {
max-width: 70%;
margin: 25px auto;
font-size: 14px;
......@@ -109,10 +112,10 @@
const code = getParameterByName('code');
const ticket = getParameterByName('ticket');
const storeId = getParameterByName('storeId');
const corpType = getParameterByName('corpType');
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`
location.href = url
})
......@@ -123,27 +126,44 @@
appTermEnum: 'XIAOMAI_CLOUD_CLASS_PC_WEB_CUSTOMER',
code: code,
ticket: ticket,
storeId:storeId
corpType,
storeId: storeId
}, (res) => {
if (res.code == 200) {
$('#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-message').html(res.message)
emptyAnimation()
} else {
emptyAnimation()
} else {
$('#error').show();
var message = res.message.split(',').join('<br />')
if(message === "非当前企业学院"){
if (message === "非当前企业学院") {
$('#message').html("<div><div>非当前企业学院</div><div class='desc'>尝试扫描「企业外部客户」二维码登录</div></div>");
}else{
} else {
$('#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) {
const ajaxOptions = {
data: JSON.stringify(data),
......@@ -160,7 +180,7 @@
$.ajax(ajaxOptions)
}
function emptyAnimation(){
function emptyAnimation() {
let params = {
container: document.getElementById('lottie'),
renderer: 'svg',
......
......@@ -32,7 +32,7 @@
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`.
-->
<title>登录</title>
<title>扫码登录</title>
<script type="text/javascript" src="https://image.xiaomaiketang.com/xm/PhotoClip.js"></script>
</head>
<body>
......
......@@ -6,8 +6,9 @@
* @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
declare var process:any;
const APP_ID_MAP = {
const APP_ID_MAP:any = {
dev: 'wx3ea60e78ddfa277e',
rc:'wx5c5a1fb71ecab7bc',
gray:'wx3dda02036493ada6',
......@@ -15,6 +16,8 @@ const APP_ID_MAP = {
}
// 调试环境,默认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];
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