| | |
| | | <div class="app-container"> |
| | | <el-alert |
| | | :title="message" |
| | | :type="flag?'success':'error'"> |
| | | :type="userType !== 1?'success':'error'"> |
| | | </el-alert> |
| | | |
| | | </div> |
| | |
| | | import {getToken} from "@/utils/auth" |
| | | import Cookies from 'js-cookie' |
| | | import request from '@/utils/request' |
| | | import { mapGetters } from 'vuex' |
| | | export default { |
| | | name: "current", |
| | | |
| | | created(){ |
| | | this.getExamAuth() |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'userType' |
| | | ]) |
| | | }, |
| | | data(){ |
| | | return { |
| | | pass:false, |
| | | message: '' |
| | | message: '', |
| | | flag:false, |
| | | } |
| | | }, |
| | | methods:{ |
| | | queryHandle(){ |
| | | }, |
| | | getExamAuth(){ |
| | | getExamAuth({token:getToken()}) |
| | | .then(res=>{ |
| | | if (res.data.code === 'failure') { |
| | | this.flag = false |
| | | this.message = res.data.message; |
| | | } |
| | | if (res.data.code === 'success') { |
| | | this.flag = true |
| | | this.message = res.data.message |
| | | Cookies.set('JSESSIONID',res.data.data.ssid) |
| | | window.open(process.env.NANO_API + "/foreground/system/noLogin/redirect?sessionId="+res.data.data.ssid ) |
| | | |
| | | } |
| | | }) |
| | | .catch(err=>{ |
| | | console.log(err) |
| | | this.flag = false |
| | | this.message = '请求出现问题,请联系管理员' |
| | | }) |
| | | |
| | | if (this.userType !== 1) { |
| | | window.open(process.env.NANO_API + "/foreground/system/auth/verify.do?tokens=" + getToken()); |
| | | this.message ='拥有权限登入' |
| | | } |
| | | else this.message = '没有权限登入'; |
| | | } |
| | | |
| | | } |