|
|
|
@ -192,14 +192,13 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import {getCurrentLanguage} from '@/common/i18n'; |
|
|
|
|
import {getExchangeRateCookie, setExchangeRateCookie} from '@/utils/auth'; |
|
|
|
|
import {logOut} from '@/api/user'; |
|
|
|
|
import Cookie from '@/common/cookie'; |
|
|
|
|
import {FILE_URL} from '@/api/app'; |
|
|
|
|
import {signIn} from '@/api/yyyf'; |
|
|
|
|
|
|
|
|
|
const Menu = { |
|
|
|
|
import {getCurrentLanguage} from '@/common/i18n'; |
|
|
|
|
import {getExchangeRateCookie, setExchangeRateCookie} from '@/utils/auth'; |
|
|
|
|
import {logOut} from '@/api/user'; |
|
|
|
|
import Cookie from '@/common/cookie'; |
|
|
|
|
import {FILE_URL} from '@/api/app'; |
|
|
|
|
|
|
|
|
|
const Menu = { |
|
|
|
|
icon: [{t: 'nav.menu_name', link: '/'}], |
|
|
|
|
left: [ |
|
|
|
|
{t: 'nav.menu_home', link: '/'}, |
|
|
|
@ -214,9 +213,9 @@ const Menu = { |
|
|
|
|
{t: 'nav.menu_dingdan', link: '/order'}, |
|
|
|
|
{t: 'nav.menu_funds', link: '/balances'}, |
|
|
|
|
], |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
export default { |
|
|
|
|
name: 'nav-header', |
|
|
|
|
props: { |
|
|
|
|
border: { |
|
|
|
@ -280,14 +279,17 @@ export default { |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
created() { |
|
|
|
|
let params = this.parseUrl(); |
|
|
|
|
//判断是否来自以渔有方 |
|
|
|
|
if ( |
|
|
|
|
!$.isEmptyObject(params) && |
|
|
|
|
params.userId != undefined && |
|
|
|
|
params.reqType != undefined |
|
|
|
|
) { |
|
|
|
|
this.loginFromYyyf(params); |
|
|
|
|
let yyyfToken=localStorage.getItem('yyyfToken'); |
|
|
|
|
if(yyyfToken == '' || yyyfToken == undefined){ |
|
|
|
|
this.$alert('未从以渔有方登录,点击确定关闭浏览器', '提示', { |
|
|
|
|
type: 'error', |
|
|
|
|
showClose: false, |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
confirmButtonClass: 'btn-self-style', |
|
|
|
|
callback: action => { |
|
|
|
|
this.closeWindow() |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
this.file = FILE_URL; |
|
|
|
|
this.perUrl = window.location.pathname.split('/')[1]; |
|
|
|
@ -325,54 +327,15 @@ export default { |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
methods: { |
|
|
|
|
parseUrl: function() { |
|
|
|
|
let params = {}; //定义数组 |
|
|
|
|
let url = decodeURIComponent(location.href); |
|
|
|
|
let paramsIndex = url.indexOf('?'); |
|
|
|
|
if (paramsIndex != -1) { |
|
|
|
|
paramsIndex = paramsIndex + 1; |
|
|
|
|
let paramsStr = url.substring(paramsIndex); |
|
|
|
|
let paramsAttr = paramsStr.split('&'); |
|
|
|
|
for (let x in paramsAttr) { |
|
|
|
|
let y = paramsAttr[x].split('='); |
|
|
|
|
if (y[0] == undefined || y[0] == '') { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if (y[1] != undefined) { |
|
|
|
|
let value = ''; |
|
|
|
|
let len = y.length; |
|
|
|
|
for (let j = 1; j < len; j++) { |
|
|
|
|
value += |
|
|
|
|
y[j] == '' && |
|
|
|
|
paramsAttr[x].charAt(value.length + y[0].length + 1) != '' |
|
|
|
|
? '=' |
|
|
|
|
: y[j]; |
|
|
|
|
} |
|
|
|
|
params[y[0]] = value; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return params; |
|
|
|
|
}, |
|
|
|
|
loginFromYyyf: function(params) { |
|
|
|
|
signIn(params).then(res => { |
|
|
|
|
// console.log(res); |
|
|
|
|
if (res.data.code === 200) { |
|
|
|
|
debugger; |
|
|
|
|
this.loading = false; |
|
|
|
|
//保存登录的token到cookie |
|
|
|
|
// Cookie.set('token', res.data.data.token); |
|
|
|
|
localStorage.setItem('yyyfToken', res.data.data.yyyfUserToken); |
|
|
|
|
|
|
|
|
|
//保存登录的用户信息到cookie |
|
|
|
|
// Cookie.set('userData', res.data.data); |
|
|
|
|
//localStorage.setItem('userData', JSON.stringify(res.data.data)); |
|
|
|
|
location.href = '/'; |
|
|
|
|
closeWindow: function () { |
|
|
|
|
if (navigator.userAgent.indexOf("Firefox") != -1 || navigator.userAgent.indexOf("Chrome") != -1) { |
|
|
|
|
window.location.href = "about:blank"; |
|
|
|
|
window.close(); |
|
|
|
|
} else { |
|
|
|
|
this.loading = false; |
|
|
|
|
this.$message.warning(res.data.msg); |
|
|
|
|
window.opener = null; |
|
|
|
|
window.open("", "_self"); |
|
|
|
|
window.close(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
switchLang(command) { |
|
|
|
|
if (!command) { |
|
|
|
@ -433,15 +396,15 @@ export default { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
|
@import '../../common/style/base'; |
|
|
|
|
// .main-nav{ |
|
|
|
|
// padding: 0 20px; |
|
|
|
|
// } |
|
|
|
|
.nav-header { |
|
|
|
|
@import '../../common/style/base'; |
|
|
|
|
// .main-nav{ |
|
|
|
|
// padding: 0 20px; |
|
|
|
|
// } |
|
|
|
|
.nav-header { |
|
|
|
|
max-width: 100%; |
|
|
|
|
min-width: 1180px; |
|
|
|
|
height: 65px; |
|
|
|
@ -730,5 +693,9 @@ export default { |
|
|
|
|
// width: 100%; |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.btn-self-style { |
|
|
|
|
background: #f56c6c !important; |
|
|
|
|
color: #fff !important; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|