feat: There is no way the, weblink 免登陆
This commit is contained in:
+2
-1
@@ -28,7 +28,8 @@
|
||||
"vue-contextmenujs": "^1.3.13",
|
||||
"vue-i18n": "^8.22.4",
|
||||
"vue-router": "^3.2.0",
|
||||
"vuex": "^3.4.0"
|
||||
"vuex": "^3.4.0",
|
||||
"qs": "latest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
|
||||
+3
-10
@@ -1,16 +1,9 @@
|
||||
import axios from "@/common/axiosV2Phone";
|
||||
|
||||
export function getUserInfoByAuthCode (data) {
|
||||
|
||||
export function getTokenToWeLink (data) {
|
||||
return axios({
|
||||
url: 'getUserInfoByAuthCode',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
// 编辑
|
||||
export function getIftappCodeByWelinkCode (data) {
|
||||
return axios({
|
||||
url: 'getIftappCodeByWelinkCode',
|
||||
url: '/api/getTokenToWeLink',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
|
||||
@@ -4,6 +4,8 @@ import store from '@/store'
|
||||
import {Message} from 'element-ui'
|
||||
import { baseUrl,webLoginType,ssoLoginUrlDev } from '@/sysConfig'
|
||||
import isMobile from "../../store/isMobile";
|
||||
import Qs from 'qs';
|
||||
|
||||
|
||||
import domMessage from '../messageOnce/messageOnce'
|
||||
|
||||
@@ -25,7 +27,10 @@ let formData = (data) => {
|
||||
}
|
||||
|
||||
const service = axios.create({
|
||||
baseURL: 'https://iftappwelink.foton.com.cn/devserver/welink/'
|
||||
baseURL: process.env.NODE_ENV === 'production' ? baseUrl : '/',
|
||||
paramsSerializer: function(params) {//序列化请求参数,避免get请求参数出现&,空格等识别错误的问题
|
||||
return Qs.stringify(params, {arrayFormat: 'brackets'})
|
||||
}
|
||||
})
|
||||
|
||||
service.defaults.timeout = 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
|
||||
@@ -48,6 +53,7 @@ service.interceptors.request.use(
|
||||
*/
|
||||
service.interceptors.response.use(
|
||||
res => {
|
||||
console.log(res)
|
||||
// IE 8-9
|
||||
if (res.data == null && res.config.responseType === 'json' && res.request.responseText != null) {
|
||||
try {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import '@babel/polyfill'
|
||||
import Es6Promise from 'es6-promise'
|
||||
require('es6-promise').polyfill();
|
||||
require('es6-promise/auto');
|
||||
import Vue from 'vue'
|
||||
@@ -65,7 +64,6 @@ import VConsole from 'vuex'
|
||||
import isMobile from "./store/isMobile";
|
||||
// 路由拦截
|
||||
router.beforeEach(function (to, from, next) {
|
||||
|
||||
let fromName = from.name
|
||||
if(fromName === undefined || fromName === null){
|
||||
window.sessionStorage.clear()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import axios from 'axios'
|
||||
import util from 'util'
|
||||
import { get_verify_by_instance,loginIdm,getMenu,checkPageNoEncryption } from 'api/process'
|
||||
import { getUserInfoByAuthCode,getIftappCodeByWelinkCode } from 'api/phoneWeLink'
|
||||
import { getTokenToWeLink } from 'api/phoneWeLink'
|
||||
import { ssoLoginUrlDev,ssoLogoutUrlDev,ssoLoginUrl,webLoginType,devWebUrl } from '@/sysConfig'
|
||||
import HWH5 from '../../api/hwh5-cloudonline.js';
|
||||
|
||||
@@ -105,40 +105,20 @@
|
||||
console.log(data)
|
||||
if(data){
|
||||
let code = data.code
|
||||
console.log(code)
|
||||
getIftappCodeByWelinkCode({
|
||||
getTokenToWeLink({
|
||||
code: code,
|
||||
name: encodeURIComponent("standards regulations"),
|
||||
name: encodeURIComponent("standards"+"-"+"regulations"),
|
||||
type:"",
|
||||
corpCode:"",
|
||||
}, {
|
||||
_this: this
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if(res.data){
|
||||
getUserInfoByAuthCode({
|
||||
code: code,
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if(res.data){
|
||||
let userName = res.data.username;
|
||||
if(userName !== undefined && userName !== ""){
|
||||
checkPageNoEncryption({
|
||||
username: userName
|
||||
}, {
|
||||
_this: this
|
||||
}).then(res => {
|
||||
if (res.ok) {
|
||||
this.loginNew(res)
|
||||
} else {
|
||||
if(res.respCode && res.respCode === 'r0011'){
|
||||
this.logout()
|
||||
}
|
||||
}
|
||||
})
|
||||
}else {
|
||||
// window.location.href = ssoLogoutUrlDev
|
||||
}
|
||||
}else {
|
||||
this.logout()
|
||||
}
|
||||
})
|
||||
if (res.ok) {
|
||||
this.loginNew(res)
|
||||
} else {
|
||||
if(res.respCode && res.respCode === 'r0011'){
|
||||
this.logout()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user