|
@@ -1,53 +1,73 @@
|
|
<template>
|
|
<template>
|
|
- <div class="login">
|
|
|
|
- <div class="login-par">
|
|
|
|
- <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-position="left" label-width="0px" class="demo-ruleForm login-container">
|
|
|
|
- <div class="login-logo">
|
|
|
|
- <img src="../assets/image/login_logo.png" style="width:80px;height:80px;"/>
|
|
|
|
- </div>
|
|
|
|
- <h3 class="title">{{ $t('workingHoursHousekeeper') }}</h3>
|
|
|
|
- <el-form-item class="login-input" prop="username">
|
|
|
|
- <el-input type="text" v-model="ruleForm.username" autocomplete="off" :placeholder="$t('zhang-hao-shou-ji-hao')" clearable prefix-icon="el-icon-user-solid"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item class="login-input" prop="password">
|
|
|
|
- <el-input type="password" v-model="ruleForm.password" @keyup.enter.native="handleSubmit" autocomplete="off" :placeholder="$t('mi-ma')" show-password prefix-icon="el-icon-lock"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item class="login-button" style="width:100%;">
|
|
|
|
- <el-button type="primary" style="width:100%;" @click.native.prevent="handleSubmit" :loading="logining">{{ $t('login') }}</el-button>
|
|
|
|
- </el-form-item>
|
|
|
|
- <div class="toRegister">
|
|
|
|
- <el-link type="primary" class="btn" style="float:left;" :underline="false">{{ $t('lian-xi-ke-fu') }}
|
|
|
|
- <div class="service">
|
|
|
|
- <p style="color: #333">{{ $t('sao-ma-jia-ke-fu-wei-xin') }}</p>
|
|
|
|
- <img src="../assets/image/code.jpg">
|
|
|
|
- <p><span style="color: #333">QQ:</span><span id="QQ">3052894409</span></p>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <div class="login" v-if="!isCorpWX">
|
|
|
|
+ <div class="login-par">
|
|
|
|
+ <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-position="left" label-width="0px" class="demo-ruleForm login-container">
|
|
|
|
+ <div class="login-logo">
|
|
|
|
+ <img src="../assets/image/login_logo.png" style="width:80px;height:80px;"/>
|
|
|
|
+ </div>
|
|
|
|
+ <h3 class="title">{{ $t('workingHoursHousekeeper') }}</h3>
|
|
|
|
+ <el-form-item class="login-input" prop="username">
|
|
|
|
+ <el-input type="text" v-model="ruleForm.username" autocomplete="off" :placeholder="$t('zhang-hao-shou-ji-hao')" clearable prefix-icon="el-icon-user-solid"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item class="login-input" prop="password">
|
|
|
|
+ <el-input type="password" v-model="ruleForm.password" @keyup.enter.native="handleSubmit" autocomplete="off" :placeholder="$t('mi-ma')" show-password prefix-icon="el-icon-lock"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item class="login-button" style="width:100%;">
|
|
|
|
+ <el-button type="primary" style="width:100%;" @click.native.prevent="handleSubmit" :loading="logining">{{ $t('login') }}</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <div class="additional">
|
|
|
|
+ <el-divider content-position="center">或</el-divider>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="externalLanding">
|
|
|
|
+ <div class="externalLanding_img" @click="wxworkCli()">
|
|
|
|
+ <img src="../assets/image/qiyeweix.png" alt="">
|
|
</div>
|
|
</div>
|
|
- </el-link>
|
|
|
|
- <el-link type="primary" style="margin-right:5px;" @click="dialogVisible=true" :underline="false">
|
|
|
|
- {{ $t('shi-yong-shuo-ming') }} </el-link>
|
|
|
|
- <el-link type="primary" v-if="!isCorpWX" @click="jumpTo" :underline="false">{{ $t('qi-ye-zhu-ce') }}</el-link>
|
|
|
|
|
|
+ </div>
|
|
|
|
+ <div class="toRegister">
|
|
|
|
+ <el-link type="primary" class="btn" style="float:left;" :underline="false">{{ $t('lian-xi-ke-fu') }}
|
|
|
|
+ <div class="service">
|
|
|
|
+ <p style="color: #333">{{ $t('sao-ma-jia-ke-fu-wei-xin') }}</p>
|
|
|
|
+ <img src="../assets/image/code.jpg">
|
|
|
|
+ <p><span style="color: #333">QQ:</span><span id="QQ">3052894409</span></p>
|
|
|
|
+ </div>
|
|
|
|
+ </el-link>
|
|
|
|
+ <el-link type="primary" style="margin-right:5px;" @click="dialogVisible=true" :underline="false">
|
|
|
|
+ {{ $t('shi-yong-shuo-ming') }} </el-link>
|
|
|
|
+ <el-link type="primary" v-if="!isCorpWX" @click="jumpTo" :underline="false">{{ $t('qi-ye-zhu-ce') }}</el-link>
|
|
|
|
+ </div>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ <el-dialog :title="$t('shi-yong-shuo-ming')" :visible.sync="dialogVisible" width="500px">
|
|
|
|
+ <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_基础版.docx" download="工时管家使用说明_基础版.docx"
|
|
|
|
+ target="_blank">工时管家使用说明_基础版.docx</a></p>
|
|
|
|
+ <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_项目管理专业版.docx" download="工时管家使用说明_项目管理专业版.docx"
|
|
|
|
+ target="_blank">工时管家使用说明_项目管理专业版.docx</a></p>
|
|
|
|
+ <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_建筑工程专业版.docx" download="工时管家使用说明_建筑工程专业版.docx"
|
|
|
|
+ target="_blank">工时管家使用说明_建筑工程专业版.docx</a></p>
|
|
|
|
+ <!-- <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_项目经理.docx" download="工时管家使用说明_项目经理.docx"
|
|
|
|
+ target="_blank">工时管家使用说明_项目经理.docx</a></p>
|
|
|
|
+ <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_普通员工.docx" download="工时管家使用说明_普通员工.docx"
|
|
|
|
+ target="_blank">工时管家使用说明_普通员工.docx</a></p> -->
|
|
|
|
+
|
|
|
|
+ </el-dialog>
|
|
|
|
+ <el-dialog title="企业微信扫码登陆" :visible.sync="wxworkFlg" width="500px">
|
|
|
|
+ <div>
|
|
|
|
+ <div id="wxcode"></div>
|
|
</div>
|
|
</div>
|
|
- </el-form>
|
|
|
|
|
|
+ </el-dialog>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 企业微信的话 -->
|
|
|
|
+ <div class="qiweix" v-if="isCorpWX">
|
|
|
|
+ 正在进入系统...
|
|
</div>
|
|
</div>
|
|
- <el-dialog :title="$t('shi-yong-shuo-ming')" :visible.sync="dialogVisible" width="500px">
|
|
|
|
- <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_基础版.docx" download="工时管家使用说明_基础版.docx"
|
|
|
|
- target="_blank">工时管家使用说明_基础版.docx</a></p>
|
|
|
|
- <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_项目管理专业版.docx" download="工时管家使用说明_项目管理专业版.docx"
|
|
|
|
- target="_blank">工时管家使用说明_项目管理专业版.docx</a></p>
|
|
|
|
- <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_建筑工程专业版.docx" download="工时管家使用说明_建筑工程专业版.docx"
|
|
|
|
- target="_blank">工时管家使用说明_建筑工程专业版.docx</a></p>
|
|
|
|
- <!-- <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_项目经理.docx" download="工时管家使用说明_项目经理.docx"
|
|
|
|
- target="_blank">工时管家使用说明_项目经理.docx</a></p>
|
|
|
|
- <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_普通员工.docx" download="工时管家使用说明_普通员工.docx"
|
|
|
|
- target="_blank">工时管家使用说明_普通员工.docx</a></p> -->
|
|
|
|
-
|
|
|
|
- </el-dialog>
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import * as dd from 'dingtalk-jsapi';
|
|
import * as dd from 'dingtalk-jsapi';
|
|
import "../permissions.js"
|
|
import "../permissions.js"
|
|
|
|
+ import WxLogin from "../assets/js/wwLogin.js"
|
|
export default {
|
|
export default {
|
|
inject:['reloads'],
|
|
inject:['reloads'],
|
|
data() {
|
|
data() {
|
|
@@ -63,9 +83,17 @@
|
|
rules: {
|
|
rules: {
|
|
username: [{ required: true, message: this.$t('peaseenterthe'), trigger: 'blur' },],
|
|
username: [{ required: true, message: this.$t('peaseenterthe'), trigger: 'blur' },],
|
|
password: [{ required: true, message: this.$t('peaseenterthe'), trigger: 'blur' },]
|
|
password: [{ required: true, message: this.$t('peaseenterthe'), trigger: 'blur' },]
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ wxworkFlg: false
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ watch: {
|
|
|
|
+ $route(to) {
|
|
|
|
+ if (to.query.code) {
|
|
|
|
+ this.getStaffInfo(to.query.code)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
created() {
|
|
created() {
|
|
// this.langChange()
|
|
// this.langChange()
|
|
if (localStorage.userInfo != null) {
|
|
if (localStorage.userInfo != null) {
|
|
@@ -82,13 +110,14 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
|
|
+ // this.wxworkCli()
|
|
var ua = navigator.userAgent.toLowerCase();
|
|
var ua = navigator.userAgent.toLowerCase();
|
|
if (ua.indexOf("wxwork") > 0) {
|
|
if (ua.indexOf("wxwork") > 0) {
|
|
this.isCorpWX = true;
|
|
this.isCorpWX = true;
|
|
}
|
|
}
|
|
|
|
+ let href = window.location.href;
|
|
if (this.isCorpWX) {
|
|
if (this.isCorpWX) {
|
|
//企业微信环境下,尝试自动登录
|
|
//企业微信环境下,尝试自动登录
|
|
- let href = window.location.href;
|
|
|
|
//判断企业微信,是否存在授权
|
|
//判断企业微信,是否存在授权
|
|
//尝试自动登录
|
|
//尝试自动登录
|
|
if (href.indexOf('hasTriedAutoLogin') == -1) {
|
|
if (href.indexOf('hasTriedAutoLogin') == -1) {
|
|
@@ -124,7 +153,19 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- if (localStorage.userInfo != null) {
|
|
|
|
|
|
+ //浏览器上使用扫码登录
|
|
|
|
+ if (href.indexOf("userId") > 0) {
|
|
|
|
+ //后台经过验证后,重定向过来带上了userId
|
|
|
|
+ var loginUserId = href.substring(href.indexOf("userId=")+"userId=".length);
|
|
|
|
+ if (loginUserId.includes('#/')) {
|
|
|
|
+ loginUserId = loginUserId.substring(0, loginUserId.indexOf('#/'));
|
|
|
|
+ }
|
|
|
|
+ var path = null;
|
|
|
|
+ if (href.indexOf('path') > 0) {
|
|
|
|
+ path = href.split('path=')[1].split('&')[0];
|
|
|
|
+ }
|
|
|
|
+ this.loginByUserId(loginUserId, path);
|
|
|
|
+ } else if (localStorage.userInfo != null) {
|
|
var user = JSON.parse(localStorage.userInfo);
|
|
var user = JSON.parse(localStorage.userInfo);
|
|
if (user.company.packageSimple == 1) {
|
|
if (user.company.packageSimple == 1) {
|
|
//简易模式,直接进入工时统计表
|
|
//简易模式,直接进入工时统计表
|
|
@@ -176,6 +217,24 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ wxworkCli() {
|
|
|
|
+ // this.wxworkFlg = true
|
|
|
|
+ // this.$nextTick(()=>{
|
|
|
|
+ // var obj = new WxLogin({
|
|
|
|
+ // id: 'wxcode', // 登录页面显示二维码的容器id
|
|
|
|
+ // appid: 'wwf11426cf618e1703', // 企业微信的CorpID,在企业微信管理端查看
|
|
|
|
+ // redirect_uri: encodeURIComponent('http://localhost:10086/#/login'), // 重定向的地址,需要进行encode
|
|
|
|
+ // usertype: 'member'
|
|
|
|
+ // })
|
|
|
|
+ // })
|
|
|
|
+ var appId = "wwf11426cf618e1703";//企业微信第三方的SUIT ID
|
|
|
|
+ var url = "https://worktime.ttkuaiban.com/api/corpWXScanningAuth";//授权回调页面
|
|
|
|
+ var weixinUrl=`https://open.work.weixin.qq.com/wwopen/sso/3rd_qrConnect?appid=${appId}&redirect_uri=${url}&state=0&usertype=member`;
|
|
|
|
+ window.location.href = weixinUrl;
|
|
|
|
+ },
|
|
|
|
+ getStaffInfo() {
|
|
|
|
+ console.log('执行了没')
|
|
|
|
+ },
|
|
setlangChange() {
|
|
setlangChange() {
|
|
localStorage.setItem("lang", 'en')
|
|
localStorage.setItem("lang", 'en')
|
|
},
|
|
},
|
|
@@ -251,7 +310,7 @@
|
|
},
|
|
},
|
|
tryAutoLogin() {
|
|
tryAutoLogin() {
|
|
var appId = "ww4e237fd6abb635af";//企业微信第三方的SUIT ID
|
|
var appId = "ww4e237fd6abb635af";//企业微信第三方的SUIT ID
|
|
- var url = "http://worktime.ttkuaiban.com/api/corpWXAuth";//授权回调页面
|
|
|
|
|
|
+ var url = "https://worktime.ttkuaiban.com/api/corpWXAuth";//授权回调页面
|
|
var weixinUrl="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appId+"&redirect_uri="+encodeURI(url)+"&response_type=code&scope=snsapi_base&state=1#wechat_redirect";
|
|
var weixinUrl="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appId+"&redirect_uri="+encodeURI(url)+"&response_type=code&scope=snsapi_base&state=1#wechat_redirect";
|
|
window.location.href = weixinUrl;
|
|
window.location.href = weixinUrl;
|
|
},
|
|
},
|
|
@@ -268,6 +327,14 @@
|
|
} else {
|
|
} else {
|
|
this.$router.push({ path: user.moduleList[0].path })
|
|
this.$router.push({ path: user.moduleList[0].path })
|
|
}
|
|
}
|
|
|
|
+ if (!path) {
|
|
|
|
+ path = user.moduleList[0].path;
|
|
|
|
+ }
|
|
|
|
+ //去掉链接上存在的参数
|
|
|
|
+ if (location.href.indexOf("?")>0) {
|
|
|
|
+ var newHref = location.href.split("?")[0] + '#' + (path.indexOf('/')>-1?path:('/'+path));
|
|
|
|
+ location.href = newHref;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
@@ -429,6 +496,41 @@
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
|
+ .qiweix {
|
|
|
|
+ width: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ padding: 50px 0;
|
|
|
|
+ font-size: 40px;
|
|
|
|
+ color: #505458;
|
|
|
|
+ }
|
|
|
|
+ .additional {
|
|
|
|
+ width: 100%;
|
|
|
|
+ text-align: center;
|
|
|
|
+ padding: 20px 0;
|
|
|
|
+ color: #505458;
|
|
|
|
+ }
|
|
|
|
+ .externalLanding {
|
|
|
|
+ width: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ .externalLanding_img {
|
|
|
|
+ width: 30px;
|
|
|
|
+ height: 30px;
|
|
|
|
+ border: 1px solid #409EFF;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ position: relative;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ img {
|
|
|
|
+ width: 80%;
|
|
|
|
+ height: 80%;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
.login {
|
|
.login {
|
|
height: 100%;
|
|
height: 100%;
|
|
.login-par {
|
|
.login-par {
|
|
@@ -449,7 +551,7 @@
|
|
-moz-border-radius: 5px;
|
|
-moz-border-radius: 5px;
|
|
background-clip: padding-box;
|
|
background-clip: padding-box;
|
|
width: 315px;
|
|
width: 315px;
|
|
- height: 380px;
|
|
|
|
|
|
+ // height: 380px;
|
|
padding: 25px 35px 25px 35px;
|
|
padding: 25px 35px 25px 35px;
|
|
background: #fff;
|
|
background: #fff;
|
|
border: 1px solid #eaeaea;
|
|
border: 1px solid #eaeaea;
|