Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-cr20g
Project
Project
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
Administrator
dsk-cr20g
Commits
077f62f4
Commit
077f62f4
authored
Aug 22, 2024
by
fulixin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'V20240319三方平台登录改造' into V20240805
parents
798456ab
f50c2397
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
2683 additions
and
1820 deletions
+2683
-1820
SysLoginController.java
...ava/com/dsk/web/controller/system/SysLoginController.java
+268
-262
application-prod.yml
dsk-admin/src/main/resources/application-prod.yml
+29
-6
application-test.yml
dsk-admin/src/main/resources/application-test.yml
+32
-7
application.yml
dsk-admin/src/main/resources/application.yml
+5
-1
LoginUser.java
...main/java/com/dsk/common/core/domain/model/LoginUser.java
+5
-0
ThirdPlatformLoginBody.java
.../dsk/common/core/domain/model/ThirdPlatformLoginBody.java
+19
-0
IndexController.java
...src/main/java/com/dsk/jsk/controller/IndexController.java
+279
-0
IndexService.java
...z-api/src/main/java/com/dsk/jsk/service/IndexService.java
+272
-0
package.json
dsk-operate-ui/package.json
+1
-0
login.js
dsk-operate-ui/src/api/login.js
+32
-20
Navbar.vue
dsk-operate-ui/src/layout/components/Navbar.vue
+6
-3
index.vue
dsk-operate-ui/src/layout/components/Sidebar/index.vue
+8
-1
permission.js
dsk-operate-ui/src/permission.js
+43
-12
index.js
dsk-operate-ui/src/router/index.js
+129
-131
permission.js
dsk-operate-ui/src/store/modules/permission.js
+9
-6
user.js
dsk-operate-ui/src/store/modules/user.js
+30
-2
auth.js
dsk-operate-ui/src/utils/auth.js
+39
-0
401.vue
dsk-operate-ui/src/views/error/401.vue
+69
-41
SysUser.java
dsk-system/src/main/java/com/dsk/system/domain/SysUser.java
+184
-179
SysLoginService.java
...src/main/java/com/dsk/system/service/SysLoginService.java
+705
-636
ISysTenantServiceImpl.java
...va/com/dsk/system/service/impl/ISysTenantServiceImpl.java
+519
-513
No files found.
dsk-admin/src/main/java/com/dsk/web/controller/system/SysLoginController.java
View file @
077f62f4
...
...
@@ -2,28 +2,20 @@ package com.dsk.web.controller.system;
import
cn.dev33.satoken.annotation.SaCheckLogin
;
import
cn.dev33.satoken.annotation.SaIgnore
;
import
cn.dev33.satoken.stp.StpUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.lang.Assert
;
import
cn.hutool.core.lang.RegexPool
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.util.RandomUtil
;
import
cn.hutool.core.util.ReUtil
;
import
com.dsk.common.constant.Constants
;
import
com.dsk.common.constant.GlobalConstants
;
import
com.dsk.common.core.domain.R
;
import
com.dsk.common.exception.ServiceException
;
import
com.dsk.common.tenant.helper.TenantHelper
;
import
com.dsk.common.utils.StringUtils
;
import
com.dsk.common.core.domain.model.*
;
import
com.dsk.common.helper.LoginHelper
;
import
com.dsk.common.utils.redis.RedisUtils
;
import
com.dsk.jsk.util.IpUtil
;
import
com.dsk.system.domain.SysMenu
;
import
com.dsk.system.domain.SysUser
;
import
com.dsk.common.core.domain.model.EmailLoginBody
;
import
com.dsk.common.core.domain.model.LoginBody
;
import
com.dsk.common.core.domain.model.LoginUser
;
import
com.dsk.common.core.domain.model.SmsLoginBody
;
import
com.dsk.common.helper.LoginHelper
;
import
com.dsk.system.domain.vo.LoginVo
;
import
com.dsk.system.domain.vo.RouterVo
;
import
com.dsk.system.domain.vo.SysTenantVo
;
...
...
@@ -31,18 +23,18 @@ import com.dsk.system.service.ISysMenuService;
import
com.dsk.system.service.ISysUserService
;
import
com.dsk.system.service.SysLoginService
;
import
lombok.RequiredArgsConstructor
;
import
org.dromara.sms4j.api.SmsBlend
;
import
org.dromara.sms4j.api.entity.SmsResponse
;
import
org.dromara.sms4j.core.factory.SmsFactory
;
import
org.dromara.sms4j.provider.enumerate.SupplierType
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.ServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.validation.constraints.NotBlank
;
import
java.time.Duration
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 登录验证
...
...
@@ -78,6 +70,19 @@ public class SysLoginController {
return
R
.
ok
(
loginVo
);
}
/**
* 三方平台跳转登录方法
*
* @param tpLoginBody 登录信息
* @return 结果
*/
@SaIgnore
@PostMapping
(
"/thirdPlatformLogin"
)
public
R
<
LoginVo
>
thirdPlatformLogin
(
@Validated
@RequestBody
ThirdPlatformLoginBody
tpLoginBody
,
HttpServletRequest
request
)
{
String
ipAddr
=
IpUtil
.
getIpAddr
(
request
);
return
R
.
ok
(
loginService
.
thirdPlatformLogin
(
tpLoginBody
,
ipAddr
));
}
// /**
// * 发送短信验证码
...
...
@@ -245,6 +250,7 @@ public class SysLoginController {
ajax
.
put
(
"user"
,
user
);
ajax
.
put
(
"roles"
,
loginUser
.
getRolePermission
());
ajax
.
put
(
"permissions"
,
loginUser
.
getMenuPermission
());
ajax
.
put
(
"isThirdPlatformLogin"
,
LoginHelper
.
getLoginUser
().
getIsThirdPlatformLogin
());
return
R
.
ok
(
ajax
);
}
...
...
dsk-admin/src/main/resources/application-prod.yml
View file @
077f62f4
...
...
@@ -52,9 +52,16 @@ spring:
# url: jdbc:mysql://192.168.0.79:3306/dsk_operate_sys?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: dev
# password: 8AXjjCHZ666!
url
:
jdbc:mysql://rds-szh.dsk.com/dos?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username
:
dsk_api_szh
password
:
j1nxbVPF0QS*B57C
# url: jdbc:mysql://rds-szh.dsk.com/dos?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: dsk_api_szh
# password: j1nxbVPF0QS*B57C
# 二十局线上数据库
url
:
jdbc:mysql://123.60.218.188:3306/dsk_operate_online?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username
:
dev
password
:
encPHwi8dbKeL!6X
# 从库数据源
# slave:
# lazy: true
...
...
@@ -104,13 +111,29 @@ spring:
---
# redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
spring
:
redis
:
host
:
redis-szh.dsk.com
# host: redis-szh.dsk.com
# # 端口,默认为6379
# port: 6379
# # 数据库索引
# database: 13
# # 密码
# password: Xi8$r*@d7zn5FaP2
# # 密码(如没有密码请注释掉)
# # password:
# # 连接超时时间
# timeout: 10s
# # 是否开启ssl
# ssl: false
# 二十局redis测试链接
host
:
123.60.218.188
# 端口,默认为6379
port
:
6379
# 数据库索引
database
:
13
# 密码
password
:
Xi8$r*@d7zn5FaP2
password
:
zfTFIJjaN#6xB64r
# 密码(如没有密码请注释掉)
# password:
# 连接超时时间
...
...
dsk-admin/src/main/resources/application-test.yml
View file @
077f62f4
...
...
@@ -49,9 +49,16 @@ spring:
driverClassName
:
com.mysql.cj.jdbc.Driver
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
url
:
jdbc:mysql://120.46.64.239:3306/dsk_operate?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username
:
dskdev
password
:
encPHwi8dbKeL8ZX
# url: jdbc:mysql://120.46.64.239:3306/dsk_operate?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: dskdev
# password: encPHwi8dbKeL8ZX
# 二十局数据库配置
url
:
jdbc:mysql://123.60.218.188:3306/dsk_operate?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username
:
dev
password
:
encPHwi8dbKeL!6X
# 从库数据源
# slave:
# lazy: true
...
...
@@ -101,13 +108,28 @@ spring:
---
# redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
spring
:
redis
:
host
:
120.46.64.239
# host: 120.46.64.239
# # 端口,默认为6379
# port: 6379
# # 数据库索引
# database: 13
# # 密码
# password: zfTFIJjaN#6xB83r
# # 密码(如没有密码请注释掉)
# # password:
# # 连接超时时间
# timeout: 10s
# # 是否开启ssl
# ssl: false
# 二十局redis测试链接
host
:
123.60.218.188
# 端口,默认为6379
port
:
6379
# 数据库索引
database
:
1
3
database
:
1
4
# 密码
password
:
zfTFIJjaN#6xB
83
r
password
:
zfTFIJjaN#6xB
64
r
# 密码(如没有密码请注释掉)
# password:
# 连接超时时间
...
...
@@ -115,6 +137,9 @@ spring:
# 是否开启ssl
ssl
:
false
redisson
:
# redis key前缀
keyPrefix
:
...
...
dsk-admin/src/main/resources/application.yml
View file @
077f62f4
...
...
@@ -29,7 +29,9 @@ captcha:
# 开发环境配置
server
:
# 服务器的HTTP端口,默认为8080
port
:
9098
# port: 9098
# 二十局线上端口9097
port
:
9097
servlet
:
# 应用的访问路径
context-path
:
/
...
...
@@ -142,12 +144,14 @@ security:
# actuator 监控配置
-
/api/**
-
/actuator/**
# - /**
# 多租户配置
tenant
:
# 是否开启
enable
:
true
# enable: false
# 排除表
excludes
:
-
sys_menu
...
...
dsk-common/src/main/java/com/dsk/common/core/domain/model/LoginUser.java
View file @
077f62f4
...
...
@@ -113,6 +113,11 @@ public class LoginUser implements Serializable {
*/
private
Long
roleId
;
/**
* 是否三方登录
*/
private
Boolean
isThirdPlatformLogin
;
/**
* 获取登录id
*/
...
...
dsk-common/src/main/java/com/dsk/common/core/domain/model/ThirdPlatformLoginBody.java
0 → 100644
View file @
077f62f4
package
com
.
dsk
.
common
.
core
.
domain
.
model
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
/**
* 三方平台用户登录对象
*
* @author sxk
*/
@Data
public
class
ThirdPlatformLoginBody
{
/**
* 三方平台跳转本系统所需秘钥
*/
@NotBlank
(
message
=
"桑芳平台登录秘钥不能为空"
)
private
String
thirdPlatformKey
;
}
dsk-module/dsk-biz-api/src/main/java/com/dsk/jsk/controller/IndexController.java
View file @
077f62f4
...
...
@@ -43,4 +43,283 @@ public class IndexController {
public
AjaxResult
bidRank
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
bidRank
(
object
);
}
/**
*
*
* 总金额、总面积统计--刘杰那边的接口
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/statisticsOfAmountAndArea"
)
public
AjaxResult
statisticsOfAmountAndArea
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
statisticsOfAmountAndArea
(
object
);
}
/**
*
*
* 基础维度统计--刘杰那边的接口
* /nationzj/landMarket/commonStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/jcwdtj"
)
public
AjaxResult
jcwdtj
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
jcwdtj
(
object
);
}
/**
*
*
* 前十企业统计--刘杰那边的接口
* /nationzj/landMarket/companyStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/topten"
)
public
AjaxResult
topten
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
topten
(
object
);
}
/**
*
*
* 商机-拟建查询-总金额统计--刘杰那边的接口
* /nationzj/landMarket/companyStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/njzjetj"
)
public
AjaxResult
njzjetj
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
njzjetj
(
object
);
}
/**
*
*
* 商机-拟建查询-基础维度统计--刘杰那边的接口
* /nationzj/landMarket/companyStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/njjcwdtj"
)
public
AjaxResult
njjcwdtj
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
njjcwdtj
(
object
);
}
/**
*
*
* 商机-拟建查询-前十企业统计--刘杰那边的接口
* /nationzj/landMarket/companyStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/njtopten"
)
public
AjaxResult
njtopten
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
njtopten
(
object
);
}
/**
*
*
* 商机-招标公告-总金额统计--刘杰那边的接口
* /nationzj/landMarket/companyStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/zbggzjetj"
)
public
AjaxResult
zbggzjetj
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
zbggzjetj
(
object
);
}
/**
*
*
* 商机-招标公告-基础维度统计--刘杰那边的接口
* /nationzj/landMarket/companyStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/zbggjcwdtj"
)
public
AjaxResult
zbggjcwdtj
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
zbggjcwdtj
(
object
);
}
/**
*
*
* 商机-招标公告-前十企业统计--刘杰那边的接口
* /nationzj/landMarket/companyStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/zbggtopten"
)
public
AjaxResult
zbggtopten
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
zbggtopten
(
object
);
}
/**
*
*
* 招标计划查询-总金额统计--刘杰那边的接口
* /nationzj/landMarket/companyStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/zbjhcxzjetj"
)
public
AjaxResult
zbjhcxzjetj
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
zbjhcxzjetj
(
object
);
}
/**
*
*
* 招标计划查询-基础维度统计--刘杰那边的接口
* /nationzj/landMarket/companyStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/zbjhcxjcwdtj"
)
public
AjaxResult
zbjhcxjcwdtj
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
zbjhcxjcwdtj
(
object
);
}
/**
*
*
* 招标计划查询-前十企业统计--刘杰那边的接口
* /nationzj/landMarket/companyStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/zbjhcxtopten"
)
public
AjaxResult
zbjhcxtopten
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
zbjhcxtopten
(
object
);
}
/**
*
*
* 重点项目清单查询-总金额统计--刘杰那边的接口
* /nationzj/landMarket/companyStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/zdxmqdzjetj"
)
public
AjaxResult
zdxmqdzjetj
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
zdxmqdzjetj
(
object
);
}
/**
*
*
* 重点项目清单查询-基础统计--刘杰那边的接口
* /nationzj/landMarket/companyStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/zdxmqdjctj"
)
public
AjaxResult
zdxmqdjctj
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
zdxmqdjctj
(
object
);
}
/**
*
*
* 重点项目清单查询-前十企业--刘杰那边的接口
* /nationzj/landMarket/companyStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/zdxmqdtopten"
)
public
AjaxResult
zdxmqdtopten
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
zdxmqdtopten
(
object
);
}
/**
*
*
* 专项债项目-总金额统计--刘杰那边的接口
* /nationzj/landMarket/companyStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/zxzxmzjetj"
)
public
AjaxResult
zxzxmzjetj
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
zxzxmzjetj
(
object
);
}
/**
*
*
* 专项债项目-基础统计--刘杰那边的接口
* /nationzj/landMarket/companyStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/zxzxmjctj"
)
public
AjaxResult
zxzxmjctj
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
zxzxmjctj
(
object
);
}
/**
*
*
* 专项债项目查询-企业统计--刘杰那边的接口
* /nationzj/landMarket/companyStatis
* @param object
* @return {@link AjaxResult }
* @throws Exception
*/
@PostMapping
(
value
=
"/zxzxmqytj"
)
public
AjaxResult
zxzxmqytj
(
@RequestBody
JSONObject
object
)
{
return
enterpriseService
.
zxzxmqytj
(
object
);
}
}
dsk-module/dsk-biz-api/src/main/java/com/dsk/jsk/service/IndexService.java
View file @
077f62f4
...
...
@@ -33,6 +33,278 @@ public class IndexService {
@Autowired
private
DskOpenApiUtil
dskOpenApiUtil
;
public
AjaxResult
zxzxmqytj
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/bondProject/companyStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
zxzxmjctj
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/bondProject/commonStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
zxzxmzjetj
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/bondProject/sumStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
zdxmqdtopten
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/bondProject/importantCompanyStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
zdxmqdjctj
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/bondProject/importantCommonStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
zdxmqdzjetj
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/bondProject/importantSumStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
zbjhcxtopten
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/jskBidPlan/companyStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
zbjhcxjcwdtj
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/jskBidPlan/commonStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
zbjhcxzjetj
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/jskBidPlan/sumStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
zbggtopten
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/jskBid/companyStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
zbggjcwdtj
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/jskBid/commonStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
zbggzjetj
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/jskBid/sumStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
njtopten
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/establishment/companyStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
njjcwdtj
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/establishment/commonStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
njzjetj
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/establishment/sumStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
topten
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/landMarket/companyStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
jcwdtj
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/landMarket/commonStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
statisticsOfAmountAndArea
(
JSONObject
object
)
{
JSONObject
page
=
object
.
getJSONObject
(
"page"
);
if
(
ObjectUtil
.
isEmpty
(
page
)){
return
AjaxResult
.
error
(
"page对象不能为空"
);
}
Integer
pageIndex
=
page
.
getInt
(
"page"
),
pageSize
=
page
.
getInt
(
"limit"
);
if
(
ObjectUtil
.
isEmpty
(
pageIndex
)
||
ObjectUtil
.
isEmpty
(
pageSize
)){
return
AjaxResult
.
error
(
"page、limit都不能为空"
);
}
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/landMarket/sumStatis"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
bigWinningBidsPage
(
JSONObject
object
)
{
JSONArray
recentlyBidQueryDtoList
=
object
.
getJSONArray
(
"recentlyBidQueryDto"
);
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<>();
...
...
dsk-operate-ui/package.json
View file @
077f62f4
...
...
@@ -6,6 +6,7 @@
"license"
:
"MIT"
,
"scripts"
:
{
"dev"
:
"vue-cli-service serve"
,
"devmac"
:
"export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve"
,
"build:prod"
:
"vue-cli-service build"
,
"build:test"
:
"vue-cli-service build --mode test"
,
"build:stage"
:
"vue-cli-service build --mode staging"
,
...
...
dsk-operate-ui/src/api/login.js
View file @
077f62f4
import
request
from
'@/utils/request'
import
request
from
'@/utils/request'
;
// 登录方法
export
function
login
(
username
,
password
,
code
,
uuid
)
{
...
...
@@ -7,7 +7,7 @@ export function login(username, password, code, uuid) {
password
,
code
,
uuid
}
}
;
return
request
({
url
:
'/login'
,
headers
:
{
...
...
@@ -15,7 +15,7 @@ export function login(username, password, code, uuid) {
},
method
:
'post'
,
data
:
data
})
})
;
}
// 注册方法
...
...
@@ -27,7 +27,7 @@ export function register(data) {
},
method
:
'post'
,
data
:
data
})
})
;
}
// 获取用户详细信息
...
...
@@ -35,7 +35,7 @@ export function getInfo() {
return
request
({
url
:
'/getInfo'
,
method
:
'get'
})
})
;
}
// 退出方法
...
...
@@ -43,7 +43,7 @@ export function logout() {
return
request
({
url
:
'/logout'
,
method
:
'post'
})
})
;
}
// 获取验证码
...
...
@@ -55,7 +55,7 @@ export function getCodeImg() {
},
method
:
'get'
,
timeout
:
20000
})
})
;
}
//获取租户企业列表
...
...
@@ -63,7 +63,7 @@ export function getTenants() {
return
request
({
url
:
'/user/tenants'
,
method
:
'post'
,
})
})
;
}
// 获取默认租户
...
...
@@ -71,15 +71,15 @@ export function defaultTenantid() {
return
request
({
url
:
'/user/default/tenant'
,
method
:
'post'
,
})
})
;
}
// 切换租户
export
function
changeTenants
(
data
)
{
return
request
({
url
:
'/switch/tenant?tenantId='
+
data
,
url
:
'/switch/tenant?tenantId='
+
data
,
method
:
'post'
,
})
})
;
}
//发送短信验证码(删除组织使用)
...
...
@@ -87,7 +87,7 @@ export function captchaSms() {
return
request
({
url
:
'/getTempSmsCode'
,
method
:
'get'
,
})
})
;
}
//验证短信验证码(删除组织使用)
...
...
@@ -95,8 +95,8 @@ export function checkSmsCode(data) {
return
request
({
url
:
'/checkSmsCode'
,
method
:
'POST'
,
params
:
data
})
params
:
data
})
;
}
//根据用户账号获取用户绑定的租户列表
...
...
@@ -104,8 +104,8 @@ export function userTenantList(data) {
return
request
({
url
:
'/user/tenant/list'
,
method
:
'POST'
,
params
:
data
})
params
:
data
})
;
}
//登录获取验证码
...
...
@@ -113,17 +113,29 @@ export function logincaptchaSms(data) {
return
request
({
url
:
'/captchaSms'
,
method
:
'get'
,
params
:
data
})
params
:
data
})
;
}
//短信登录
export
function
smsLogin
(
data
)
{
return
request
({
url
:
'/smsLogin'
,
method
:
'post'
,
data
:
data
})
data
:
data
})
;
}
/**
* 第三方植入系统
* @param {string} thirdPlatformKey
* @returns
*/
export
const
thirdPlatformLoginApi
=
(
thirdPlatformKey
)
=>
request
({
method
:
"post"
,
url
:
"/thirdPlatformLogin"
,
data
:
{
thirdPlatformKey
}
})
dsk-operate-ui/src/layout/components/Navbar.vue
View file @
077f62f4
...
...
@@ -4,7 +4,7 @@
<div
class=
"left-menu"
:style=
"
{width: scrollerWidth}">
<tags-view
/>
</div>
<div
ref=
"rightMenu"
class=
"flex-box right-menu"
>
<div
ref=
"rightMenu"
class=
"flex-box right-menu"
v-if=
"!isThirdPlatformLogin"
>
<!--
<div
class=
"menu-bells"
><img
src=
"@/assets/images/message.png"
><i
/></div>
-->
<!--
<i
class=
"menu-line"
/>
-->
<el-dropdown
class=
"avatar-container"
trigger=
"hover"
ref=
"mydrodown"
:hide-on-click=
"false"
placement=
"bottom-start"
>
...
...
@@ -40,7 +40,7 @@
<
script
>
import
store
from
"@/store"
;
import
{
mapGetters
}
from
'vuex'
import
{
mapGetters
,
mapState
}
from
'vuex'
import
elementResizeDetectorMaker
from
"element-resize-detector"
import
TagsView
from
'./TagsView'
import
{
getTenants
,
changeTenants
}
from
"@/api/login"
;
...
...
@@ -63,7 +63,10 @@ export default {
'sidebar'
,
'avatar'
,
'name'
])
]),
...
mapState
({
isThirdPlatformLogin
:
state
=>
state
.
user
.
isThirdPlatformLogin
})
},
watch
:
{
offsetWidth
(
newValue
,
oldValue
){
...
...
dsk-operate-ui/src/layout/components/Sidebar/index.vue
View file @
077f62f4
...
...
@@ -4,7 +4,7 @@
<logo
v-if=
"showLogo"
:collapse=
"isCollapse"
/>
<el-scrollbar
:class=
"settings.sideTheme"
wrap-class=
"scrollbar-wrapper"
>
<el-menu
:default-active=
"activeMenu"
:collapse=
"isCollapse"
:background-color=
"variables.menuBg"
:text-color=
"variables.menuText"
:unique-opened=
"true"
:active-text-color=
"settings.theme"
:collapse-transition=
"false"
mode=
"vertical"
>
:unique-opened=
"true"
:active-text-color=
"settings.theme"
:collapse-transition=
"false"
mode=
"vertical"
class=
"left-top-level-menu"
>
<sidebar-item
v-for=
"(route, index) in hidechildren"
:key=
"route.path + index"
:is-collapse=
"isCollapse"
:active-menu=
"activeMenu"
:item=
"route"
:base-path=
"route.path"
:class=
"route.fixed&&route.fixed.isFixed?'sideFoot':''"
:style=
"route.fixed&&route.fixed.isFixed?
{'bottom': route.fixed.number*50+'px'}: bottomMenu
&&
index==routes.length-bottomMenu-2?{'padding-bottom': bottomMenu*50+'px'}:''" />
...
...
@@ -91,3 +91,10 @@ export default {
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.left-top-level-menu
{
padding
:
20px
0px
;
box-sizing
:
border-box
;
}
</
style
>
dsk-operate-ui/src/permission.js
View file @
077f62f4
...
...
@@ -3,14 +3,17 @@ import store from './store';
import
{
Message
}
from
'element-ui'
;
import
NProgress
from
'nprogress'
;
import
'nprogress/nprogress.css'
;
import
{
getToken
}
from
'@/utils/auth'
;
import
{
getToken
,
getThirdPlatform
}
from
'@/utils/auth'
;
import
{
isRelogin
}
from
'@/utils/request'
;
NProgress
.
configure
({
showSpinner
:
false
});
const
whiteList
=
[
'/login'
,
'/register'
];
const
whiteList
=
[
'/login'
,
"/404"
,
"/401"
];
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
// 默认跳转路径 本系统跳转首页,第三方跳转宏观市场
const
platFormKey
=
getThirdPlatform
();
let
defaultRedirectPath
=
platFormKey
?
"/macro/nationalEconomies"
:
"/"
;
NProgress
.
start
();
if
(
getToken
())
{
// tab页签title
...
...
@@ -20,10 +23,10 @@ router.beforeEach((to, from, next) => {
to
.
meta
.
title
&&
store
.
dispatch
(
'settings/setTitle'
,
to
.
meta
.
title
);
/* has token*/
if
(
to
.
path
===
'/login'
)
{
next
({
path
:
'/'
});
next
({
path
:
defaultRedirectPath
});
NProgress
.
done
();
}
else
{
if
(
store
.
getters
.
roles
.
length
===
0
)
{
if
(
!
store
.
state
?.
user
?.
userId
&&
!
store
.
state
?.
user
?.
roles
?.
length
)
{
isRelogin
.
show
=
true
;
// 判断当前用户是否已拉取完user_info信息
store
.
dispatch
(
'GetInfo'
).
then
(()
=>
{
...
...
@@ -34,26 +37,54 @@ router.beforeEach((to, from, next) => {
next
({
...
to
,
replace
:
true
});
// hack方法 确保addRoutes已完成
});
}).
catch
(
err
=>
{
if
(
platFormKey
)
{
store
.
dispatch
(
'FedLogOut'
).
then
(()
=>
{
next
({
path
:
"/401"
,
query
:
{
isSecretFreeLogin
:
true
}
});
});
}
else
{
store
.
dispatch
(
'LogOut'
).
then
(()
=>
{
Message
.
error
(
err
);
sessionStorage
.
removeItem
(
'views'
);
next
({
path
:
'/'
});
});
}
});
}
else
{
next
();
}
}
}
else
{
// 没有token
if
(
whiteList
.
indexOf
(
to
.
path
)
!==
-
1
)
{
// 在免登录白名单,直接进入
next
();
}
else
{
// 非白名单 没有token 判断是否有app key 属于第三方平台
// 第三方平台 获取到 platFormKey 直接通过key 登录
if
(
platFormKey
)
{
store
.
dispatch
(
"secretFreeLogin"
,
platFormKey
).
then
((
res
)
=>
{
next
({
path
:
defaultRedirectPath
});
}).
catch
(
err
=>
{
// appkey 登陆失败 跳转到401
next
({
path
:
"/401"
,
query
:
{
isSecretFreeLogin
:
true
}
});
});
}
else
{
next
(
`/login?redirect=
${
to
.
fullPath
}
`
);
// 否则全部重定向到登录页
NProgress
.
done
();
}
}
}
});
router
.
afterEach
(()
=>
{
...
...
dsk-operate-ui/src/router/index.js
View file @
077f62f4
...
...
@@ -47,11 +47,11 @@ export const constantRoutes = [
component
:
()
=>
import
(
'@/views/login'
),
hidden
:
true
},
{
path
:
'/register'
,
component
:
()
=>
import
(
'@/views/register'
),
hidden
:
true
},
//
{
//
path: '/register',
//
component: () => import('@/views/register'),
//
hidden: true
//
},
{
path
:
'/404'
,
component
:
()
=>
import
(
'@/views/error/404'
),
...
...
@@ -62,33 +62,20 @@ export const constantRoutes = [
component
:
()
=>
import
(
'@/views/error/401'
),
hidden
:
true
},
{
path
:
''
,
component
:
Layout
,
redirect
:
'index'
,
children
:
[
{
path
:
'index'
,
component
:
()
=>
import
(
'@/views/index'
),
name
:
'Index'
,
meta
:
{
title
:
'首页'
,
icon
:
'index'
,
noCache
:
true
}
}
]
},
{
path
:
''
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'urban'
,
children
:
[
{
path
:
'/macro/urban'
,
component
:
()
=>
import
(
'@/views/macro/urban'
),
name
:
'Urban'
,
meta
:
{
title
:
'城投平台'
,
icon
:
'macro'
}
}
]
},
// {
// path: '/macro',
// component: Layout,
// hidden: true,
// // redirect: 'urban',
// children: [
// {
// path: 'urban',
// component: () => import('@/views/macro/urban'),
// name: 'Urban',
// meta: { title: '城投平台', icon: 'macro' }
// }
// ]
// },
// {
// path: '',
// component: Layout,
...
...
@@ -103,20 +90,6 @@ export const constantRoutes = [
// }
// ]
// },
{
path
:
''
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'urban'
,
children
:
[
{
path
:
'/macro/urban'
,
component
:
()
=>
import
(
'@/views/macro/urban'
),
name
:
'Urban'
,
meta
:
{
title
:
'城投平台'
,
icon
:
'macro'
}
}
]
},
{
path
:
'/user'
,
component
:
Layout
,
...
...
@@ -127,7 +100,7 @@ export const constantRoutes = [
path
:
'profile'
,
component
:
()
=>
import
(
'@/views/system/user/profile/index'
),
name
:
'Profile'
,
meta
:
{
title
:
'个人中心'
,
icon
:
'user'
,
noCache
:
true
}
meta
:
{
title
:
'个人中心'
,
icon
:
'user'
,
noCache
:
true
}
}
]
},
...
...
@@ -161,26 +134,26 @@ export const constantRoutes = [
]
},
{
path
:
''
,
path
:
'
/JumpPage.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
'
/JumpPage.html
'
,
children
:
[
{
path
:
'
/JumpPage.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//乙方-企业详情
{
path
:
'/company'
,
path
:
'/company
/:id
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/company/:id
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
name
:
'Company'
,
meta
:
{
title
:
'企业详情'
}
...
...
@@ -189,104 +162,104 @@ export const constantRoutes = [
},
//企业详情-业绩
{
path
:
''
,
path
:
'
/company/:id/performance
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/company/:id/performance
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//企业详情-人员
{
path
:
''
,
path
:
'
/company/:id/personnel
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/company/:id/personnel
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//企业详情-经营信息
{
path
:
''
,
path
:
'
/company/:id/business
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/company/:id/business
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//企业详情-良好行为
{
path
:
''
,
path
:
'
/company/:id/behavior
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/company/:id/behavior
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//企业详情-信用评价
{
path
:
''
,
path
:
'
/company/:id/evaluation
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/company/:id/evaluation
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//企业详情-信用行为
{
path
:
''
,
path
:
'
/company/:id/credit
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/company/:id/credit
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//企业详情-股权
{
path
:
''
,
path
:
'
/company/:id/lt
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/company/:id/lt
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//人员详情
{
path
:
'/personnel'
,
path
:
'/personnel
/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/personnel/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
name
:
'Personnel'
,
meta
:
{
title
:
'人员详情'
}
...
...
@@ -309,13 +282,13 @@ export const constantRoutes = [
},
//公招市场详情
{
path
:
'/gzsc'
,
path
:
'/gzsc
/:id
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/gzsc/:id
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
name
:
'detail-gzsc'
,
meta
:
{
title
:
"公招市场详情"
}
...
...
@@ -324,221 +297,221 @@ export const constantRoutes = [
},
//中标业绩详情
{
path
:
''
,
path
:
'
/performance/zb/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/performance/zb/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//荣誉详情
{
path
:
''
,
path
:
'
/honor/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/honor/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//标讯Pro-招标公告
{
path
:
''
,
path
:
'
/bxpro/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/bxpro/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//中标候选人
{
path
:
''
,
path
:
'
/zbpro/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/zbpro/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//开标记录
{
path
:
''
,
path
:
'
/biz/tbjl/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/biz/tbjl/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//一体化详情
{
path
:
''
,
path
:
'
/performance/sjyth/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/performance/sjyth/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//一体化详情
{
path
:
''
,
path
:
'
/performance/yth/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/performance/yth/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//四库详情
{
path
:
''
,
path
:
'
/performance/sky/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/performance/sky/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//公路系统详情
{
path
:
''
,
path
:
'
/performance/glxt/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/performance/glxt/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//公路系统详情
{
path
:
''
,
path
:
'
/performance/xmzt/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/performance/xmzt/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//水利详情
{
path
:
''
,
path
:
'
/performance/slyj/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/performance/slyj/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//江西住建云详情
{
path
:
''
,
path
:
'
/performance/jxzjy/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/performance/jxzjy/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//北京业绩详情
{
path
:
''
,
path
:
'
/performance/bj/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/performance/bj/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//云南业绩详情
{
path
:
''
,
path
:
'
/performance/yn/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/performance/yn/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//商机-标讯详情
{
path
:
''
,
path
:
'
/biz/bx/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/biz/bx/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//商机-土地交易详情
{
path
:
''
,
path
:
'
/biz/tdjy/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/biz/tdjy/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
},
//商机-拟建项目详情
{
path
:
''
,
path
:
'
/biz/njxm/:id.html
'
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'
noredirect
'
,
redirect
:
''
,
children
:
[
{
path
:
'
/biz/njxm/:id.html
'
,
path
:
''
,
component
:
()
=>
import
(
'@/views/detail'
),
}
]
...
...
@@ -815,6 +788,31 @@ export const dynamicRoutes = [
}
];
/**
* 第三方登录首页
*/
export
const
isThirdPlatformRoutes
=
[
{
path
:
''
,
component
:
Layout
,
redirect
:
'index'
,
children
:
[
{
path
:
'index'
,
component
:
()
=>
import
(
'@/views/index'
),
name
:
'Index'
,
meta
:
{
title
:
'首页'
,
icon
:
'index'
,
noCache
:
true
}
}
]
},
{
path
:
''
,
component
:
Layout
,
redirect
:
'/macro/nationalEconomies'
,
hidden
:
true
}
];
// 防止连续点击多次路由报错
let
routerPush
=
Router
.
prototype
.
push
;
let
routerReplace
=
Router
.
prototype
.
replace
;
...
...
dsk-operate-ui/src/store/modules/permission.js
View file @
077f62f4
import
auth
from
'@/plugins/auth'
;
import
router
,
{
constantRoutes
,
dynamicRoutes
}
from
'@/router'
;
import
router
,
{
constantRoutes
,
dynamicRoutes
,
isThirdPlatformRoutes
}
from
'@/router'
;
import
{
getRouters
}
from
'@/api/menu'
;
import
Layout
from
'@/layout/index'
;
import
ParentView
from
'@/components/ParentView'
;
...
...
@@ -19,7 +19,7 @@ const permission = {
state
.
routes
=
constantRoutes
.
concat
(
routes
);
},
SET_DEFAULT_ROUTES
:
(
state
,
routes
)
=>
{
state
.
defaultRoutes
=
constantRoutes
.
concat
(
routes
)
;
state
.
defaultRoutes
=
routes
;
},
SET_TOPBAR_ROUTES
:
(
state
,
routes
)
=>
{
state
.
topbarRouters
=
routes
;
...
...
@@ -30,21 +30,24 @@ const permission = {
},
actions
:
{
// 生成路由
GenerateRoutes
({
commit
})
{
GenerateRoutes
({
commit
,
rootState
})
{
return
new
Promise
(
resolve
=>
{
// 向后端请求路由数据
getRouters
().
then
(
res
=>
{
const
isThirdPlatformLogin
=
rootState
.
user
.
isThirdPlatformLogin
;
let
_array
=
isThirdPlatformLogin
?
[
isThirdPlatformRoutes
[
1
]]
:
[
isThirdPlatformRoutes
[
0
]];
const
sdata
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
));
const
rdata
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
));
const
sidebarRoutes
=
filterAsyncRouter
(
sdata
);
const
rewriteRoutes
=
filterAsyncRouter
(
rdata
,
false
,
true
);
const
asyncRoutes
=
filterDynamicRoutes
(
dynamicRoutes
);
rewriteRoutes
.
unshift
(...
_array
);
rewriteRoutes
.
push
({
path
:
'*'
,
redirect
:
'/404'
,
hidden
:
true
});
router
.
addRoutes
(
asyncRoutes
);
commit
(
'SET_ROUTES'
,
rewriteRoutes
);
commit
(
'SET_SIDEBAR_ROUTERS'
,
constantRoutes
.
concat
(
sidebarRoutes
));
commit
(
'SET_DEFAULT_ROUTES'
,
sidebarRoutes
);
commit
(
'SET_TOPBAR_ROUTES'
,
sidebarRoutes
);
commit
(
'SET_SIDEBAR_ROUTERS'
,
constantRoutes
.
concat
(
_array
).
concat
(
sidebarRoutes
));
commit
(
'SET_DEFAULT_ROUTES'
,
constantRoutes
.
concat
(
_array
).
concat
(
sidebarRoutes
)
);
commit
(
'SET_TOPBAR_ROUTES'
,
constantRoutes
.
concat
(
_array
).
concat
(
sidebarRoutes
)
);
resolve
(
rewriteRoutes
);
});
});
...
...
dsk-operate-ui/src/store/modules/user.js
View file @
077f62f4
import
{
login
,
logout
,
getInfo
}
from
'@/api/login'
;
import
{
getToken
,
setToken
,
removeToken
,
setTenantid
}
from
'@/utils/auth'
;
import
{
login
,
logout
,
getInfo
,
thirdPlatformLoginApi
}
from
'@/api/login'
;
import
{
getToken
,
setToken
,
removeToken
,
setTenantid
,
removeThirdPlatform
}
from
'@/utils/auth'
;
const
user
=
{
state
:
{
...
...
@@ -10,6 +10,7 @@ const user = {
permissions
:
[],
userId
:
''
,
phonenumber
:
''
,
isThirdPlatformLogin
:
false
},
mutations
:
{
...
...
@@ -33,6 +34,9 @@ const user = {
},
SET_USERPHONE
:
(
state
,
phonenumber
)
=>
{
state
.
phonenumber
=
phonenumber
;
},
SET_IS_THIRD_PLATFORM
:
(
state
,
isThirdPlatformLogin
)
=>
{
state
.
isThirdPlatformLogin
=
isThirdPlatformLogin
?
true
:
false
;
}
},
...
...
@@ -71,6 +75,7 @@ const user = {
commit
(
'SET_AVATAR'
,
avatar
);
commit
(
'SET_USERID'
,
user
.
userId
);
commit
(
'SET_USERPHONE'
,
user
.
phonenumber
);
commit
(
"SET_IS_THIRD_PLATFORM"
,
res
.
data
.
isThirdPlatformLogin
);
resolve
(
res
);
}).
catch
(
error
=>
{
reject
(
error
);
...
...
@@ -97,11 +102,34 @@ const user = {
FedLogOut
({
commit
})
{
return
new
Promise
(
resolve
=>
{
commit
(
'SET_TOKEN'
,
''
);
commit
(
'SET_USERID'
,
""
);
commit
(
'SET_ROLES'
,
[]);
removeToken
();
resolve
();
});
},
// 免密登录 通过appkey登录
async
secretFreeLogin
({
commit
,
state
},
payload
)
{
try
{
if
(
!
payload
)
throw
new
Error
(
"缺少platFormKey"
);
const
tokenInfo
=
await
thirdPlatformLoginApi
(
payload
);
console
.
log
(
tokenInfo
);
if
(
tokenInfo
.
code
==
200
)
{
setToken
(
tokenInfo
.
data
.
token
);
commit
(
'SET_TOKEN'
,
tokenInfo
.
data
.
token
);
setTenantid
(
tokenInfo
.
data
.
tenantId
);
return
true
;
}
else
{
throw
new
Error
(
"appkey登录失败"
);
}
}
catch
(
error
)
{
throw
error
;
}
}
}
};
export
default
user
;
dsk-operate-ui/src/utils/auth.js
View file @
077f62f4
import
Cookies
from
'js-cookie'
;
import
{
getUrlSearchQuery
}
from
'@/utils'
;
const
TokenKey
=
'Admin-Token'
;
const
Tenantid
=
'Tenantid'
;
...
...
@@ -30,3 +31,41 @@ export function setBiAuth(token) {
sessionStorage
.
setItem
(
"DSK_SYSTEM_AUTH_TOKEN"
,
token
);
return
true
;
}
/**
* 获取第三方app key
* @returns
*/
export
function
getThirdPlatform
()
{
const
platForm
=
sessionStorage
.
getItem
(
"PLAT_FORM"
);
if
(
platForm
)
return
platForm
;
// sessiongStorage 未获取到appkey 寻找url上的参数
const
{
platFormKey
}
=
getUrlSearchQuery
();
if
(
platFormKey
)
{
return
setThirdPlatform
(
platFormKey
)
?
platFormKey
:
""
;
}
else
{
return
""
;
};
}
/**
* 储存第三方app key
* @param {*} appkey
* @returns
*/
export
function
setThirdPlatform
(
appkey
)
{
try
{
if
(
!
appkey
)
throw
new
Error
(
""
);
sessionStorage
.
setItem
(
"PLAT_FORM"
,
appkey
);
return
true
;
}
catch
(
error
)
{
return
false
;
}
}
/**
* 移除第三方app key
*/
export
function
removeThirdPlatform
()
{
sessionStorage
.
removeItem
(
"PLAT_FORM"
);
}
dsk-operate-ui/src/views/error/401.vue
View file @
077f62f4
<
template
>
<div
class=
"errPage-container"
>
<el-button
icon=
"arrow-left"
class=
"pan-back-btn"
@
click=
"
back
"
>
返回
<el-button
icon=
"arrow-left"
class=
"pan-back-btn"
@
click=
"
isSecretFreeLogin === false ? back() : aginLogin()
"
>
{{
isSecretFreeLogin
===
false
?
"返回"
:
"重新登录"
}}
</el-button>
<el-row>
<el-col
:span=
"12"
>
...
...
@@ -9,8 +9,8 @@
401错误!
</h1>
<h2>
您没有访问权限!
</h2>
<h6>
对不起,您没有访问权限,请不要进行非法操作!
您可以返回主页面
</h6>
<ul
class=
"list-unstyled"
>
<h6>
对不起,您没有访问权限,请不要进行非法操作!
{{
isSecretFreeLogin
===
true
?
"您可以尝试使用appkey重新登录系统"
:
"您可以返回主界面"
}}
</h6>
<ul
class=
"list-unstyled"
v-if=
"isSecretFreeLogin === false"
>
<li
class=
"link-type"
>
<router-link
to=
"/"
>
回首页
...
...
@@ -26,21 +26,46 @@
</
template
>
<
script
>
import
errGif
from
'@/assets/images/401/401.gif'
import
errGif
from
'@/assets/images/401/401.gif'
;
import
{
getThirdPlatform
}
from
"@/utils/auth"
;
export
default
{
name
:
'Page401'
,
data
()
{
return
{
errGif
:
errGif
+
'?'
+
+
new
Date
()
errGif
:
errGif
+
'?'
+
+
new
Date
(),
isSecretFreeLogin
:
null
};
},
created
()
{
const
{
isSecretFreeLogin
}
=
this
.
$route
.
query
;
try
{
this
.
isSecretFreeLogin
=
JSON
.
parse
(
isSecretFreeLogin
);
}
catch
(
error
)
{
}
},
methods
:
{
back
()
{
if
(
this
.
$route
.
query
.
noGoBack
)
{
this
.
$router
.
push
({
path
:
'/'
})
this
.
$router
.
push
({
path
:
'/'
})
;
}
else
{
this
.
$router
.
go
(
-
1
)
this
.
$router
.
go
(
-
1
);
}
},
aginLogin
()
{
const
platFormKey
=
getThirdPlatform
();
if
(
platFormKey
)
{
this
.
$router
.
replace
({
path
:
"/"
,
query
:
{
platFormKey
}
});
}
else
{
this
.
$router
.
replace
({
path
:
"/login"
});
}
}
}
...
...
@@ -48,14 +73,14 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
.errPage-container
{
.errPage-container
{
width
:
800px
;
max-width
:
100%
;
margin
:
100px
auto
;
.pan-back-btn
{
background
:
#008489
;
color
:
#fff
;
border
:
none
!
important
;
border
:
none
!
important
;
}
.pan-gif
{
margin
:
0
auto
;
...
...
@@ -84,5 +109,8 @@ export default {
}
}
}
h6
{
line-height
:
22px
;
}
}
</
style
>
dsk-system/src/main/java/com/dsk/system/domain/SysUser.java
View file @
077f62f4
...
...
@@ -36,6 +36,11 @@ public class SysUser extends TenantEntity {
@TableId
(
value
=
"user_id"
)
private
Long
userId
;
/**
* 三方平台跳转本系统所需秘钥
*/
private
String
thirdPlatformKey
;
/**
* 部门ID
*/
...
...
dsk-system/src/main/java/com/dsk/system/service/SysLoginService.java
View file @
077f62f4
...
...
@@ -12,8 +12,6 @@ import cn.hutool.core.util.ObjectUtil;
import
cn.hutool.core.util.ReUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.dsk.common.constant.CacheConstants
;
import
com.dsk.common.constant.Constants
;
import
com.dsk.common.constant.GlobalConstants
;
import
com.dsk.common.constant.TenantConstants
;
...
...
@@ -21,6 +19,7 @@ import com.dsk.common.core.domain.dto.RoleDTO;
import
com.dsk.common.core.domain.event.LogininforEvent
;
import
com.dsk.common.core.domain.model.LoginBody
;
import
com.dsk.common.core.domain.model.LoginUser
;
import
com.dsk.common.core.domain.model.ThirdPlatformLoginBody
;
import
com.dsk.common.core.domain.model.XcxLoginUser
;
import
com.dsk.common.enums.DeviceType
;
import
com.dsk.common.enums.LoginType
;
...
...
@@ -31,7 +30,6 @@ import com.dsk.common.exception.user.CaptchaExpireException;
import
com.dsk.common.exception.user.UserException
;
import
com.dsk.common.helper.LoginHelper
;
import
com.dsk.common.tenant.exception.TenantException
;
import
com.dsk.common.tenant.helper.TenantBroker
;
import
com.dsk.common.tenant.helper.TenantHelper
;
import
com.dsk.common.utils.DateUtils
;
import
com.dsk.common.utils.MessageUtils
;
...
...
@@ -39,11 +37,9 @@ import com.dsk.common.utils.ServletUtils;
import
com.dsk.common.utils.StringUtils
;
import
com.dsk.common.utils.redis.RedisUtils
;
import
com.dsk.common.utils.spring.SpringUtils
;
import
com.dsk.system.domain.SysTenant
;
import
com.dsk.system.domain.SysUser
;
import
com.dsk.system.domain.vo.LoginVo
;
import
com.dsk.system.domain.vo.SysTenantVo
;
import
com.dsk.system.mapper.SysTenantMapper
;
import
com.dsk.system.mapper.SysUserMapper
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -161,6 +157,79 @@ public class SysLoginService {
// return StpUtil.getTokenValue();
}
/**
* 三方平台跳转登录方法
*
* @param tpLoginBody 登录信息
* @return 结果
*/
public
LoginVo
thirdPlatformLogin
(
ThirdPlatformLoginBody
tpLoginBody
,
String
ipAddr
)
{
return
TenantHelper
.
ignore
(()
->
{
SysUser
sysUser
=
userMapper
.
selectOne
(
new
LambdaQueryWrapper
<
SysUser
>()
.
eq
(
SysUser:
:
getThirdPlatformKey
,
tpLoginBody
.
getThirdPlatformKey
()));
String
tenantId
=
sysUser
.
getTenantId
();
String
username
=
sysUser
.
getUserName
();
String
password
=
sysUser
.
getPassword
();
if
(
ReUtil
.
isMatch
(
RegexPool
.
MOBILE
,
username
))
{
String
defaultTenantId
=
RedisUtils
.
getCacheObject
(
GlobalConstants
.
PHONE_DEFAULT_TENANT
+
username
);
log
.
info
(
"登录用户:{} 获取缓存默认租户:"
+
tenantId
,
username
);
if
(
StrUtil
.
isEmpty
(
tenantId
)
&&
StrUtil
.
isNotBlank
(
defaultTenantId
))
{
defaultTenantId
=
checkDefaultTenant
(
defaultTenantId
,
username
);
tenantId
=
defaultTenantId
;
}
}
//查询手机号绑定的所有用户
if
(
StrUtil
.
isEmpty
(
tenantId
))
{
List
<
SysUser
>
sysUsers
=
queryListByPhone
(
username
);
if
(
CollectionUtil
.
isEmpty
(
sysUsers
))
{
log
.
info
(
"登录用户:{} 不存在."
,
username
);
throw
new
UserException
(
"user.not.exists"
,
username
);
}
else
if
(
sysUsers
.
size
()
>
1
)
{
//处理存在多个用户的情况,取一个最新租户
SysUser
sysUser1
=
sysUsers
.
get
(
0
);
if
(
ObjectUtil
.
isEmpty
(
sysUser
))
{
log
.
info
(
"登录用户:{} 不存在."
,
username
);
throw
new
UserException
(
"user.not.exists"
,
username
);
}
tenantId
=
sysUser1
.
getTenantId
();
}
else
{
SysUser
sysUser2
=
sysUsers
.
get
(
0
);
tenantId
=
sysUser2
.
getTenantId
();
}
}
// 校验租户
if
(
tenantId
!=
null
)
{
checkTenant
(
tenantId
);
}
if
(
tenantId
==
null
||
""
.
equals
(
tenantId
))
{
tenantId
=
TenantConstants
.
DEFAULT_TENANT_ID
;
}
TenantHelper
.
setTenantId
(
tenantId
);
// 框架登录不限制从什么表查询 只要最终构建出 LoginUser 即可
SysUser
user
=
loadUserByUsername
(
username
);
//checkLogin(LoginType.PASSWORD, username, () -> !BCrypt.checkpw(password, user.getPassword()));
// 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了
LoginUser
loginUser
=
buildLoginUser
(
user
);
// 生成token
loginUser
.
setIpaddr
(
ipAddr
);
loginUser
.
setIsThirdPlatformLogin
(
true
);
LoginHelper
.
loginByDevice
(
loginUser
,
DeviceType
.
PC
);
recordLogininfor
(
username
,
Constants
.
LOGIN_SUCCESS
,
MessageUtils
.
message
(
"user.login.success"
));
recordLoginInfo
(
user
.
getUserId
(),
username
);
LoginVo
loginVo
=
new
LoginVo
();
loginVo
.
setTenantId
(
TenantHelper
.
getTenantId
());
loginVo
.
setAccessToken
(
StpUtil
.
getTokenValue
());
loginVo
.
setExpireIn
(
StpUtil
.
getTokenTimeout
());
return
loginVo
;
});
}
/**
* 登录验证
...
...
dsk-system/src/main/java/com/dsk/system/service/impl/ISysTenantServiceImpl.java
View file @
077f62f4
...
...
@@ -23,6 +23,7 @@ import com.dsk.common.core.domain.entity.SysDictType;
import
com.dsk.common.core.page.TableDataInfo
;
import
com.dsk.common.enums.UserStatus
;
import
com.dsk.common.exception.ServiceException
;
import
com.dsk.common.utils.DingTalkUtil
;
import
com.dsk.common.utils.PasswordUtils
;
import
com.dsk.common.utils.StringUtils
;
import
com.dsk.common.utils.redis.RedisUtils
;
...
...
@@ -175,6 +176,7 @@ public class ISysTenantServiceImpl implements ISysTenantService {
new
LambdaQueryWrapper
<
SysTenant
>().
select
(
SysTenant:
:
getTenantId
),
Convert:
:
toStr
);
String
tenantId
=
generateTenantId
(
tenantIds
);
add
.
setTenantId
(
tenantId
);
boolean
flag
=
baseMapper
.
insert
(
add
)
>
0
;
if
(!
flag
)
{
throw
new
ServiceException
(
"创建租户失败"
);
...
...
@@ -204,6 +206,8 @@ public class ISysTenantServiceImpl implements ISysTenantService {
// 创建系统用户
SysUser
user
=
new
SysUser
();
user
.
setTenantId
(
tenantId
);
String
thirdPlatformKey
=
UUID
.
randomUUID
().
toString
();
user
.
setThirdPlatformKey
(
thirdPlatformKey
);
user
.
setPhonenumber
(
bo
.
getContactPhone
());
//默认新增用户名为手机号
user
.
setUserName
(
bo
.
getContactPhone
());
...
...
@@ -252,13 +256,15 @@ public class ISysTenantServiceImpl implements ISysTenantService {
}
configMapper
.
insertBatch
(
sysConfigList
);
////此处暂用钉钉机器人模拟发送短信
//String content = "【短信通知】:"
// + bo.getContactUserName()
// + ",您好,您已经成功开通数字化经营管理系统,请使用手机号码登录,初始密码为"
// + password
// + "。友情提示:为了您的账号安全,请勿泄露密码。";
//DingTalkUtil.sendDingTalkMsg(content);
//此处暂用钉钉机器人模拟发送短信
String
content
=
"【短信通知】:"
+
bo
.
getContactUserName
()
+
",您好,您已经成功开通数字化经营管理系统,请使用手机号码登录,初始密码为"
+
password
+
",三方平台登录秘钥为"
+
thirdPlatformKey
+
"。友情提示:为了您的账号安全,请勿泄露密码。"
;
DingTalkUtil
.
sendDingTalkMsg
(
content
);
//租户新增成功,发送短信通知租户
LinkedHashMap
<
String
,
String
>
map
=
new
LinkedHashMap
<>(
1
);
...
...
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