|
|
@@ -143,7 +143,7 @@
|
|
|
// import { RequestOption } from '@/uni_modules/ygtx-keepService/utssdk/interface.uts';
|
|
|
import { getBaseUrl } from '../../utils/request'
|
|
|
import { KeepLive } from '@/uni_modules/android-keeplive'
|
|
|
- import { getMyNotify } from '../../api/index/index'
|
|
|
+ import { getMyNotify, registerServer} from '../../api/index/index'
|
|
|
import {checkPermi} from '../../utils/storage'
|
|
|
// const handleStartKeepAlive = (userId: string) => {
|
|
|
// let notifyUrl = getBaseUrl() + "/mobile/notify";
|
|
|
@@ -556,6 +556,21 @@
|
|
|
console.error('处理超时工单点击事件失败:', e)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ const registerPush =() =>{
|
|
|
+ console.log("获取CID")
|
|
|
+ uni.getPushClientId({
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res.cid);
|
|
|
+ registerServer(res.cid).then((result:any) => {
|
|
|
+ console.log("注册成功");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fail(err) {
|
|
|
+ console.log(err)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
// 初始化
|
|
|
onMounted(() => {
|
|
|
@@ -567,9 +582,9 @@
|
|
|
if(userId!=null){
|
|
|
console.log("监听:"+userId)
|
|
|
handleKeepAlive()
|
|
|
+ registerPush();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
// 加载待接单数量
|
|
|
loadAssignedCount()
|
|
|
|