通讯录添加同步人员信息按钮

This commit is contained in:
2024-12-04 16:34:29 +08:00
parent 4e1140419a
commit 0fb61604d5
2 changed files with 22 additions and 3 deletions
+12
View File
@@ -33,6 +33,18 @@ export function getByPhone(data){
} }
}) })
} }
// 保存所有用户,即同步钉钉用户信息
export function syncDeptUsers(){
return request({
url: '/user/saveUser',
method: 'get',
headers:{
'Authorization': localStorage.getItem('userToken')
}
})
}
// 手机号拜访人姓名 // 手机号拜访人姓名
export function getUserNameByTel(phone){ export function getUserNameByTel(phone){
return request({ return request({
+9 -2
View File
@@ -13,7 +13,7 @@
</div> </div>
</header> </header>
<div class="content"> <div class="content">
<h2>通讯录</h2> <h2>通讯录</h2><button @click="handleSync" class="entering-button">同步人员信息</button>
<div class="content-box" > <div class="content-box" >
<div class="nav"> <div class="nav">
<div @click="onClickDept(item.deptId)" v-for="item in deptArr" class="li" :class="item.deptId == deptId ? 'active' : ''" :style=" item.name.length >= 6 ? 'padding-right: 0.28rem;' : '' " :key="item.userId"> <div @click="onClickDept(item.deptId)" v-for="item in deptArr" class="li" :class="item.deptId == deptId ? 'active' : ''" :style=" item.name.length >= 6 ? 'padding-right: 0.28rem;' : '' " :key="item.userId">
@@ -42,7 +42,8 @@
</template> </template>
<script setup> <script setup>
import { rulesPhone, compareTime, timeDiff,formatDate } from '../com/index.js' import { rulesPhone, compareTime, timeDiff,formatDate } from '../com/index.js'
// import { getShop, getKind } from '../api/user.js' // getShop, getKind
import { syncDeptUsers } from '../api/user.js'
import { reactive, ref } from 'vue' import { reactive, ref } from 'vue'
import { Toast, ImagePreview, Skeleton } from 'vant'; import { Toast, ImagePreview, Skeleton } from 'vant';
import dd from 'dingtalk-jsapi' import dd from 'dingtalk-jsapi'
@@ -188,6 +189,12 @@
router.push('/specialCrowd') router.push('/specialCrowd')
} }
// 同步钉钉用户信息
const handleSync = () =>{
syncDeptUsers().then(res =>{
Toast.success(res.msg)
})
}
if(token.value){ if(token.value){
// localStorage.setItem('token', 123) // localStorage.setItem('token', 123)