Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
company_app
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
毛细亚
company_app
Commits
8fa1cd1f
提交
8fa1cd1f
authored
7月 21, 2025
作者:
毛细亚
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更换登录方式
上级
a50001c9
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
31 行增加
和
17 行删除
+31
-17
newLogin.vue
src/views/newLogin.vue
+30
-16
userInfo.vue
src/views/userInfo/userInfo.vue
+1
-1
没有找到文件。
src/views/newLogin.vue
浏览文件 @
8fa1cd1f
...
@@ -4,11 +4,11 @@
...
@@ -4,11 +4,11 @@
<div
class=
"loginContentContainer"
>
<div
class=
"loginContentContainer"
>
<p
class=
"loginContentTitle"
>
选择客服:
</p>
<p
class=
"loginContentTitle"
>
选择客服:
</p>
<div
class=
"loginContentInput rowFlex alignCenter"
>
<div
class=
"loginContentInput rowFlex alignCenter"
>
<el-select
v-model=
"cser_user_id"
placeholder=
"请选择客服"
>
<el-select
v-model=
"cser_user_id"
filterable
placeholder=
"请选择客服"
>
<el-option
v-for=
"item in userList"
:key=
"item.zq_user_id"
clearable
:label=
"item.name"
:value=
"item.zq_user_id"
>
<el-option
v-for=
"item in userList"
:key=
"item.zq_user_id"
clearable
:label=
"item.name"
:value=
"item.zq_user_id"
>
</el-option>
</el-option>
</el-select>
</el-select>
<el-button
type=
"primary"
style=
"margin-left: 10px;"
size=
"small"
@
click=
"
userStartLogin
"
>
点击登录
</el-button>
<el-button
type=
"primary"
style=
"margin-left: 10px;"
size=
"small"
@
click=
"
loginConfirm
"
>
点击登录
</el-button>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -62,11 +62,10 @@ export default {
...
@@ -62,11 +62,10 @@ export default {
if
(
this
.
token
&&
userid
)
{
// 已经钉钉扫码过 重新获取授权 获取签名 注册企微js-sdk
if
(
this
.
token
&&
userid
)
{
// 已经钉钉扫码过 重新获取授权 获取签名 注册企微js-sdk
this
.
getUserList
(
userid
)
this
.
getUserList
(
userid
)
await
this
.
getSignature
();
await
this
.
getSignature
();
}
else
{
}
else
if
(
!
userid
)
{
if
(
!
userid
)
{
//没有企微授权过 并且 钉钉扫码成功 开始微信授权
console
.
log
(
4
)
await
this
.
startWeComSilentAuth
();
await
this
.
startWeComSilentAuth
();
}
}
else
if
(
!
this
.
token
){
this
.
getUserList
(
userid
)
}
}
},
},
...
@@ -75,7 +74,6 @@ export default {
...
@@ -75,7 +74,6 @@ export default {
const
corp_id
=
Cookies
.
get
(
'corp_id'
)
||
this
.
urlParams
.
corp_id
const
corp_id
=
Cookies
.
get
(
'corp_id'
)
||
this
.
urlParams
.
corp_id
const
res
=
await
getUserList
({
userid
:
userid
,
corp_id
:
corp_id
});
const
res
=
await
getUserList
({
userid
:
userid
,
corp_id
:
corp_id
});
this
.
userList
=
res
.
data
this
.
userList
=
res
.
data
console
.
log
(
res
,
'获取客服人员列表'
)
},
},
async
userStartLogin
(){
async
userStartLogin
(){
if
(
!
this
.
cser_user_id
){
if
(
!
this
.
cser_user_id
){
...
@@ -89,8 +87,15 @@ export default {
...
@@ -89,8 +87,15 @@ export default {
try
{
try
{
const
res
=
await
cserSelected
({
cser_id
:
cser_user
.
zq_user_id
,
corp_id
:
corp_id
,
userid
:
userid
});
const
res
=
await
cserSelected
({
cser_id
:
cser_user
.
zq_user_id
,
corp_id
:
corp_id
,
userid
:
userid
});
console
.
log
(
res
,
'选择客服人员登录'
)
console
.
log
(
res
,
'选择客服人员登录'
)
if
(
res
.
status_code
===
1
){
if
(
res
.
status_code
===
1
&&
res
.
data
.
tokens
){
this
.
handleDingCallback
(
res
)
this
.
$message
({
type
:
'warning'
,
message
:
`当前【
${
cser_user
.
name
}
】已上线,下班后请记得点击下线哦~`
,
duration
:
3
*
1000
})
setTimeout
(()
=>
{
this
.
handleDingCallback
(
res
.
data
.
tokens
)
},
2000
)
}
else
{
}
else
{
this
.
$message
.
error
(
res
.
msg
)
this
.
$message
.
error
(
res
.
msg
)
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -105,6 +110,18 @@ export default {
...
@@ -105,6 +110,18 @@ export default {
},
5000
)
},
5000
)
}
}
},
},
loginConfirm
(){
const
cser_user
=
this
.
userList
.
find
(
item
=>
item
.
zq_user_id
===
this
.
cser_user_id
)
this
.
$confirm
(
`确认登录上线吗,上线后所有会话都会归属到客服【
${
cser_user
.
name
}
】`
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
userStartLogin
()
}).
catch
(()
=>
{
this
.
$message
.
info
(
'已取消登录'
)
})
},
// 设置缓存
// 设置缓存
cacheCorp_id
(
corp_id
)
{
cacheCorp_id
(
corp_id
)
{
Cookies
.
set
(
'corp_id'
,
corp_id
,
{
expires
:
7
})
Cookies
.
set
(
'corp_id'
,
corp_id
,
{
expires
:
7
})
...
@@ -246,20 +263,17 @@ export default {
...
@@ -246,20 +263,17 @@ export default {
},
},
// 7. 钉钉扫码回调页面处理
// 7. 钉钉扫码回调页面处理
async
handleDingCallback
(
res
)
{
async
handleDingCallback
(
token
)
{
// 在这里处理钉钉扫码成功的回调
// 在这里处理钉钉扫码成功的回调
const
corp_id
=
Cookies
.
get
(
'corp_id'
)
const
corp_id
=
Cookies
.
get
(
'corp_id'
)
if
(
res
.
data
.
token
&&
res
.
data
.
token
!=
'undefined'
)
{
if
(
token
&&
token
!=
'undefined'
)
{
setToken
(
res
.
data
.
token
)
setToken
(
token
)
this
.
set_token
(
res
.
data
.
token
)
this
.
set_token
(
token
)
// 获取签名
// 获取签名
await
this
.
getSignature
();
await
this
.
getSignature
();
}
else
{
}
else
{
console
.
log
(
'没有token'
)
window
.
location
.
href
=
window
.
location
.
origin
+
'/company_app/index.html?corp_id='
+
corp_id
+
'&msg=notoken'
window
.
location
.
href
=
window
.
location
.
origin
+
'/company_app/index.html?corp_id='
+
corp_id
+
'&msg=notoken'
}
}
},
},
},
},
...
...
src/views/userInfo/userInfo.vue
浏览文件 @
8fa1cd1f
...
@@ -22,7 +22,7 @@ import roleInfo from '@/views/roleInfo.vue'
...
@@ -22,7 +22,7 @@ import roleInfo from '@/views/roleInfo.vue'
import
orderList
from
'@/views/orderList.vue'
import
orderList
from
'@/views/orderList.vue'
import
violationRecord
from
'@/views/ViolationRecord.vue'
import
violationRecord
from
'@/views/ViolationRecord.vue'
import
{
mapState
,
mapMutations
}
from
'vuex'
import
{
mapState
,
mapMutations
}
from
'vuex'
import
Cookies
from
'js-cookie'
export
default
{
export
default
{
name
:
'userInfo'
,
name
:
'userInfo'
,
components
:
{
components
:
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论