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
962770a7
Commit
962770a7
authored
Mar 09, 2021
by
xiongyuwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
7611fdc5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
39 deletions
+94
-39
Advertising.vue
components/Advertising.vue
+2
-2
index.vue
pages/knowledge/index.vue
+2
-1
login.vue
pages/user/login.vue
+90
-36
No files found.
components/Advertising.vue
View file @
962770a7
...
...
@@ -52,10 +52,10 @@ export default {
* createQrcode('https://xxx.com/')
*/
createQrcode
(
link
)
{
if
(
link
==
"http
s
://wiki.bailuntec.com/category"
)
{
if
(
link
==
"http://wiki.bailuntec.com/category"
)
{
link
=
"https://wiki.bailuntec.com/"
;
}
if
(
link
==
"http
s
://discuz.bailuntec.com/category"
)
{
if
(
link
==
"http://discuz.bailuntec.com/category"
)
{
link
=
"https://discuz.bailuntec.com/"
;
}
...
...
pages/knowledge/index.vue
View file @
962770a7
...
...
@@ -35,7 +35,7 @@ import config from "@/config.js";
export
default
{
data
()
{
return
{
userId
:
this
.
$store
.
getters
[
"session/get"
](
"userId"
)
,
// 获取当前登陆用户的ID
userId
:
""
,
// 获取当前登陆用户的ID
userInfo
:
""
,
qywxUserid
:
""
,
loading
:
false
,
...
...
@@ -47,6 +47,7 @@ export default {
const
params
=
{
include
:
"groups,wechat"
,
};
this
.
userId
=
localStorage
.
getItem
(
"user_id"
);
if
(
!
this
.
userId
)
{
this
.
getCode
();
}
...
...
pages/user/login.vue
View file @
962770a7
...
...
@@ -10,7 +10,7 @@
<div
class=
"form"
>
<div
id=
"changeLogin"
@
click=
"changeLogin"
class=
"code-tip"
>
<p
id=
"right_text"
class=
"code-tip-text"
>
4k 登陆
</p>
</div>
</div>
<div
class=
"welcome"
>
<p>
欢迎登录
</p>
<p>
广州百伦供应链SAA系统
</p>
...
...
@@ -18,7 +18,7 @@
<div
id=
"qr_login"
v-show=
"bailunLoginShow"
>
<div
id=
"wx_login"
></div>
</div>
<div
id=
"qr_login"
v-show=
"fourkLoginShow"
>
<div
id=
"qr_login"
v-show=
"fourkLoginShow"
>
<div
id=
"fourkwx_login"
></div>
</div>
</div>
...
...
@@ -38,7 +38,7 @@ import head from "@/mixin/head";
import
handleError
from
"@/mixin/handleError"
;
import
loginAbout
from
"@/mixin/loginAbout"
;
import
service
from
"../../api/request"
;
import
axios
from
"@/plugins/axios.js"
import
axios
from
"@/plugins/axios.js"
;
import
"@/plugins/qrcode.js"
;
export
default
{
...
...
@@ -49,7 +49,10 @@ export default {
title
:
this
.
$t
(
"user.login"
),
userName
:
""
,
passWord
:
""
,
state
:
""
,
userInfo
:
""
,
userId
:
localStorage
.
getItem
(
"user_id"
),
// 获取当前登陆用户的ID
qywxUserid
:
""
,
state
:
""
,
checked
:
true
,
activeName
:
"0"
,
// 默认激活tab
site_mode
:
""
,
// 站点模式
...
...
@@ -59,8 +62,8 @@ export default {
canReg
:
false
,
ischeck
:
true
,
preurl
:
"/"
,
bailunLoginShow
:
true
,
fourkLoginShow
:
false
bailunLoginShow
:
true
,
fourkLoginShow
:
false
,
};
},
computed
:
{
...
...
@@ -71,8 +74,10 @@ export default {
mounted
()
{
const
{
code
,
preurl
}
=
this
.
$route
.
query
;
this
.
createCode
();
this
.
create4kCode
();
if
(
this
.
userId
)
{
this
.
$router
.
push
(
`/category`
);
}
else
{
this
.
code
=
this
.
getQueryVariable
(
"code"
);
this
.
state
=
this
.
getQueryVariable
(
"state"
);
if
(
preurl
)
{
...
...
@@ -80,6 +85,10 @@ export default {
}
if
(
this
.
code
)
{
this
.
getStaffInfo
(
this
.
code
);
}
else
{
this
.
createCode
();
this
.
create4kCode
();
this
.
pcwxgetCode
();
}
if
(
this
.
forums
&&
this
.
forums
.
set_site
&&
this
.
forums
.
set_site
.
site_mode
)
{
this
.
site_mode
=
this
.
forums
.
set_site
.
site_mode
;
...
...
@@ -91,13 +100,44 @@ export default {
)
{
this
.
canReg
=
true
;
}
}
},
methods
:
{
changeLogin
()
{
this
.
bailunLoginShow
=!
this
.
bailunLoginShow
;
this
.
fourkLoginShow
=!
this
.
fourkLoginShow
;
pcwxgetCode
()
{
let
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
();
if
(
ua
.
match
(
/MicroMessenger/i
)
==
"micromessenger"
&&
ua
.
match
(
/wxwork/i
)
==
"wxwork"
)
{
// 静默授权
//const code = this.getUrlParam("code"); // 截取路径中的code,如果没有就去微信授权,如果已经获取到了就直接传code给后台获取openId
let
local
=
"https://wiki.bailuntec.com/user/login"
;
let
APPID
=
"ww833808f6b8dc0745"
;
// 企业微信
let
href
=
window
.
location
.
href
;
if
(
href
.
indexOf
(
"discuz.bailuntec.com"
)
>
-
1
)
{
local
=
"https://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"
;
}
}
},
changeLogin
()
{
this
.
bailunLoginShow
=
!
this
.
bailunLoginShow
;
this
.
fourkLoginShow
=
!
this
.
fourkLoginShow
;
},
check
(
value
)
{
this
.
ischeck
=
value
;
...
...
@@ -194,7 +234,7 @@ export default {
state
:
"discuz"
,
redirect_uri
:
"https://discuz.bailuntec.com/user/login"
,
});
},
},
create4kCode
()
{
window
.
WwLogin
({
id
:
"fourkwx_login"
,
...
...
@@ -205,19 +245,33 @@ export default {
});
},
getStaffInfo
(
code
)
{
let
_this
=
this
;
axios
.
get
(
`https://discuz.bailuntec.com/api/login?code=
${
code
}
&state=
${
this
.
state
}
`
)
.
get
(
`https://discuz.bailuntec.com/api/login?code=
${
code
}
&state=
${
this
.
state
}
`
)
.
then
((
res
)
=>
{
this
.
userId
=
res
.
data
.
data
.
relationships
.
users
.
data
.
id
;
if
(
res
.
data
.
data
.
relationships
.
users
.
data
.
id
)
{
localStorage
.
setItem
(
"user_id"
,
res
.
data
.
data
.
relationships
.
users
.
data
.
id
);
localStorage
.
setItem
(
"access_token"
,
res
.
data
.
data
.
attributes
.
access_token
);
window
.
location
.
href
=
"https://discuz.bailuntec.com/knowledge"
;
let
isSetItem
=
true
while
(
isSetItem
)
{
localStorage
.
setItem
(
"user_id"
,
res
.
data
.
data
.
relationships
.
users
.
data
.
id
);
localStorage
.
setItem
(
"access_token"
,
res
.
data
.
data
.
attributes
.
access_token
);
let
uid
=
localStorage
.
getItem
(
"user_id"
)
if
(
!!
uid
)
{
location
.
reload
();
isSetIte
=
false
;
}
}
}
});
},
...
...
@@ -250,19 +304,19 @@ 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
{
.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
;
...
...
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