钉钉单点跳转搜索页面

(cherry picked from commit 1c32586cdf96ba0433a9b4b79796265ef95a17d3)
This commit is contained in:
Xia Zekun
2024-09-06 17:24:14 +08:00
committed by mzaxd
parent 9feec6a60f
commit 5a63792ae2
7 changed files with 36 additions and 5 deletions
+2 -1
View File
@@ -1,7 +1,8 @@
module.exports = {
pageTitle: {
home: 'home',
myTodo: 'My To Do'
myTodo: 'My To Do',
search: 'search'
},
back: 'back',
chinese: 'chinese',
+2 -1
View File
@@ -1,7 +1,8 @@
module.exports = {
pageTitle: {
home: '首页',
myTodo: '我的待办'
myTodo: '我的待办',
search: '标准检索'
},
back: '返回',
chinese: '中',
+4
View File
@@ -23,6 +23,7 @@ import 'viewerjs/dist/viewer.css'
// 引入 VConsole
import VConsole from 'vconsole'
import * as dd from 'dingtalk-jsapi'
Vue.config.productionTip = false
@@ -74,6 +75,9 @@ new Vue({
store.commit('SET_INFO', Vue.ls.get(USER_INFO))
// 判断是否有token,没有的话就直接单点登录
if (!Vue.ls.get(ACCESS_TOKEN)) {
// 非钉钉平台 不进行钉钉单点登录
if (dd.env.platform === 'notInDingTalk') return
console.log('store.dispatch(\'DingLogin\')')
store.dispatch('DingLogin').catch((e) => {
Toast(e.message)
+10
View File
@@ -14,6 +14,16 @@ const routes = [
hasNavBar: true
}
},
{
path: '/search/generalSearch',
name: 'search',
component: () => import('@/views/search/generalSearch'),
meta: {
hasNavBar: true,
pageTitle: 'search',
hasBack: true
}
},
{
path: '/',
// name: 'home',
+1
View File
@@ -178,6 +178,7 @@ const user = {
commit('SET_INFO', userInfo)
commit('SET_NAME', { username: userInfo.username, realname: userInfo.realname, welcome: welcome() })
commit('SET_AVATAR', userInfo.avatar)
resolve(response)
} else {
reject(response)
+13
View File
@@ -0,0 +1,13 @@
<template>
<div>generalSearch</div>
</template>
<script>
export default {
name: 'generalSearch'
}
</script>
<style scoped>
</style>
+4 -3
View File
@@ -1,8 +1,8 @@
<template>
<div class="login-box">
<van-field v-model="username" border center class="login-form-item" clearable placeholder="请输入账号1"/>
<van-field v-model="password" :autocomplete="false" border center class="login-form-item" placeholder="请输入密码1" :type="passwordFieldType"
<van-field v-model="username" border center class="login-form-item" clearable placeholder="请输入账号"/>
<van-field v-model="password" :autocomplete="false" border center class="login-form-item" placeholder="请输入密码" :type="passwordFieldType"
@paste.native.capture.prevent="handleOperate">
<template #right-icon>
<div @click="switchPasswordType">
@@ -131,11 +131,12 @@ export default {
Toast('登录成功')
const query = this.$route.query
if (query.redirect) {
console.log('redirect:', query)
this.$router.push({ path: query.redirect }).catch((res) => {
console.log(res)
})
} else {
this.$router.push({ path: '/' }).catch((res) => {
this.$router.push({ path: '/search/generalSearch' }).catch((res) => {
console.log(res)
})
}