Compare commits
No commits in common. "eab54b9320350e2173e4073b9d3805c1deb70c26" and "059e59ed61722c25250e06cfdec1820fe752e486" have entirely different histories.
eab54b9320
...
059e59ed61
|
@ -10,8 +10,7 @@ export const reqGetRegionAndCity = () => request({ url: `/WRD-admin/sys/user/Rei
|
||||||
// export const reqSelectEngiStatus = (year, month, page, limit) => request({ url: `/WRD-admin/sys/workorder/page`, method: 'get', params: { year, month, page, limit } });
|
// export const reqSelectEngiStatus = (year, month, page, limit) => request({ url: `/WRD-admin/sys/workorder/page`, method: 'get', params: { year, month, page, limit } });
|
||||||
|
|
||||||
// 带部门
|
// 带部门
|
||||||
// export const reqSelectEngiStatusByDept = (year, month, deptId, page, limit) => request({ url: `/WRD-admin/sys/workorder/pageSelect`, method: 'get', params: { year, month, deptId, page, limit }})
|
export const reqSelectEngiStatusByDept = (year, month, deptId, page, limit) => request({ url: `/WRD-admin/sys/workorder/pageSelect`, method: 'get', params: { year, month, deptId, page, limit }})
|
||||||
export const reqSelectEngiStatusByDept = (year, month, deptId, page, limit, gids) => request({ url: `/WRD-admin/sys/workorder/pageSelectV2`, method: 'get', params: { year, month, deptId, page, limit, gids }})
|
|
||||||
|
|
||||||
// 工程师状态查询
|
// 工程师状态查询
|
||||||
export const reqSelectEngiStatusByMap = (year, month, page, limit) => request({ url: `/WRD-admin/sys/workorder/pageSelect`, method: 'get', params: { year, month, page, limit }})
|
export const reqSelectEngiStatusByMap = (year, month, page, limit) => request({ url: `/WRD-admin/sys/workorder/pageSelect`, method: 'get', params: { year, month, page, limit }})
|
||||||
|
|
|
@ -9,18 +9,6 @@ export function login(data) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// ONEID登录功能(通过code获取对应的用户token)
|
|
||||||
export function getOneIdToken(param) {
|
|
||||||
return request({
|
|
||||||
// 本地测试接口
|
|
||||||
// url: '/WRD-admin/oneIDLocalLogin',
|
|
||||||
// 线上正式接口
|
|
||||||
url: '/WRD-admin/oneIDLogin',
|
|
||||||
method: 'get',
|
|
||||||
params: { param }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getInfo() {
|
export function getInfo() {
|
||||||
return request({
|
return request({
|
||||||
url: '/WRD-admin/sys/user/info',
|
url: '/WRD-admin/sys/user/info',
|
||||||
|
|
|
@ -101,8 +101,7 @@ export default {
|
||||||
async logout() {
|
async logout() {
|
||||||
await this.$store.dispatch('user/logout')
|
await this.$store.dispatch('user/logout')
|
||||||
// this.$router.push(`/login?redirect=${this.$route.fullPath}`);
|
// this.$router.push(`/login?redirect=${this.$route.fullPath}`);
|
||||||
// this.$router.push(`/login`)
|
this.$router.push(`/login`)
|
||||||
window.location.href = 'https://oneid.siemens.com.cn/frontend/login?idaasAppId=siemens_ciam2'
|
|
||||||
},
|
},
|
||||||
// 修改个人信息回调
|
// 修改个人信息回调
|
||||||
updatePersonalPassword() {
|
updatePersonalPassword() {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import getPageTitle from '@/utils/get-page-title'
|
||||||
|
|
||||||
NProgress.configure({ showSpinner: false }) // NProgress Configuration
|
NProgress.configure({ showSpinner: false }) // NProgress Configuration
|
||||||
|
|
||||||
const whiteList = ['/login', '/callback'] // no redirect whitelist
|
const whiteList = ['/login'] // no redirect whitelist
|
||||||
|
|
||||||
router.beforeEach(async(to, from, next) => {
|
router.beforeEach(async(to, from, next) => {
|
||||||
// start progress bar
|
// start progress bar
|
||||||
|
@ -21,7 +21,7 @@ router.beforeEach(async(to, from, next) => {
|
||||||
const hasToken = getToken()
|
const hasToken = getToken()
|
||||||
|
|
||||||
if (hasToken) {
|
if (hasToken) {
|
||||||
if (to.path === '/login' || to.path === '/callback') {
|
if (to.path === '/login') {
|
||||||
// if is logged in, redirect to the home page
|
// if is logged in, redirect to the home page
|
||||||
next({ path: '/nav' })
|
next({ path: '/nav' })
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
|
@ -47,14 +47,13 @@ router.beforeEach(async(to, from, next) => {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* has no token*/
|
/* has no token*/
|
||||||
|
|
||||||
if (whiteList.indexOf(to.path) !== -1) {
|
if (whiteList.indexOf(to.path) !== -1) {
|
||||||
// in the free login whitelist, go directly
|
// in the free login whitelist, go directly
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
// other pages that do not have permission to access are redirected to the login page.
|
// other pages that do not have permission to access are redirected to the login page.
|
||||||
// next(`/login?redirect=${to.path}`)
|
next(`/login?redirect=${to.path}`)
|
||||||
window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://csdc.siemens.com.cn:8001/callback&scope=openid%20phone'
|
|
||||||
// window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://localhost:9528/callback&scope=openid%20phone'
|
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,7 +183,7 @@ export const asyncRoutes = [
|
||||||
export const anyRoutes = { path: '*', redirect: '/404', hidden: true }
|
export const anyRoutes = { path: '*', redirect: '/404', hidden: true }
|
||||||
|
|
||||||
const createRouter = () => new Router({
|
const createRouter = () => new Router({
|
||||||
mode: 'history',
|
mode: 'hash',
|
||||||
scrollBehavior: () => ({ y: 0 }),
|
scrollBehavior: () => ({ y: 0 }),
|
||||||
routes: constantRoutes
|
routes: constantRoutes
|
||||||
})
|
})
|
||||||
|
|
|
@ -143,17 +143,6 @@ const actions = {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// set token
|
|
||||||
commitToken({ commit }, token) {
|
|
||||||
return new Promise(resolve => {
|
|
||||||
commit('SET_TOKEN', token)
|
|
||||||
setToken(token)
|
|
||||||
const data = getToken()
|
|
||||||
console.log(data)
|
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// remove token
|
// remove token
|
||||||
resetToken({ commit }) {
|
resetToken({ commit }) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
|
|
|
@ -1,59 +1,59 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="main-box" />
|
<div class="main-box" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import { getOneIdToken } from '@/api/user'
|
import { getOneIdToken } from '@/api/user'
|
||||||
export default {
|
export default {
|
||||||
name: 'CallBack',
|
name: 'CallBack',
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
'name'
|
'name'
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
// 获取 URL 参数中的 code
|
debugger
|
||||||
// const urlParams = new URLSearchParams(window.location.hash.substring(1))
|
// 获取 URL 参数中的 code
|
||||||
// const code = urlParams.get('code')
|
// const urlParams = new URLSearchParams(window.location.hash.substring(1))
|
||||||
// alert('callback page')
|
// const code = urlParams.get('code')
|
||||||
// this.$router.push({ path: '/nav' })
|
// alert('callback page')
|
||||||
const urlParams = new URLSearchParams(window.location.search)
|
// this.$router.push({ path: '/nav' })
|
||||||
const code = urlParams.get('code')
|
const urlParams = new URLSearchParams(window.location.search)
|
||||||
// 在这里可以将 code 发送到后端进行处理
|
const code = urlParams.get('code')
|
||||||
if (code) {
|
// 在这里可以将 code 发送到后端进行处理
|
||||||
// 123
|
if (code) {
|
||||||
// 发送 code 给后端进行验证和处理
|
// 发送 code 给后端进行验证和处理
|
||||||
const response = await getOneIdToken(code)
|
const response = await getOneIdToken(code)
|
||||||
if (response) {
|
console.log(response)
|
||||||
console.log('response.Token:' + response.data.token)
|
if (response) {
|
||||||
// 存token
|
// console.log('response.Token:' + response.Token)
|
||||||
this.$store.dispatch('user/commitToken', response.data.token)
|
// 存token
|
||||||
// 重新加载路由 这里不对
|
this.$store.dispatch('user/commitToken', response)
|
||||||
// resetRouter() 这个没用,还把你的路由破坏了
|
// 重新加载路由 这里不对
|
||||||
// console.log(this.$store.state.user, this.$store.state.token)
|
// resetRouter() 这个没用,还把你的路由破坏了
|
||||||
this.$router.push({ path: '/nav' })
|
// console.log(this.$store.state.user, this.$store.state.token)
|
||||||
|
this.$router.push({ path: '/nav' })
|
||||||
|
} else {
|
||||||
|
console.log('No token found with code')
|
||||||
|
// window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://csdc.siemens.com.cn:8001/#/callback&scope=openid phone email profile user:ciam:commonapi'
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('No token found with code')
|
// 如果没有 code,则处理错误, 跳转回登录页面
|
||||||
window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://csdc.siemens.com.cn:8001/callback&scope=openid%20phone'
|
console.error('No code found in URL parameters.')
|
||||||
// window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://localhost:9528/callback&scope=openid%20phone'
|
// window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://csdc.siemens.com.cn:8001/#/callback&scope=openid phone email profile user:ciam:commonapi'
|
||||||
|
// window.location.href = 'https://oneid.siemens.com.cn/frontend/login?idaasAppId=siemens_ciam2'
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// 如果没有 code,则处理错误, 跳转回登录页面
|
|
||||||
console.error('No code found in URL parameters.')
|
|
||||||
window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://csdc.siemens.com.cn:8001/callback&scope=openid%20phone'
|
|
||||||
// window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://localhost:9528/callback&scope=openid%20phone'
|
|
||||||
// window.location.href = 'https://oneid.siemens.com.cn/frontend/login?idaasAppId=siemens_ciam2'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
</script>
|
||||||
</script>
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
<style lang="scss" scoped>
|
.main-box {
|
||||||
.main-box {
|
background-image: url("../../assets/dashboard-background.png");
|
||||||
//background-image: url("../../assets/dashboard-background.png");
|
background-size: 100% 100%;
|
||||||
background-size: 100% 100%;
|
background-repeat: no-repeat;
|
||||||
background-repeat: no-repeat;
|
height: 100vh;
|
||||||
height: 100vh;
|
}
|
||||||
}
|
</style>
|
||||||
</style>
|
|
|
@ -1293,19 +1293,15 @@ export default {
|
||||||
}
|
}
|
||||||
this.engiArray = resultOfSelectEngisByDept.data.list
|
this.engiArray = resultOfSelectEngisByDept.data.list
|
||||||
this.total = resultOfSelectEngisByDept.data.total
|
this.total = resultOfSelectEngisByDept.data.total
|
||||||
console.log(this.engiArray.map(item => item.gid))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const gids = this.engiArray.map(item => item.gid).join(',')
|
|
||||||
console.log(gids)
|
|
||||||
const resOfSelectEngiStatusByMap =
|
const resOfSelectEngiStatusByMap =
|
||||||
await this.$API.select.reqSelectEngiStatusByDept(
|
await this.$API.select.reqSelectEngiStatusByDept(
|
||||||
year,
|
year,
|
||||||
month,
|
month,
|
||||||
departmentId,
|
departmentId,
|
||||||
page,
|
page,
|
||||||
limit,
|
limit
|
||||||
gids
|
|
||||||
)
|
)
|
||||||
console.log(this.engiArray, resOfSelectEngiStatusByMap)
|
console.log(this.engiArray, resOfSelectEngiStatusByMap)
|
||||||
if (resOfSelectEngiStatusByMap.code === 0) {
|
if (resOfSelectEngiStatusByMap.code === 0) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ module.exports = {
|
||||||
* In most cases please use '/' !!!
|
* In most cases please use '/' !!!
|
||||||
* Detail: https://cli.vuejs.org/config/#publicpath
|
* Detail: https://cli.vuejs.org/config/#publicpath
|
||||||
*/
|
*/
|
||||||
publicPath: '/',
|
publicPath: './',
|
||||||
outputDir: 'dist',
|
outputDir: 'dist',
|
||||||
assetsDir: 'static',
|
assetsDir: 'static',
|
||||||
lintOnSave: process.env.NODE_ENV === 'development',
|
lintOnSave: process.env.NODE_ENV === 'development',
|
||||||
|
|
Loading…
Reference in New Issue