|
|
|
@ -1,9 +1,8 @@
|
|
|
|
|
import { create } from 'zustand'
|
|
|
|
|
import { devtools } from 'zustand/middleware'
|
|
|
|
|
import { fetchJSON, postForm } from '@/utils/request'
|
|
|
|
|
import { fetchJSON } from '@/utils/request'
|
|
|
|
|
import { isEmpty, isNotEmpty } from '@/utils/commons'
|
|
|
|
|
import { API_HOST } from '@/config'
|
|
|
|
|
|
|
|
|
|
import { API_HOST, BUILD_VERSION } from '@/config'
|
|
|
|
|
export const PERM_MERGE_CONVERSATION = 'merge-conversation'
|
|
|
|
|
export const PERM_ASSIGN_NEW_CONVERSATION = 'assign-new-conversation'
|
|
|
|
|
|
|
|
|
@ -194,6 +193,26 @@ const useAuthStore = create(devtools((set, get) => ({
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
sendNotify: async () => {
|
|
|
|
|
const { loginUser } = get()
|
|
|
|
|
const notifyUrl = 'https://p9axztuwd7x8a7.mycht.cn/dingtalk/dingtalkwork/SendMDMsgByDingRobotToGroup'
|
|
|
|
|
|
|
|
|
|
const params = {
|
|
|
|
|
groupid: 'cidFtzcIzNwNoiaGU9Q795CIg==',
|
|
|
|
|
msgTitle: '有人求助',
|
|
|
|
|
msgText: loginUser.username + '上传了销售平台' + BUILD_VERSION + '的日志'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return fetchJSON(notifyUrl, params)
|
|
|
|
|
.then(json => {
|
|
|
|
|
if (json.errcode === 0) {
|
|
|
|
|
console.info('发送通知成功')
|
|
|
|
|
} else {
|
|
|
|
|
throw new Error(json?.errmsg + ': ' + json.errcode)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
}), { name: 'authStore' }))
|
|
|
|
|
|
|
|
|
|
export default useAuthStore
|
|
|
|
|