Commit e5f75fa9 by 张立顺

feat 埋点登录添加

1 parent c2100d63
...@@ -267,4 +267,14 @@ module.exports = { ...@@ -267,4 +267,14 @@ module.exports = {
data data
); );
}, },
/**
* 员工登录日志记录保存
*/
loginRecordSave(data) {
return api.post(
"dj.api.smartcarlife.staff.login.record.save",
data
);
},
}; };
...@@ -103,6 +103,9 @@ App({ ...@@ -103,6 +103,9 @@ App({
// wx.reLaunch({url: '/pages/accountItems/accountItems'}) // wx.reLaunch({url: '/pages/accountItems/accountItems'})
util.setSessionId(data?.sessionId) util.setSessionId(data?.sessionId)
wx.reLaunch({ url: '/pages/loading/loading' }) wx.reLaunch({ url: '/pages/loading/loading' })
// let { uuid } = wx.$util.getUserInfo()
let now = new Date()
api.loginRecordSave({ staffUuid: data.noSignInUuid, loginTime: now.format('yyyy-MM-dd hh:mm:ss') })
return return
} else { } else {
util.removeStorage() util.removeStorage()
......
...@@ -449,6 +449,10 @@ Page({ ...@@ -449,6 +449,10 @@ Page({
if (num == 0) wx.$router.reLaunch(pageUrl[num]) if (num == 0) wx.$router.reLaunch(pageUrl[num])
else wx.$router.go(pageUrl[num]) else wx.$router.go(pageUrl[num])
this.setData({ jumpPageFlag: false }) this.setData({ jumpPageFlag: false })
// console.log(wx.$util.getUserInfo(), 'wx.$util.getUserInfo()');
let { uuid } = wx.$util.getUserInfo()
let now = new Date()
api.loginRecordSave({ staffUuid: uuid, loginTime: now.format('yyyy-MM-dd hh:mm:ss') })
} }
}, },
...@@ -466,6 +470,9 @@ Page({ ...@@ -466,6 +470,9 @@ Page({
}) })
wx.$router.go('pages.sceneIndex') wx.$router.go('pages.sceneIndex')
this.setData({ jumpPageFlag: false }) this.setData({ jumpPageFlag: false })
let { uuid } = wx.$util.getUserInfo()
let now = new Date()
api.loginRecordSave({ staffUuid: uuid, loginTime: now.format('yyyy-MM-dd hh:mm:ss') })
return return
} }
// 仅一家4s店 // 仅一家4s店
...@@ -490,12 +497,18 @@ Page({ ...@@ -490,12 +497,18 @@ Page({
}) })
wx.$router.go('pages.sceneIndex') wx.$router.go('pages.sceneIndex')
this.setData({ jumpPageFlag: false }) this.setData({ jumpPageFlag: false })
let { uuid } = wx.$util.getUserInfo()
let now = new Date()
api.loginRecordSave({ staffUuid: uuid, loginTime: now.format('yyyy-MM-dd hh:mm:ss') })
} else if (!result?.length) { } else if (!result?.length) {
this.setData({ jumpPageFlag: false }) this.setData({ jumpPageFlag: false })
return wx.$util.showToast('园区店关联的4s店商户账号无效,请联系总部管理员') return wx.$util.showToast('园区店关联的4s店商户账号无效,请联系总部管理员')
} else { } else {
wx.$router.go(pageUrl) wx.$router.go(pageUrl)
this.setData({ jumpPageFlag: false }) this.setData({ jumpPageFlag: false })
let { uuid } = wx.$util.getUserInfo()
let now = new Date()
api.loginRecordSave({ staffUuid: uuid, loginTime: now.format('yyyy-MM-dd hh:mm:ss') })
} }
}) })
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!