CINXE.COM
账户登陆
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="expires" content="0" /> <title>账户登陆</title> <link rel="icon" href="../../img/logo2.png" type="image/x-icon" /> <link rel="stylesheet" href="css/zzy-zhuce.css?v=20220117" /> <script> (function(){ var ua = window.navigator.userAgent, isWindowsPhone = /(?:Windows Phone)/.test(ua), isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone, isAndroid = /(?:Android)/.test(ua), isFireFox = /(?:Firefox)/.test(ua), // isChrome = /(?:Chrome|CriOS)/.test(ua), isTablet = /(?:iPad|PlayBook)/.test(ua) || (isAndroid && !/(?:Mobile)/.test(ua)) || (isFireFox && /(?:Tablet)/.test(ua)), isPhone = /(?:iPhone)/.test(ua) && !isTablet, // isPc = !isPhone && !isAndroid && !isSymbian, isH5 = isPhone || isAndroid || isSymbian || isTablet; if(isH5){ window.location = '../../mobile-vipcenter/login.html' + window.location.search } }()) </script> <script src="js/jquery-1.11.1.min.js"></script> <script src="js/jquery.params.js"></script> <script src="js/layui.js"></script> <script src="js/jquery.form.js"></script> <script src="js/md5/md5.js"></script> <script src="js/variable.js?v=230620"></script> <script src="../vue/vue.js"></script> <script src="../../js/common/dialogDrag.js"></script> <script> window.noRspFilter = true;window.noAutoLogin = true;</script> <script src="../../js/common/fixAjax.js?v=240108"></script> <script src="../../js/common/_vipUtil.js?v=241011"></script> <link rel="stylesheet" href="../vue/element-ui/index.css" /> <script src="../vue/element-ui/index.js"></script> <!-- <script src="//res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script> --> <style> .wjmm:hover { color: var(--btn-color) !important; } input[class=dl] { background-color: var(--btn-color) !important; } input[class=dl]:hover { background-color: var(--btn-color) !important; filter: contrast(.8); -webkit-filter: contrast(.8); } button:disabled,button.disabled,input.disabled,input:disabled{ filter: contrast(0.8) !important; cursor: not-allowed; } .pointer,.cursor { cursor: pointer; } .login-container{ padding: 0 38px !important; } .hide,[v-cloak]{ display: none !important; } .regBtn2 { background-color: var(--btn-color) !important; color: white; width: 300px; border: 1px solid transparent; } .regBtn:hover { color: var(--btn-color) } .regBtn { /* background-color: transparent; */ color: #999; width: 300px; border: 1px solid transparent; } .unlinkUser .el-radio__inner { width: 18px; height: 18px; } .unlinkUser:hover .el-radio__inner { border-color: var(--btn-color) !important; } .unlinkUser .el-radio__input.is-checked .el-radio__inner { background: var(--btn-color) !important; border-color: var(--btn-color) !important; } .unlinkUser:hover,.unlinkUser.hover { border: 1px solid var(--btn-color); border-radius: 6px; } .unlinkUser .el-radio{ position: absolute; right: -25px; top: 17px; } .unlinkUser { background: #f8fafc; position: relative; border: 1px solid transparent; margin-left: 6px; font-size: 12px; display: inline-block; width: 156px; margin-bottom: 10px; padding: 30px 5px 26px; box-sizing: border-box; transition: all .2s; } ::-webkit-scrollbar-track-piece { background-color: #f8f8f8; } ::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background-color: #dddddd; background-clip: padding-box; min-height: 28px; border-radius: 5px; } ::-webkit-scrollbar-thumb:hover { background-color: #bbb; } body .login-container { padding: 0 38px 38px !important; height: auto !important; } .mb25 { margin-bottom: 25px !important; } </style> <script> function getBrowserInfo() { var ua = navigator.userAgent.toLocaleLowerCase(); var browserType = null; if (ua.match(/msie/) != null || ua.match(/trident/) != null) { browserType = "推荐使用谷歌浏览器,或者将该浏览器切换成极速模式登陆系统"; //ie browserVersion = ua.match(/msie ([\d.]+)/) != null ? ua.match(/msie ([\d.]+)/)[1] : ua.match(/rv:([\d.]+)/)[1]; alert(browserType); } } getBrowserInfo(); </script> <style id="js-theme-color-btn"> .login-container { --btn-color: #2e82e4; } </style> <style id="js-theme-color-code"> .login-container { --code-color: #2e82e4; } </style> </head> <body style="overflow-x: hidden"> <div id="app" v-cloak > <div class="head"> <div class="head-wrap"> <h6 class="topTitle"> <span class="topTitleImgDiv"> <img src="//zhanzhiyun.oss-accelerate.aliyuncs.com/20220114/1642141083636_200*200.png" class="loginLogoImg" /> </span> <p style="line-height: 66px; color: #4d4d4d"> <span style="font-size: 34px">{{ isVip ? '会展信息门户会员中心' : '会员自助服务中心' }}</span> </p> </h6> </div> </div> <div class="conter"> <div class="login-container biao" style="padding-top: 38px !important;"> <div v-show="!showLogin3Qr"> <template> <ul class="login-nav-bar"> <li :class="{active: ifLogByCode}" @click="ifLogByCode=true" data-type="vcode">验证码登录</li> <li :class="{active: !ifLogByCode}" @click="ifLogByCode=false" data-type="account">密码登录</li> </ul> <div class="split-line" :class="{right: !ifLogByCode}"></div> </template> <div class="login-form" style="position: relative;"> <div class="login-form-item mb25"> <input type="text" autocomplete="off" :placeholder="'请输入手机号/邮箱' + (ifLogByCode ? '':'/账户')" v-model="username" /> </div> <div style="top: 59px;position: absolute;"> <span v-if="username && !isValidPhoneOrEmail" style="color: red;line-height: 28px;">手机或邮箱格式错误 !</span> </div> <div class="login-form-item password mb25" v-show="!ifLogByCode"> <input type="password" placeholder="请输入密码" v-model="password" /> </div> <div class="login-form-item v-code mb25" v-show="ifLogByCode"> <input type="text" maxlength="4" @blur="codeChange()" placeholder="请输入验证码" v-model="code" /> <button @click="send(60)" :disabled="!orgNum || smsSending" class="pointer">{{ codeMsg || '发送验证码'}}</button> </div> <div class="login-form-item" > <button class="pointer" :disabled="!orgNum || isBusyTime>0 || !isLoginParaReady" @click="memberlogin">{{ isBusyTime ? '请稍候 (' + isBusyTime + 's)' : ((allowMemerReg && ifLogByCode) ? '登 录/注 册':'登 录') }} </button> <!-- <button v-if="lastUname" style="margin-top: 8px;" class="pointer" @click="memberloginLast">直接登录: {{ lastUname }} </button> --> </div> </div> </div> <!-- <div v-show="showLogin3Qr" id="wxLoginQr"> </div> --> <div v-if="login3Types && login3Types.length>0" > <p style="font-size: 14px;color: #151B35;border-top: 1px solid #F3F6F9;margin-top: 38px;"> <center style="margin: -11px 80px 0;background-color: white;cursor: pointer;" @click="login3Type(32)"> <img src="/eip-app-vip/img/gateway/wx.png" alt="微信快捷登录" srcset="" height="16px" style="margin-top: -2px;"> <span style="font-size: 14px;">微信快捷登录</span> </center> </p> </div> <!-- <p class="login-message" v-if="allowMemerReg"> *未注册的用户使用验证码登录将自动创建会员账号 </p> --> <tip ref="tipBusy" theme="bThin" msg="系统繁忙,请60秒后重试"></tip> <tip ref="tipLink" no-footer width="384px"> <div style="font-size: 14px;color: rgba(21,27,53,1);line-height: 23px;margin-top: -10px;"> <div style="color: rgba(0,0,0,0.65);">当前登录号码 {{ username }}</div> <div style="color: rgba(0,0,0,0.85);font-size: 17px;">存在未认证会员</div> <div style="color: #333;">请选择会员进行认领</div> <div style="color: rgba(89,89,89,1);padding: 20px 0 12px;width: 100%;box-sizing: border-box;height: 210px;overflow-y: auto;overflow-x: hidden;"> <div v-for="it in unlinkUsers" :key="it.zzyUserId" class="unlinkUser cursor" @click="confirmRegLink(it)" > <el-radio v-model="linkUserId" :label="it.zzyUserId"> </el-radio> <center> <el-avatar size=48 :src="it.headImage"></el-avatar> <div>{{ getTextDesc(it.contactsName) }}</div> <div>{{ getTextDesc(it.mobile) }}</div> <div>{{ getTextDesc(it.companyName) }}</div> </center> </div> </div> <div style="margin: 10px 20px 14px;border-top: 1px solid #f3f6f9;"></div> <!-- <center style="margin-bottom: 7px;">或者</center> --> <center><el-button :disabled="!linkUserId" @click="confirmRegLinkSure" type="info" class="regBtn2">认领该会员</el-button></center> <center><el-button @click="confirmRegNew" type="text" class="regBtn">注册为新会员</el-button></center> </div> </tip> <!-- 第三方绑定 --> <tip ref="tipLogin3" theme="bRadius" no-footer width="376px"> <div class="login-container-" style="padding: 0 20px !important;width: 300px;"> <div> <div style="font-size: 17px;line-height: 33px;text-align: center;"> <div> <img src="/eip-app-vip/img/gateway/wx.png" alt="微信绑定" srcset="" height="20px" style="margin-top: -3px;"> <span>微信验证成功</span> </div> <div> 尊敬的用户,请完善您的会员资料 </div> </div> <div class="login-form" style="position: relative;"> <div class="login-form-item mb25"> <input type="text" autocomplete="off" placeholder="请输入手机号/邮箱" v-model="formLogin3.username" /> </div> <div style="top: 59px;position: absolute;"> <span v-if="formLogin3.username && !isValidPhoneOrEmail3" style="color: red;line-height: 28px;">手机或邮箱格式错误 !</span> </div> <!-- <div class="login-form-item password mb25" v-show="!ifLogByCode"> <input type="password" placeholder="请输入密码" v-model="password" /> </div> --> <div class="login-form-item v-code mb25"> <input type="text" maxlength="4" @blur="codeChange(true)" placeholder="请输入验证码" v-model="formLogin3.code" /> <button @click="send(60, true)" :disabled="!orgNum || smsSending" class="pointer">{{ codeMsg || '发送验证码'}}</button> </div> <div class="login-form-item" > <button class="pointer" :disabled="!orgNum || isBusyTime>0 || !isLoginParaReady3" @click="memberlogin3">{{ isBusyTime ? '请稍候 (' + isBusyTime + 's)' : '绑定账户' }} </button> </div> </div> </div> </div> </tip> </div> </div> <div class="foot"> <div class="foot2"> <div class="foot2-body"></div> </div> </div> </div> <script type="text/javascript"> const url = (new URL(window.location.href)).searchParams; var pid = util.getUserPid(); var orgNum = util.getOrgNum(); var pinfo = {}; if(pid) { pinfo = util.getPinfo(pid); orgNum = pinfo.orgNum; } var g_back = !!(+url.get('back')); var reserve = url.get("reserve"); var source = url.get("source"); var sources = url.get("sources"); // 注册来源标志 var redirect_uri = url.get('redirect_uri') || ''; function afterAuth(code, state) { // test only // app.wxOpenId = 'o0BLn5qF1kOREZwy87NGzBpavsnQ'; // app.wxState = 32; // app.ifLogByCode = true; // app.showLogin3Bind = true; // app.wxBindCheck(); if(state == 32) { // 微信回调 app.wxCode = code; app.wxState = state; app.getWxUserInfo(); } } $(function () { var MixinLogin3 = { data() { return { wxAppId: 'wx06052555c6aaadad', // 微信appid wxCode: '', // 微信回调code wxOpenId: '', // 微信openId wxState: '', // socialType || 微信回调state showLogin3Bind: false, showLogin3Qr: false, login3TypesServer: [], // source,title,socialType login3TypesDf: { // socialType => img // 10: '', // gitee授权(GITEE) // 20: '', // 钉钉(DINGTALK) // 30: '', // 企业微信(WECHAT_ENTERPRISE) // 31: '', // 微信公众号 移动端 H5(WECHAT_MP) 32: '../img/gateway/wx.png', // 微信开放平台 PC授权登录 (WECHAT_OPEN) // 34: '', // 微信小程序(WECHAT_MINI_APP) }, formLogin3: { // 第三方绑定表单 username: '', // 手机号/邮箱 code: '', // 验证码 } } }, computed: { login3Types() { const types = []; this.login3TypesServer.map(i => { if(this.login3TypesDf[i.socialType]) { i.img = this.login3TypesDf[i.socialType]; types.push(i) } }) return types; }, }, methods: { login3Type(socialType) { if(socialType == 32) { // 前往微信授权 this.goToWxAuth(socialType) } }, async getWxUserInfo() { // 获取openId const data = await util.post(API + `/auth/socialLogin/${this.wxState}/${this.orgNum}`, { socialType: this.wxState, orgNum: this.orgNum, code: this.wxCode, state: this.wxState, }) this.checkRet(data); this.wxOpenId = data.data.openId || ''; this.wxBindCheck() }, getWxConfig() { const that = this util.post(API +'/api/sysSettingOrgNum/getSocialAppId', { socialType: 32, // redirect_uri: location.href, orgNum: this.orgNum, }, {}, function(data) { that.checkRet(data); that.wxAppId = data.data || ''; }) }, showLogin3WxQr(e) { var t = document; var r = "default"; !0 === e.self_redirect ? r = "true" : !1 === e.self_redirect && (r = "false"); var n = t.createElement("iframe") , i = "https://open.weixin.qq.com/connect/qrconnect?appid=" + e.appid + "&scope=" + e.scope + "&redirect_uri=" + e.redirect_uri + "&state=" + e.state + "&login_type=jssdk&self_redirect=" + r + "&styletype=" + (e.styletype || "") + "&sizetype=" + (e.sizetype || "") + "&bgcolor=" + (e.bgcolor || "") + "&rst=" + (e.rst || ""); i += e.style ? "&style=" + e.style : "", i += e.href ? "&href=" + e.href : "", i += "en" === e.lang ? "&lang=en" : "", n.src = i, n.frameBorder = "0", n.allowTransparency = "true", n.scrolling = "no", n.width = "300px", n.height = "300px"; var s = t.getElementById(e.id); s.innerHTML = "", s.appendChild(n) }, //在新窗口中打开URL OpenWindows(url, width, height, name) { if (name == undefined) name = ""; var leftSpan = (window.screen.availWidth - 27) / 2 - width / 2; var topSpan = (window.screen.availHeight - 8) / 2 - height / 2 - 30; var str = "width=" + width + ",height=" + height + ",top=" + topSpan + ",left=" + leftSpan + ",resizable=1,scrollbars=yes"; return window.open(url, name, str); }, goToWxAuth(socialType) { // 获取 appid if(!this.wxAppId) this.getWxConfig() if(!this.wxAppId) this.error('微信登录失败: appid'); const url2 = HOST + `/pages/frontend/afterauth.html?appid=${this.wxAppId}&socialType=${socialType}&app=vipPc` // // test only // this.OpenWindows(url, 850, 500); const redirect = encodeURIComponent(url2); const url = `https://open.weixin.qq.com/connect/qrconnect?appid=${this.wxAppId}&redirect_uri=${redirect}&response_type=code&scope=snsapi_login&state=${socialType}#wechat_redirect`; this.OpenWindows(url, 850, 500); // // 微信内嵌二维码 // const redirect = encodeURIComponent(window.location.href) // this.showLogin3Qr = true // this.$nextTick(_ => { // this.showLogin3WxQr({ // self_redirect: true, // id: "wxLoginQr", // appid: this.wxAppId, // scope: "snsapi_login", // redirect_uri: redirect, // state: socialType, // style: "black", // href: encodeURIComponent(HOST + "/pages/frontend/css/wxQr.css"), // 需要https // }); // }); // // 微信浏览器授权 // const redirect = encodeURIComponent(window.location.href) // window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.wxAppId}&redirect_uri=${redirect}&response_type=code&state=${socialType}&scope=snsapi_base#wechat_redirect` // throw new Error("you can't go down") // // window.location.href = window.location.href + '&' }, get3thLogins() { const that = this; util.post(API + "/api/sysSettingOrgNum/getSocialLogin", { orgNum: that.orgNum, },{} , function(data) { that.checkRet(data); that.login3TypesServer = data.data || []; }) }, async wxBindCheck() { if(!this.wxOpenId) this.error('微信登录失败: openId'); const data = await util.post(API + '/auth/confirmBindZzyUser',{ socialType: 32, openId: this.wxOpenId, orgNum: this.orgNum, projectId:pid, }) if(data.state == -10) { // 新openId // 新窗口 this.formLogin3.username = '' this.formLogin3.code = '' this.$refs['tipLogin3'].open() // this.showLogin3Bind = true // this.ifLogByCode = true } else if (data.state !== 1) { this.checkRet(data); } else { // 之前已绑定 this.loginSuccess(data); } }, async memberlogin3() { // 新openId : 第三方注册 if(!this.orgNum) this.error('需要机构号.') this.loading = true; this.finalReg({ orgNum: this.orgNum, projectId: pid, sources: this.getSources(), // refZzyUserRegFlag: !true, username: this.formLogin3.username, code: this.formLogin3.code, sendType: this.isEmail3 ? 2 : 1, loginType: 'SOCIAL_LOGIN', socialType: this.wxState, openId: this.wxOpenId, }); }, }, }; window.app = new Vue({ el: '#app', mixins: [ZzMixin, MixinLogin3], data: { orgNum, pid, pinfo, // allowMemerReg: false, ifLogByCode: true, // 验证码登录 isBusyTime: 0, // 繁忙倒计时 username: '', password: '', code: '', // 手机验证码 codeMsg: '', // smsSending: false, // 已经发了 unlinkUsers: [], // 待关联的会员 sources: ['VIP','BUSINESS','SITE_TRADE','BUYER_REG','BOOTH_LAYOUT','TICKET_CERTIFICATE'], lastToken: localStorage.getItem("access_token") ||'', lastUinfo: {}, linkUserId: '', regEmail: /^([a-z0-9][a-z0-9_\-.]+[a-z0-9]@[a-z0-9\-.]+\.([a-z]{2,}))([,;,;、][a-z0-9][a-z0-9_\-.]+[a-z0-9]@[a-z0-9\-.]+\.([a-z]{2,}))*$/i, regPhone: /^1[3-9]\d{9}$/, }, components: {tip}, created(){ if(!this.pid && !this.orgNum) this.error('需要机构号 或 项目id.'); // if(!this.orgNum) this.$alert('需要机构号!', '错误', {type:'error'}); // this.allowMemerReg = false; if(this.isVip) { this.loadVipSetting(); } else { // TODO business setting this.loadVipSetting(); } if(this.lastToken) { this.getLastUinfo(); this.memberloginLast(); } }, mounted () { // if(url.get('test')) { // this.linkUserId = '' // this.username = '999@11.com' // this.unlinkUsers = [ // { // zzyUserId: '111', // headImage: '//www.jeasyui.cn/jeasyui/public/images/logo2.png', // contactsName: 'n1', // mobile: 'm1', // email: 'e1', // companyName: 'corp1', // }, // ]; // this.$refs['tipLink'].open(); // } }, computed: { isVip() { return !(+this.pid > 0); }, isValidPhoneOrEmail() { if(!this.ifLogByCode) return true return this.isEmail || this.isPhone; }, isValidPhoneOrEmail3() { return this.isEmail3 || this.isPhone3; }, isEmail() { return this.username && this.regEmail.test(this.username); }, isEmail3() { return this.formLogin3.username && this.regEmail.test(this.formLogin3.username); }, isPhone() { return this.username && this.regPhone.test(this.username); }, isPhone3() { return this.formLogin3.username && this.regPhone.test(this.formLogin3.username); }, isLoginParaReady3() { return this.formLogin3.username && this.formLogin3.code }, isLoginParaReady() { return this.username && ((this.ifLogByCode && this.code) || (!this.ifLogByCode && this.password)) }, lastUname() { return (this.lastUinfo && this.lastUinfo.zzyUserId) ? this.getHiddenText(this.lastUinfo.userName || '') :''; }, }, methods: { getHiddenText(mobileOrEmail) { // 后面有时间在改 const str = String(mobileOrEmail) || ''; const len = str.length; if(len > 8) { // 9+ // return str.substr(0,3) + '****' + str.substr(7); return str.substr(0,len -8 ) + '****' + str.substr(-4); } else if(len<1) { // 4- return '*' } else if(len<5) { // 4- return str.substr(0,1) + '*'.repeat(len -1); } else { // 5~8 return str.substr(0,2) + '**' + str.substr(4); } }, getLastUinfo() { this.lastUinfo = util.getUinfo(this.lastToken); }, memberloginLast() { if(this.lastToken && this.lastUinfo && this.lastUinfo.zzyUserId) { loginSuccessAfter(this.lastToken); } }, getSources() { // 门户如果只有域名: 需要特殊处理 let source = (sources && this.sources.find(it=> it==sources)) ? sources : '' ; if(!source && redirect_uri) { if(redirect_uri.includes('/trade-web-site')) { source = 'SITE_TRADE' } else if(redirect_uri.includes('/RegSever/') || redirect_uri.includes('/web-reg-server/')) { source = 'BUYER_REG' } } return source || (this.pid ? 'BUSINESS' : 'VIP'); }, loadVipSetting(){ // 加载会员配置 const that = this; util.post( API+ "/sysSettingOrg/getValue",{ settingCode: 'allowMemerReg',orgNum }, {}, function (data) { if (data && data.state == 1 && data.data) { that.allowMemerReg = data.data.allowMemerReg === 'true' if(that.allowMemerReg) that.get3thLogins(); } },function() { that.error() } ) }, getTextDesc(str) { return util.getHiddenText(str); }, confirm (){ const that = this this.$alert('当前账号未注册, 请重新确认账号信息. 如需创建新账号请切换到验证码登录以创建会员账号.','提醒', { type: 'warning', confirmButtonText: '确定', callback: action => { if(action === 'confirm') that.ifLogByCode = true } }) }, confirmRegNew() { const that = this; this.finalReg({ orgNum, sources: this.getSources(), refZzyUserRegFlag: true, username: that.username, code: that.code, }) }, async confirmRegLink(linkUser) { this.linkUserId = linkUser.zzyUserId || ''; }, async confirmRegLinkSure() { if(!this.linkUserId) return; const linkUser = this.unlinkUsers.find(it=> this.linkUserId && it.zzyUserId == this.linkUserId) || {}; const that = this; const mobile = this.getTextDesc(linkUser.mobile); await this.$confirm('是否确认认领 '+ mobile +' 会员?','提醒', { type: 'warning', confirmButtonText: '确定认领' }) util.post(API + '/auth/confirmRefZzyUser',{ orgNum, username: that.username, refZzyUserId: linkUser.zzyUserId, projectId:pid, },{}, function (data) { // state = 1 //成功、已存在会员账号(手机号或邮箱),请勿重复生成 // state = 0 // 参数缺失、展会项目不存在、验证码不能为空、项目未开通会员自主服务 // state = -2 //验证码未发送成功、验证码错误 // state = -9 存在未认证的会员关联账号 if(data.state !==1) { if(data.state == -9) { that.unlinkUsers = data.data || []; that.linkUserId = (that.unlinkUsers[0] || {}).zzyUserId || '' that.$refs['tipLink'].open(); } else { that.error(data.msg || '关联会员失败 !') } }else{ that.loginSuccess(data) } },function() { that.error() } ); }, finalReg(params) { params.sendType = this.isEmail ? 2: 1; params.projectId = pid; const that = this; util.post(API + '/auth/register',params,{}, function(data) { // state = 1 //成功、已存在会员账号(手机号或邮箱),请勿重复生成 // state = 0 // 参数缺失、展会项目不存在、验证码不能为空、项目未开通会员自主服务 // state = -2 //验证码未发送成功、验证码错误 // state = -9 存在未认证的会员关联账号 if(data.state !==1) { if(data.state == -9) { that.unlinkUsers = data.data || []; that.linkUserId = (that.unlinkUsers[0] || {}).zzyUserId || '' that.$refs['tipLink'].open(); } else { that.error(data.msg || '注册新用户失败 !') } }else{ that.loginSuccess(data) } },function() { that.error() } ); }, confirmReg (params) { this.$confirm('您还未注册过账号, 是否注册, 以新用户身份登录?','提示', { type: 'warning', confirmButtonText: '注册', cancelButtonText: '关闭', }).then(() => { this.finalReg(params); }).catch( action =>{ }) }, loginSuccess(arr) { const data = arr.data.zzyUserInfo || {}; token = arr.data.token || ''; // get参数 util.saveUinfo(data, token); loginSuccessAfter(token); }, getPwdLevelDesc(pwdLevel) { return ['', '低', '中', '中' ,'高'][pwdLevel] || '未知'; }, getPassLevel(pass) { if(typeof pass !== 'string' || !pass) return 0; var level = 0; // pass = String(pass).toLocaleLowerCase(); // 小写字母,级别+1 if (/[a-z]/.test(pass)) level++; if (/[A-Z]/.test(pass)) level++; // 数字+1 if (/[0-9]/.test(pass)) level++; // 其他+1 if (/[\`\~\!\@\#\$\%\^\&\*\(\)\_\+\-\=\\\|\[\]\{\}\;\'\:\"\,\.\/\<\>\?]/.test(pass)) level++; return level; }, send(t, isLogin3 = false) { const that = this; if(this.smsSending) that.error('验证码发送中!'); if(isLogin3) { if (!this.isEmail3 && !this.isPhone3) that.error('请填写正确电话号码或邮箱!'); } else { // if (this.isEmail) that.error('暂未开放邮箱登录!'); // if (!this.isPhone) that.error('请填写正确电话号码!'); if (!this.isEmail && !this.isPhone) that.error('请填写正确电话号码或邮箱!'); } util.post(API + "/sms/sendCode", { userName: isLogin3 ? this.formLogin3.username : this.username, sources: that.pid ? 'BUSINESS':'VIP', sendType: this.isEmail ? 2: 1, orgNum, projectId: that.pid ||0, }, {}, function (data) { that.checkRet(data,'验证码发送失败!','验证码发送成功!'); that.smsSending = true; for (var i = 1; i <= t; i++) { window.setTimeout("app.update_a(" + i + "," + t + ")", i * 1000); } },function() { that.error() } ); }, update_a(i, t) { if (i >= t) { this.codeMsg = "重新发送"; this.smsSending = false; } else { this.smsSending = true; this.codeMsg = (t - i) + "秒后重发"; } }, memberlogin() { const that = this; util.post( API + "/auth/login", { loginType: this.ifLogByCode ? 'CAPTCHA_LOGIN' : 'ACCOUNT_LOGIN', orgNum, username: (this.username || '').trim(), password: this.ifLogByCode ? '': hex_md5((this.password || '').trim()).toUpperCase(), code: this.ifLogByCode ? this.code : '', projectId: this.pid, passwordStrength: this.getPassLevel((this.password || '').trim()) > 1, }, { } , function (arr) { const msg = util.getLoginRspErrorMsg(arr, that.allowMemerReg); if(msg) that.alert(msg); if (arr.state == -1) { // 验证码注册 that.confirmReg({ orgNum, sources: that.getSources(), refZzyUserRegFlag: false, // 不关联直接注册 ? username: that.username, code: that.code, }); } else if (arr.state == 3) { // 密码 => 验证码注册 that.confirm(); } else if (arr.state == -10) { // 需要验证码安全登录 that.ifLogByCode = true; that.alert('账户安全系数过低, 需要验证码登录'); } else if (arr.state == -9) { // 需要关联会员 that.unlinkUsers = arr.data || []; that.linkUserId = (that.unlinkUsers[0] || {}).zzyUserId || '' that.$refs['tipLink'].open(); // that.unlinkShow = true; } else if (arr.state == -99) { // 服务器繁忙 that.$refs['tipBusy'].open() that.isBusyTime = 60; // 暂不考虑刷新问题,后面有时间在改 const tmpTimer = setInterval(() => { if(that.isBusyTime > 0) { that.isBusyTime = that.isBusyTime - 1; } else { clearInterval(tmpTimer) } }, 1000); } else if (arr.state == 1) { // ok that.loginSuccess(arr); } },function () { that.alert() }, ); }, codeChange(isLogin3 = false) { const code = isLogin3 ? this.formLogin3.code : this.code; if (!/^\d{4}$/.test(code)) if(isLogin3) { this.formLogin3.code = code ==='' ? '' : parseInt(code) } else { this.code = code ==='' ? '' : parseInt(code) } } }, }) // getVipSetting(); //将回车键绑定到登录按钮 document.onkeydown = function (eve) { var e = window.event ? window.event : eve; if (e.keyCode == 13) { // document.getElementById("dl").click(); app.memberlogin(); } }; getStyleData(+pid); }); function loginSuccessAfter(token) { if(!token) return; // 另外存一份给其他子系统使用 localStorage.setItem('access_token', token); if (redirect_uri) { top.location.href = changeURLArg(redirect_uri,'token', token); }else if(g_back) { history.go(-1); } else { if(!pid) { top.location.href = HOST + "/main/index.html?token=" + (token || '') + "&p=" + pid; } else { let urlBusi = window.origin + '/eip-app-business/'; if(reserve == 1){ urlBusi += 'pages/boothinfo/exhibits-reserve.html'; }else if(source == 'submit'){ urlBusi += 'pages/boothinfo/application_forms.html'; }else{ urlBusi += 'pages/boothinfo/exhibitor_member.html'; } window.location.href = urlBusi + "?token=" + (token || '')+ "&p=" + pid; } } function changeURLArg(url, arg, arg_val) { const u = new URL(url) u.searchParams.set(arg, arg_val) return u.href // var pattern=arg+'=([^&]*)'; // var replaceText=arg+'='+arg_val; // if(url.match(pattern)){ // var tmp='/('+ arg+'=)([^&]*)/gi'; // tmp=url.replace(eval(tmp),replaceText); // return tmp; // }else{ // if(url.match('[\?]')){ // return url+'&'+replaceText; // }else{ // return url+'?'+replaceText; // } // } } } // 会员中心色调 function getStyleData(id) { let setting = { logo: '', bg: '', btnColor: '', codeColor: '', tip: '', } $.ajax({ url: API + "/api/projectInformation/getInformationByProjectId", // url: variableSponsor + '/project/information/getInformationByProjectId', dataType: "json", type: "post", async: false, data: { projectId: id,orgNum, }, success(data) { if (data.state == 1) { var datas = data.result; datas.forEach(function (element, index) { if (element.type == 13) { //登录logo if(element.pic) { setting.logo = element.pic || '' $(".loginLogoImg").attr("src", element.pic); } } else if (element.type == 117) { // 背景图 // console.log(117,element) if (element.pic) { setting.bg = element.pic // ./img/bgImg.jpg $(".conter").css("background-image", `url(${element.pic})`); } } else if (element.type == 118) { // 底部文字 // console.log(118,element) if (element.content) { setting.tip = element.content $(".foot2-body").html(element.content); } } else if (element.type == 120) { // 登录页辅色 if (element.content) { setting.btnColor = element.content setThemeColor("btn", element.content); } } else if (element.type == 121) { // 登录页辅色2 // console.log(121,element) if (element.content) { setting.codeColor = element.content setThemeColor("code", element.content); } } }); // 如果没设置 查询全局 if(id && !setting.tip) { // if(!setting.codeColor || !setting.logo || !setting.tip || !setting.btnColor || !setting.bg){ $.ajax({ url: variableSponsor + '/project/information/getInformationByProjectId', dataType: "json", type: "post", async:false, data: {projectId:0, orgNum,}, success: function (data) { if(data.state ==1){ var datas =data.result datas.forEach(function (element, index) { if(element.type ==13 && !setting.log){ //没设登录logo // if(element.pic){ // $(".loginLogoImg").attr("src",element.pic) // } }else if(element.type == 117 && !setting.bg){ // 没设背景图 // if(element.pic){ // ./img/bgImg.jpg // $(".conter").css("background-image",`url(${element.pic})`) // } }else if(element.type == 118 && !setting.tip){ // 没设底部文字 if(element.content){ $('.foot2-body').html(element.content) } }else if(element.type == 120 && !setting.btnColor){ // 没设登录页辅色 // if(element.content){ // setThemeColor('btn',element.content) // } }else if(element.type == 121 && !setting.codeColor){ // 没设登录页辅色2 // if(element.content){ // setThemeColor('code',element.content) // } } }); } } }) } } }, }); } function setThemeColor(type, val) { let $theme = $(`#js-theme-color-${type}`); let style = `.login-container{ --${type}-color: ${val} }`; console.log("style", style); $theme.html(style); } </script> </body> </html>