Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DiscuzWeb
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Discuz
DiscuzWeb
Commits
06c3b66e
Commit
06c3b66e
authored
Feb 27, 2021
by
xiongyuwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
fc7813e9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
17 deletions
+93
-17
to_qr.png
assets/to_qr.png
+0
-0
Advertising.vue
components/Advertising.vue
+4
-0
Header.vue
components/Header.vue
+6
-6
index.vue
pages/knowledge/index.vue
+21
-8
login.vue
pages/user/login.vue
+57
-3
routerHash.js
plugins/routerHash.js
+5
-0
No files found.
assets/to_qr.png
0 → 100644
View file @
06c3b66e
7.33 KB
components/Advertising.vue
View file @
06c3b66e
...
@@ -55,6 +55,10 @@ export default {
...
@@ -55,6 +55,10 @@ export default {
if
(
link
==
"http://wiki.bailuntec.com/category"
)
{
if
(
link
==
"http://wiki.bailuntec.com/category"
)
{
link
=
"http://wiki.bailuntec.com/"
;
link
=
"http://wiki.bailuntec.com/"
;
}
}
if
(
link
==
"http://discuz.bailuntec.com/category"
)
{
link
=
"http://discuz.bailuntec.com/"
;
}
if
(
process
.
client
)
{
if
(
process
.
client
)
{
this
.
qrcode
=
null
;
this
.
qrcode
=
null
;
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
...
...
components/Header.vue
View file @
06c3b66e
...
@@ -123,6 +123,7 @@ export default {
...
@@ -123,6 +123,7 @@ export default {
showSyncWanPanloading
:
false
,
showSyncWanPanloading
:
false
,
showSyncWanPan
:
false
,
showSyncWanPan
:
false
,
inputVal
:
""
,
inputVal
:
""
,
isTest
:
false
,
code
:
""
,
// 邀请码
code
:
""
,
// 邀请码
canReg
:
false
,
canReg
:
false
,
siteClose
:
false
,
siteClose
:
false
,
...
@@ -159,7 +160,6 @@ export default {
...
@@ -159,7 +160,6 @@ export default {
if
(
!!
this
.
$store
.
state
.
user
)
{
if
(
!!
this
.
$store
.
state
.
user
)
{
const
users
=
this
.
$store
.
state
.
user
.
info
.
attributes
;
const
users
=
this
.
$store
.
state
.
user
.
info
.
attributes
;
if
(
!!
users
)
{
if
(
!!
users
)
{
console
.
log
(
users
,
22
);
if
(
users
.
username
==
"熊裕文"
)
{
if
(
users
.
username
==
"熊裕文"
)
{
this
.
showSyncWanPan
=
true
;
this
.
showSyncWanPan
=
true
;
}
}
...
@@ -182,18 +182,18 @@ export default {
...
@@ -182,18 +182,18 @@ export default {
this
.
showSyncWanPan
=
false
;
this
.
showSyncWanPan
=
false
;
// 获取cookies拿到token
// 获取cookies拿到token
var
token
=
this
.
getCookie
(
"BailunToken"
);
var
token
=
this
.
getCookie
(
"BailunToken"
);
if
(
process
.
env_NODE_ENV
!==
'production'
){
this
.
isTest
=
false
;
token
=
if
(
this
.
isTest
)
{
token
=
"Bearer%20eyJhbGciOiJSUzI1NiIsImtpZCI6IjQ1ZmMzZDYzYjRmNGM5YjAzMWVhNjQ0MzhhNTE1NmM3IiwidHlwIjoiSldUIn0.eyJuYmYiOjE2MTAxNzMxNTAsImV4cCI6MTYxMDIwOTE1MCwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo1MDAxIiwiYXVkIjpbImh0dHA6Ly9sb2NhbGhvc3Q6NTAwMS9yZXNvdXJjZXMiLCJiYWlsdW5BcGkiXSwiY2xpZW50X2lkIjoiYmFpbHVuQ2xpZW50Iiwic3ViIjoi54aK6KOV5paHIiwiYXV0aF90aW1lIjoxNjEwMTczMTUwLCJpZHAiOiJsb2NhbCI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tGSaUC8rMTxzg"
;
}
else
{
}
else
{
token
=
token
.
replace
(
"Bearer%20"
,
""
).
replace
(
"Bearer "
,
""
);
token
=
token
.
replace
(
"Bearer%20"
,
""
).
replace
(
"Bearer "
,
""
);
}
}
if
(
token
)
{
if
(
token
)
{
// 有值
// 有值
const
jwt
=
require
(
"jsonwebtoken"
);
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获取对应得用户信息并返回
// 更加微信用户id获取对应得用户信息并返回
axios
axios
.
get
(
`http://discuz.bailuntec.com/api/login?useid=
${
wxUserid
}
`
)
.
get
(
`http://discuz.bailuntec.com/api/login?useid=
${
wxUserid
}
`
)
...
...
pages/knowledge/index.vue
View file @
06c3b66e
...
@@ -109,14 +109,27 @@ export default {
...
@@ -109,14 +109,27 @@ export default {
)
{
)
{
// 静默授权
// 静默授权
//const code = this.getUrlParam("code"); // 截取路径中的code,如果没有就去微信授权,如果已经获取到了就直接传code给后台获取openId
//const code = this.getUrlParam("code"); // 截取路径中的code,如果没有就去微信授权,如果已经获取到了就直接传code给后台获取openId
const
local
=
"http://wiki.bailuntec.com/user/login"
;
let
local
=
"http://wiki.bailuntec.com/user/login"
;
const
APPID
=
"ww833808f6b8dc0745"
;
// 企业微信
let
APPID
=
"ww833808f6b8dc0745"
;
// 企业微信
window
.
location
.
href
=
let
href
=
window
.
location
.
href
;
"https://open.weixin.qq.com/connect/oauth2/authorize?appid="
+
if
(
href
.
indexOf
(
"discuz.bailuntec.com"
)
>
-
1
)
{
APPID
+
local
=
"http://discuz.bailuntec.com/user/login"
;
"&redirect_uri="
+
APPID
=
"ww4e7dd5ae312eb101"
;
// 企业微信
encodeURIComponent
(
local
)
+
window
.
location
.
href
=
"&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
;
"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
{
}
else
{
this
.
$message
.
warning
(
`请先登录`
);
this
.
$message
.
warning
(
`请先登录`
);
}
}
...
...
pages/user/login.vue
View file @
06c3b66e
...
@@ -8,13 +8,19 @@
...
@@ -8,13 +8,19 @@
</div>
</div>
</div>
</div>
<div
class=
"form"
>
<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"
>
<div
class=
"welcome"
>
<p>
欢迎登录
</p>
<p>
欢迎登录
</p>
<p>
广州百伦供应链SAA系统
</p>
<p>
广州百伦供应链SAA系统
</p>
</div>
</div>
<div
id=
"qr_login"
>
<div
id=
"qr_login"
v-show=
"bailunLoginShow"
>
<div
id=
"wx_login"
></div>
<div
id=
"wx_login"
></div>
</div>
</div>
<div
id=
"qr_login"
v-show=
"fourkLoginShow"
>
<div
id=
"fourkwx_login"
></div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"div_footer"
>
<div
class=
"div_footer"
>
...
@@ -43,6 +49,7 @@ export default {
...
@@ -43,6 +49,7 @@ export default {
title
:
this
.
$t
(
"user.login"
),
title
:
this
.
$t
(
"user.login"
),
userName
:
""
,
userName
:
""
,
passWord
:
""
,
passWord
:
""
,
state
:
""
,
checked
:
true
,
checked
:
true
,
activeName
:
"0"
,
// 默认激活tab
activeName
:
"0"
,
// 默认激活tab
site_mode
:
""
,
// 站点模式
site_mode
:
""
,
// 站点模式
...
@@ -52,6 +59,8 @@ export default {
...
@@ -52,6 +59,8 @@ export default {
canReg
:
false
,
canReg
:
false
,
ischeck
:
true
,
ischeck
:
true
,
preurl
:
"/"
,
preurl
:
"/"
,
bailunLoginShow
:
true
,
fourkLoginShow
:
false
};
};
},
},
computed
:
{
computed
:
{
...
@@ -63,7 +72,9 @@ export default {
...
@@ -63,7 +72,9 @@ export default {
mounted
()
{
mounted
()
{
const
{
code
,
preurl
}
=
this
.
$route
.
query
;
const
{
code
,
preurl
}
=
this
.
$route
.
query
;
this
.
createCode
();
this
.
createCode
();
this
.
create4kCode
();
this
.
code
=
this
.
getQueryVariable
(
"code"
);
this
.
code
=
this
.
getQueryVariable
(
"code"
);
this
.
state
=
this
.
getQueryVariable
(
"state"
);
if
(
preurl
)
{
if
(
preurl
)
{
this
.
preurl
=
preurl
;
this
.
preurl
=
preurl
;
}
}
...
@@ -80,9 +91,14 @@ export default {
...
@@ -80,9 +91,14 @@ export default {
)
{
)
{
this
.
canReg
=
true
;
this
.
canReg
=
true
;
}
}
this
.
createCode
();
},
},
methods
:
{
methods
:
{
changeLogin
()
{
this
.
bailunLoginShow
=!
this
.
bailunLoginShow
;
this
.
fourkLoginShow
=!
this
.
fourkLoginShow
;
},
check
(
value
)
{
check
(
value
)
{
this
.
ischeck
=
value
;
this
.
ischeck
=
value
;
},
},
...
@@ -178,10 +194,19 @@ export default {
...
@@ -178,10 +194,19 @@ export default {
state
:
"discuz"
,
state
:
"discuz"
,
redirect_uri
:
"http://discuz.bailuntec.com/user/login"
,
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
)
{
getStaffInfo
(
code
)
{
axios
axios
.
get
(
`http://discuz.bailuntec.com/api/login?code=
${
code
}
`
)
.
get
(
`http://discuz.bailuntec.com/api/login?code=
${
code
}
&state=
${
this
.
state
}
`
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
data
.
data
.
relationships
.
users
.
data
.
id
)
{
if
(
res
.
data
.
data
.
relationships
.
users
.
data
.
id
)
{
localStorage
.
setItem
(
localStorage
.
setItem
(
...
@@ -225,6 +250,30 @@ export default {
...
@@ -225,6 +250,30 @@ export default {
height
:
35px
;
height
:
35px
;
font-size
:
26px
;
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
{
.register-select
{
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
...
@@ -349,6 +398,11 @@ export default {
...
@@ -349,6 +398,11 @@ export default {
height
:
500px
;
height
:
500px
;
margin-left
:
20%
;
margin-left
:
20%
;
}
}
#fourkwx_login
{
width
:
500px
;
height
:
500px
;
margin-left
:
20%
;
}
.login
.bg
{
.login
.bg
{
position
:
fixed
;
position
:
fixed
;
...
...
plugins/routerHash.js
View file @
06c3b66e
...
@@ -36,6 +36,11 @@ export default [
...
@@ -36,6 +36,11 @@ export default [
pc
:
"/user/login"
pc
:
"/user/login"
},
},
{
{
// 注册
h5
:
"/pages/user/4kmileslogin"
,
pc
:
"/user/4kmileslogin"
},
{
// 手机号登录
// 手机号登录
h5
:
"/pages/user/phone-login"
,
h5
:
"/pages/user/phone-login"
,
pc
:
"/user/phone-login"
pc
:
"/user/phone-login"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment