Commit 06c3b66e by xiongyuwen

no message

parent fc7813e9
......@@ -55,6 +55,10 @@ export default {
if (link == "http://wiki.bailuntec.com/category") {
link = "http://wiki.bailuntec.com/";
}
if (link == "http://discuz.bailuntec.com/category") {
link = "http://discuz.bailuntec.com/";
}
if (process.client) {
this.qrcode = null;
this.$nextTick(() => {
......
......@@ -123,6 +123,7 @@ export default {
showSyncWanPanloading: false,
showSyncWanPan: false,
inputVal: "",
isTest:false,
code: "", // 邀请码
canReg: false,
siteClose: false,
......@@ -159,7 +160,6 @@ export default {
if (!!this.$store.state.user) {
const users = this.$store.state.user.info.attributes;
if (!!users) {
console.log(users, 22);
if (users.username == "熊裕文") {
this.showSyncWanPan = true;
}
......@@ -182,18 +182,18 @@ export default {
this.showSyncWanPan = false;
// 获取cookies拿到token
var token = this.getCookie("BailunToken");
if(process.env_NODE_ENV!=='production'){
token =
this.isTest=false;
if(this.isTest)
{
token =
"Bearer%20eyJhbGciOiJSUzI1NiIsImtpZCI6IjQ1ZmMzZDYzYjRmNGM5YjAzMWVhNjQ0MzhhNTE1NmM3IiwidHlwIjoiSldUIn0.eyJuYmYiOjE2MTAxNzMxNTAsImV4cCI6MTYxMDIwOTE1MCwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo1MDAxIiwiYXVkIjpbImh0dHA6Ly9sb2NhbGhvc3Q6NTAwMS9yZXNvdXJjZXMiLCJiYWlsdW5BcGkiXSwiY2xpZW50X2lkIjoiYmFpbHVuQ2xpZW50Iiwic3ViIjoi54aK6KOV5paHIiwiYXV0aF90aW1lIjoxNjEwMTczMTUwLCJpZHAiOiJsb2NhbCIsIlVzZXJJZCI6IjI5MjEyNzAiLCJXeFVzZXJJZCI6Inhpb25neXV3ZW4iLCJzdWNlc3NzIjoidHJ1ZSIsIkNvbXBhbnkiOiJ7XCJJZFwiOjEsXCJDb21wYW55Q29kZVwiOlwiYmFpbHVuXCIsXCJDb21wYW55TmFtZVwiOlwi5bm_5bee55m-5Lym5L6b5bqU6ZO-56eR5oqA5pyJ6ZmQ5YWs5Y-4XCJ9IiwiQWxsQ29tcGFueSI6IkZhbHNlIiwiVXNlckNvZGVOZXciOiJCTDE4ODQiLCJVc2VyQ29kZSI6IkJMNTU2NjkyMiIsIk9hVXNlcklkIjoiMzk4OCIsIkRlcGFydG1lbnQiOiJ7XCJEZXBhcnRtZW50SWRcIjoyNTYsXCJOYW1lXCI6XCLliIrnmbvlsI_nu4RcIixcIkNvZGVcIjpcIlwifSIsInNjb3BlIjpbIm9wZW5pZCIsInByb2ZpbGUiLCJiYWlsdW5BcGkiXSwiYW1yIjpbImN1c3RvbSJdfQ.LWd_QutKJiG_zgE8kW2om5I5SB-rEA-c4LHvDZ0CzMLDGNNq-n40WodpD6W3W0nncKSObmvAycGo4Ko5bboAdP4zJykpoHEqSZ2naOZGwpvq8YnE50Ce0Nw1QgLWm0sXdNK6AfxItT04MOqjmhGrZ3KkQsS6VujXFCxBq1Mt2aVjhAgZjH5MKNMrPBuFN2h1l-fDWsjDoJw7JBNQQOJ2PlXHTCXIKLN3GzLt7VTmUa1Up8UozfoXu2k5Vzl5tCrNgGIUAmgdvME_I_eE3M-Klmqa6Tb2XfSRGqkmc7fnbF79ni4YtvxgYhQHAl-v9BNJF3OtQKXnGtGSaUC8rMTxzg";
}else{
token = token.replace("Bearer%20", "").replace("Bearer ", "");
}
if (token) {
// 有值
const jwt = require("jsonwebtoken");
const wxUserid = process.env_NODE_ENV!=='production'?"xiongyuwen":jwt.decode(token).WxUserId;
const wxUserid = this.isTest?"xiongyuwen":jwt.decode(token).WxUserId;
// 更加微信用户id获取对应得用户信息并返回
axios
.get(`http://discuz.bailuntec.com/api/login?useid=${wxUserid}`)
......
......@@ -109,14 +109,27 @@ export default {
) {
// 静默授权
//const code = this.getUrlParam("code"); // 截取路径中的code,如果没有就去微信授权,如果已经获取到了就直接传code给后台获取openId
const local = "http://wiki.bailuntec.com/user/login";
const APPID = "ww833808f6b8dc0745"; // 企业微信
window.location.href =
"https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
APPID +
"&redirect_uri=" +
encodeURIComponent(local) +
"&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
let local = "http://wiki.bailuntec.com/user/login";
let APPID = "ww833808f6b8dc0745"; // 企业微信
let href=window.location.href;
if (href.indexOf("discuz.bailuntec.com") > -1) {
local = "http://discuz.bailuntec.com/user/login";
APPID = "ww4e7dd5ae312eb101"; // 企业微信
window.location.href =
"https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
APPID +
"&redirect_uri=" +
encodeURIComponent(local) +
"&response_type=code&scope=snsapi_base&state=4k#wechat_redirect";
} else {
window.location.href =
"https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
APPID +
"&redirect_uri=" +
encodeURIComponent(local) +
"&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
}
} else {
this.$message.warning(`请先登录`);
}
......
......@@ -8,13 +8,19 @@
</div>
</div>
<div class="form">
<div id="changeLogin" @click="changeLogin" class="code-tip">
<p id="right_text" class="code-tip-text">4k 登陆</p>
</div>
<div class="welcome">
<p>欢迎登录</p>
<p>广州百伦供应链SAA系统</p>
</div>
<div id="qr_login">
<div id="qr_login" v-show="bailunLoginShow">
<div id="wx_login"></div>
</div>
<div id="qr_login" v-show="fourkLoginShow">
<div id="fourkwx_login"></div>
</div>
</div>
</div>
<div class="div_footer">
......@@ -43,6 +49,7 @@ export default {
title: this.$t("user.login"),
userName: "",
passWord: "",
state:"",
checked: true,
activeName: "0", // 默认激活tab
site_mode: "", // 站点模式
......@@ -52,6 +59,8 @@ export default {
canReg: false,
ischeck: true,
preurl: "/",
bailunLoginShow:true,
fourkLoginShow:false
};
},
computed: {
......@@ -63,7 +72,9 @@ export default {
mounted() {
const { code, preurl } = this.$route.query;
this.createCode();
this.create4kCode();
this.code = this.getQueryVariable("code");
this.state = this.getQueryVariable("state");
if (preurl) {
this.preurl = preurl;
}
......@@ -80,9 +91,14 @@ export default {
) {
this.canReg = true;
}
this.createCode();
},
methods: {
changeLogin()
{
this.bailunLoginShow=!this.bailunLoginShow;
this.fourkLoginShow=!this.fourkLoginShow;
},
check(value) {
this.ischeck = value;
},
......@@ -178,10 +194,19 @@ export default {
state: "discuz",
redirect_uri: "http://discuz.bailuntec.com/user/login",
});
},
create4kCode() {
window.WwLogin({
id: "fourkwx_login",
appid: "ww4e7dd5ae312eb101",
agentid: "1000011",
state: "4k",
redirect_uri: "http://discuz.bailuntec.com/user/login",
});
},
getStaffInfo(code) {
axios
.get(`http://discuz.bailuntec.com/api/login?code=${code}`)
.get(`http://discuz.bailuntec.com/api/login?code=${code}&state=${this.state}`)
.then((res) => {
if (res.data.data.relationships.users.data.id) {
localStorage.setItem(
......@@ -225,6 +250,30 @@ export default {
height: 35px;
font-size: 26px;
}
.login .form .code-tip {
cursor: pointer;
width: 102px;
height: 128px;
position: absolute;
right: 0;
top: 0;
background-image: url('../../assets/to_qr.png');
background-position: center;
background-size: 100%;
background-repeat: no-repeat;
}
.login .form .code-tip .code-tip-text {
line-height: 34px;
position: absolute;
right: 5px;
top: 12px;
width: 52px;
height: 34px;
font-size: 12px;
font-weight: 600;
color: #ffffff;
letter-spacing: 1px;
}
.register-select {
display: flex;
flex-direction: column;
......@@ -349,6 +398,11 @@ export default {
height: 500px;
margin-left: 20%;
}
#fourkwx_login {
width: 500px;
height: 500px;
margin-left: 20%;
}
.login .bg {
position: fixed;
......
......@@ -36,6 +36,11 @@ export default [
pc: "/user/login"
},
{
// 注册
h5: "/pages/user/4kmileslogin",
pc: "/user/4kmileslogin"
},
{
// 手机号登录
h5: "/pages/user/phone-login",
pc: "/user/phone-login"
......
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