Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
eed8f085
Commit
eed8f085
authored
Apr 13, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:处理跳转至C端
parent
3496fe7d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
12 deletions
+20
-12
src/common/js/user.ts
+15
-8
src/modules/root/Header.jsx
+1
-1
src/modules/root/Login.jsx
+4
-3
No files found.
src/common/js/user.ts
View file @
eed8f085
/*
/*
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-08-31 09:34:25
* @Date: 2020-08-31 09:34:25
* @LastEditors:
wuf
an
* @LastEditors:
zhangleyu
an
* @LastEditTime: 2021-0
1-09 15:50:08
* @LastEditTime: 2021-0
4-13 17:08:34
* @Description:
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -94,13 +94,20 @@ class User {
...
@@ -94,13 +94,20 @@ class User {
removeEnterpriseId
()
{
removeEnterpriseId
()
{
return
Storage
.
remove
(
`
${
PREFIX
}
_enterpriseId`
)
return
Storage
.
remove
(
`
${
PREFIX
}
_enterpriseId`
)
}
}
getCustomerStoreId
(){
return
Storage
.
get
(
`
${
PREFIX
}
_customerStoreId`
);
}
setCustomerStoreId
(
value
:
any
)
{
return
Storage
.
set
(
`
${
PREFIX
}
_customerStoreId`
,
value
);
}
clearUserInfo
(){
clearUserInfo
(){
Storage
.
remove
(
`
${
USER_PREFIX
}
_token
_
${
Storage
.
get
(
`
${
USER_PREFIX
}
_storeId`
)}
`
);
Storage
.
remove
(
`
${
USER_PREFIX
}
_token`
);
Storage
.
remove
(
`
${
USER_PREFIX
}
_userId
_
${
Storage
.
get
(
`
${
USER_PREFIX
}
_storeId`
)}
`
);
Storage
.
remove
(
`
${
USER_PREFIX
}
_userId`
);
Storage
.
remove
(
`
${
USER_PREFIX
}
_userPhone
_
${
Storage
.
get
(
`
${
USER_PREFIX
}
_storeId`
)}
`
);
Storage
.
remove
(
`
${
USER_PREFIX
}
_userPhone`
);
Storage
.
remove
(
`
${
USER_PREFIX
}
_bindPhone
_
${
Storage
.
get
(
`
${
USER_PREFIX
}
_storeId`
)}
`
);
Storage
.
remove
(
`
${
USER_PREFIX
}
_bindPhone`
);
Storage
.
remove
(
`
${
USER_PREFIX
}
_bindWeChat
_
${
Storage
.
get
(
`
${
USER_PREFIX
}
_storeId`
)}
`
);
Storage
.
remove
(
`
${
USER_PREFIX
}
_bindWeChat`
);
Storage
.
remove
(
`
${
USER_PREFIX
}
_userName_
${
Storage
.
get
(
`
${
USER_PREFIX
}
_storeId`
)}
`
);
Storage
.
remove
(
`
${
USER_PREFIX
}
_userName_
${
Storage
.
get
(
`
${
USER_PREFIX
}
_storeId`
)}
`
);
Storage
.
remove
(
`
${
USER_PREFIX
}
_avatar_
${
Storage
.
get
(
`
${
USER_PREFIX
}
_storeId`
)}
`
);
Storage
.
remove
(
`
${
USER_PREFIX
}
_avatar_
${
Storage
.
get
(
`
${
USER_PREFIX
}
_storeId`
)}
`
);
Storage
.
remove
(
`
${
USER_PREFIX
}
_customerId_
${
Storage
.
get
(
`
${
USER_PREFIX
}
_storeId`
)}
`
);
Storage
.
remove
(
`
${
USER_PREFIX
}
_customerId_
${
Storage
.
get
(
`
${
USER_PREFIX
}
_storeId`
)}
`
);
...
...
src/modules/root/Header.jsx
View file @
eed8f085
...
@@ -27,7 +27,7 @@ function Header(props) {
...
@@ -27,7 +27,7 @@ function Header(props) {
const
[
nickName
,
setNickName
]
=
useState
(
''
);
const
[
nickName
,
setNickName
]
=
useState
(
''
);
const
[
phone
,
setPhone
]
=
useState
(
''
);
const
[
phone
,
setPhone
]
=
useState
(
''
);
const
ctx
=
useContext
(
XMContext
);
const
ctx
=
useContext
(
XMContext
);
const
htmlUrl
=
`
${
LIVE_SHARE
}
store/index?id=
${
User
.
getStoreId
()}
&userId=
${
User
.
getUserId
()}
&from=work_weixin`
;
const
htmlUrl
=
`
${
LIVE_SHARE
}
store/index?id=
${
User
.
get
Customer
StoreId
()}
&userId=
${
User
.
getUserId
()}
&from=work_weixin`
;
const
storeUserId
=
User
.
getStoreUserId
();
const
storeUserId
=
User
.
getStoreUserId
();
const
enterpriseId
=
User
.
getEnterpriseId
();
const
enterpriseId
=
User
.
getEnterpriseId
();
...
...
src/modules/root/Login.jsx
View file @
eed8f085
...
@@ -29,9 +29,10 @@ function Login(props) {
...
@@ -29,9 +29,10 @@ function Login(props) {
const
enterpriseId
=
getParameterByName
(
"enterpriseId"
);
const
enterpriseId
=
getParameterByName
(
"enterpriseId"
);
const
userId
=
getParameterByName
(
"userId"
);
const
userId
=
getParameterByName
(
"userId"
);
const
from
=
getParameterByName
(
"from"
);
const
from
=
getParameterByName
(
"from"
);
console
.
log
(
'enterpriseId'
,
enterpriseId
);
const
storeId
=
getParameterByName
(
"storeId"
);
console
.
log
(
'userId'
,
userId
);
if
(
storeId
){
console
.
log
(
'from'
,
from
);
User
.
setCustomerStoreId
(
storeId
);
}
if
(
from
===
'customer'
&&
enterpriseId
&&
userId
){
if
(
from
===
'customer'
&&
enterpriseId
&&
userId
){
if
(
!
user
.
getToken
()
||
enterpriseId
!==
user
.
getEnterpriseId
()
){
if
(
!
user
.
getToken
()
||
enterpriseId
!==
user
.
getEnterpriseId
()
){
getWXWorkLoginNoCheck
(
enterpriseId
,
userId
);
getWXWorkLoginNoCheck
(
enterpriseId
,
userId
);
...
...
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