feat: There is no way the, weblink 免登陆
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import axios from "@/common/axiosV2Phone";
|
||||
|
||||
export function getUserInfoByAuthCode (data) {
|
||||
return axios({
|
||||
url: 'getUserInfoByAuthCode',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
// 编辑
|
||||
export function getIftappCodeByWelinkCode (data) {
|
||||
return axios({
|
||||
url: 'getIftappCodeByWelinkCode',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import axios from 'axios'
|
||||
import router from '@/router'
|
||||
import store from '@/store'
|
||||
import {Message} from 'element-ui'
|
||||
import { baseUrl,webLoginType,ssoLoginUrlDev } from '@/sysConfig'
|
||||
import isMobile from "../../store/isMobile";
|
||||
|
||||
import domMessage from '../messageOnce/messageOnce'
|
||||
|
||||
// import 'element-ui/lib/theme-chalk/index.css'
|
||||
|
||||
const messageOnce = new domMessage()
|
||||
|
||||
/**
|
||||
* @description: FormData
|
||||
* @author: xx
|
||||
* @date: 2018-08-14 16:57:48
|
||||
*/
|
||||
let formData = (data) => {
|
||||
let _formData = new FormData()
|
||||
for (let i in data) {
|
||||
_formData.append(i, data[i])
|
||||
}
|
||||
return _formData
|
||||
}
|
||||
|
||||
const service = axios.create({
|
||||
baseURL: 'https://iftappwelink.foton.com.cn/devserver/welink/'
|
||||
})
|
||||
|
||||
service.defaults.timeout = 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
|
||||
service.defaults.headers['Content-type'] = 'application/json'
|
||||
/**
|
||||
* @description: axios请求拦截器
|
||||
* liuyan
|
||||
*/
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
debugger
|
||||
return config
|
||||
},
|
||||
error => {
|
||||
return Promise.reject(error.response)
|
||||
})
|
||||
/**
|
||||
* @description: axios响应拦截器
|
||||
* liuyan
|
||||
*/
|
||||
service.interceptors.response.use(
|
||||
res => {
|
||||
// IE 8-9
|
||||
if (res.data == null && res.config.responseType === 'json' && res.request.responseText != null) {
|
||||
try {
|
||||
res.data = JSON.parse(res.request.responseText);
|
||||
} catch (e) {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
return res.data
|
||||
},
|
||||
error => {
|
||||
// 登录超时
|
||||
})
|
||||
export default service
|
||||
+12
-9
@@ -65,7 +65,6 @@ import VConsole from 'vuex'
|
||||
import isMobile from "./store/isMobile";
|
||||
// 路由拦截
|
||||
router.beforeEach(function (to, from, next) {
|
||||
debugger
|
||||
|
||||
let fromName = from.name
|
||||
if(fromName === undefined || fromName === null){
|
||||
@@ -148,11 +147,7 @@ debugger
|
||||
/** 判断是不是在手机端操作 */
|
||||
if (isMobile()) {
|
||||
if(toName === 'phoneHome'){
|
||||
if((token === null || token === '' ) && toName !== 'Login'){
|
||||
next('/loginVerifyPhone')
|
||||
}else {
|
||||
next()
|
||||
}
|
||||
next('/loginVerifyPhone')
|
||||
}else if(toName === 'processCenter'){
|
||||
// hwh5.close();
|
||||
//关闭当前窗口
|
||||
@@ -172,9 +167,17 @@ debugger
|
||||
|
||||
if ((token === null || token === '' ) && toName !== 'Login') {
|
||||
if(toName !== 'phoneIndex'){
|
||||
localStorage.removeItem("param");
|
||||
localStorage.setItem('param',JSON.stringify(param4))
|
||||
next('/phoneIndex')
|
||||
if(toName === 'phoneHome'){
|
||||
next('/loginVerifyPhone')
|
||||
}else {
|
||||
if(fromName === 'phoneHome'){
|
||||
next()
|
||||
}else {
|
||||
localStorage.removeItem("param");
|
||||
localStorage.setItem('param',JSON.stringify(param4))
|
||||
next('/phoneIndex')
|
||||
}
|
||||
}
|
||||
}else {
|
||||
next()
|
||||
}
|
||||
|
||||
@@ -8,6 +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 { ssoLoginUrlDev,ssoLogoutUrlDev,ssoLoginUrl,webLoginType,devWebUrl } from '@/sysConfig'
|
||||
import HWH5 from '../../api/hwh5-cloudonline.js';
|
||||
|
||||
@@ -100,27 +101,21 @@
|
||||
computed: {
|
||||
},
|
||||
mounted () {
|
||||
HWH5.getAuthCode().then(data => {
|
||||
window.HWH5.getAuthCode().then(data => {
|
||||
console.log(data)
|
||||
if(data){
|
||||
let code = data.code
|
||||
console.log(code)
|
||||
let greeting_cards = "standards regulations"
|
||||
axios.request({
|
||||
url: 'https://iftappwelink.foton.com.cn/devserver/welink/getIftappCodeByWelinkCode?code='+code+"&name=" + encodeURIComponent(greeting_cards),
|
||||
method: 'post',
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
getIftappCodeByWelinkCode({
|
||||
code: code,
|
||||
name: encodeURIComponent("standards regulations"),
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if(res.data){
|
||||
axios.request({
|
||||
url: 'https://iftappwelink.foton.com.cn/devserver/welink/getUserInfoByAuthCode?code='+code,
|
||||
method: 'get',
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
getUserInfoByAuthCode({
|
||||
code: code,
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if(res.data){
|
||||
let userName = res.data.username;
|
||||
if(userName !== undefined && userName !== ""){
|
||||
|
||||
Reference in New Issue
Block a user