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
0ad46886
Commit
0ad46886
authored
Apr 09, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:处理B端免登录
parent
91fa54ed
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
3 deletions
+38
-3
src/data-source/base/request-apis.ts
+4
-1
src/domains/basic-domain/baseService.ts
+7
-2
src/modules/root/Login.jsx
+27
-0
No files found.
src/data-source/base/request-apis.ts
View file @
0ad46886
...
...
@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-12-01 17:21:21
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-0
1-09 11:06:42
* @LastEditTime: 2021-0
4-09 14:28:09
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -44,6 +44,9 @@ export function getLastedVersion(params: object) {
export
function
getEnterpriseUser
(
params
:
object
)
{
return
Service
.
Hades
(
'public/hades/getEnterpriseUser'
,
params
);
}
export
function
getWXWorkLoginNoCheck
(
params
:
object
)
{
return
Service
.
Hades
(
'anon/hades/getWXWorkLoginNoCheck'
,
params
);
}
export
const
getOssClient
=
(
data
:
object
,
instId
:
string
,
...
...
src/domains/basic-domain/baseService.ts
View file @
0ad46886
...
...
@@ -2,12 +2,12 @@
* @Author: wufan
* @Date: 2020-12-01 17:20:49
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-0
1-09 11:08:02
* @LastEditTime: 2021-0
4-09 14:28:59
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
{
getUserStore
,
getUserPermission
,
logout
,
getStoreUser
,
sendBizAuthCode
,
editUserPhone
,
checkBizAuthCode
,
sendNewPhoneAuthCode
,
sendLoginAuthCode
,
login
,
getLastedVersion
,
getEnterpriseUser
}
from
'@/data-source/base/request-apis'
;
import
{
getUserStore
,
getUserPermission
,
logout
,
getStoreUser
,
sendBizAuthCode
,
editUserPhone
,
checkBizAuthCode
,
sendNewPhoneAuthCode
,
sendLoginAuthCode
,
login
,
getLastedVersion
,
getEnterpriseUser
,
getWXWorkLoginNoCheck
}
from
'@/data-source/base/request-apis'
;
export
default
class
StoreService
{
// 获取员工列表
...
...
@@ -52,4 +52,8 @@ export default class StoreService {
static
getEnterpriseUser
(
params
:
any
){
return
getEnterpriseUser
(
params
);
}
static
getWXWorkLoginNoCheck
(
params
:
any
){
return
getWXWorkLoginNoCheck
(
params
);
}
}
\ No newline at end of file
src/modules/root/Login.jsx
View file @
0ad46886
...
...
@@ -24,6 +24,33 @@ function Login(props) {
const
[
phoneError
,
setPhoneError
]
=
useState
(
false
);
const
[
checkObject1
,
setCheckObject1
]
=
useState
({});
useEffect
(()
=>
{
const
enterpriseId
=
getParameterByName
(
"enterpriseId"
);
const
userId
=
getParameterByName
(
"userId"
);
const
from
=
getParameterByName
(
"from"
);
console
.
log
(
'enterpriseId'
,
enterpriseId
);
console
.
log
(
'userId'
,
userId
);
console
.
log
(
'from'
,
from
);
if
(
from
===
'customer'
&&
enterpriseId
&&
userId
){
console
.
log
(
'我进来了'
);
getWXWorkLoginNoCheck
(
enterpriseId
,
userId
);
}
},[])
function
getWXWorkLoginNoCheck
(
enterpriseId
,
userId
){
const
params
=
{
appTermEnum
:
"XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN"
,
enterpriseId
,
userId
}
BaseService
.
getWXWorkLoginNoCheck
(
params
).
then
((
res
)
=>
{
User
.
setUserId
(
res
.
result
.
loginInfo
.
userId
);
User
.
setToken
(
res
.
result
.
loginInfo
.
xmToken
);
User
.
setEnterpriseId
(
res
.
result
.
enterpriseId
);
window
.
RCHistory
.
push
({
pathname
:
`/switch-route`
,
})
})
}
async
function
checkAccount
(
code
,
callback
=
()
=>
{
})
{
callback
();
}
...
...
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