跳转驿站
This commit is contained in:
parent
b15065a638
commit
28e89d23e7
|
|
@ -6,7 +6,9 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { isExternal } from '@/utils/validate'
|
import { isExternal } from '@/utils/validate'
|
||||||
|
import { getToken } from '@/utils/auth'
|
||||||
|
import { encryptCBC, decryptCBC } from '@/utils/aescbc';
|
||||||
|
import { decryptWithSM4,encryptWithSM4,hashWithSM3AndSalt } from '@/utils/sm'
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
to: {
|
to: {
|
||||||
|
|
@ -28,8 +30,13 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
linkProps(to) {
|
linkProps(to) {
|
||||||
if (this.isExternal) {
|
if (this.isExternal) {
|
||||||
|
console.log(to)
|
||||||
|
console.log(this.$store.getters.phonenumber)
|
||||||
|
console.log(hashWithSM3AndSalt(this.$store.getters.phonenumber));
|
||||||
|
console.log(encryptWithSM4(this.$store.getters.phonenumber+"|"+hashWithSM3AndSalt(this.$store.getters.phonenumber)))
|
||||||
return {
|
return {
|
||||||
href: to,
|
href: to + ( getToken() ? '?token='+ getToken():'')+('&phonenumber='+encryptWithSM4(this.$store.getters.phonenumber+"|"+hashWithSM3AndSalt(this.$store.getters.phonenumber))),
|
||||||
|
// href: to,
|
||||||
target: '_blank',
|
target: '_blank',
|
||||||
rel: 'noopener'
|
rel: 'noopener'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ const getters = {
|
||||||
visitedViews: state => state.tagsView.visitedViews,
|
visitedViews: state => state.tagsView.visitedViews,
|
||||||
cachedViews: state => state.tagsView.cachedViews,
|
cachedViews: state => state.tagsView.cachedViews,
|
||||||
token: state => state.user.token,
|
token: state => state.user.token,
|
||||||
|
phonenumber: state => state.user.phonenumber,
|
||||||
avatar: state => state.user.avatar,
|
avatar: state => state.user.avatar,
|
||||||
name: state => state.user.name,
|
name: state => state.user.name,
|
||||||
introduction: state => state.user.introduction,
|
introduction: state => state.user.introduction,
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ const buildPayload = ({ loginMethod, username, password, uuid, code, mobile, ver
|
||||||
const user = {
|
const user = {
|
||||||
state: {
|
state: {
|
||||||
token: getToken(),
|
token: getToken(),
|
||||||
|
phonenumber: '',
|
||||||
id: '',
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
avatar: '',
|
avatar: '',
|
||||||
|
|
@ -46,6 +47,9 @@ const user = {
|
||||||
SET_TOKEN(state, token) {
|
SET_TOKEN(state, token) {
|
||||||
state.token = token
|
state.token = token
|
||||||
},
|
},
|
||||||
|
SET_PHONE(state, phonenumber) {
|
||||||
|
state.phonenumber = phonenumber
|
||||||
|
},
|
||||||
SET_EXPIRES_IN(state, time) {
|
SET_EXPIRES_IN(state, time) {
|
||||||
state.expires_in = time
|
state.expires_in = time
|
||||||
},
|
},
|
||||||
|
|
@ -122,6 +126,7 @@ const user = {
|
||||||
commit('SET_ROLES', res.roles && res.roles.length > 0 ? res.roles : ['ROLE_DEFAULT'])
|
commit('SET_ROLES', res.roles && res.roles.length > 0 ? res.roles : ['ROLE_DEFAULT'])
|
||||||
commit('SET_PERMISSIONS', res.permissions)
|
commit('SET_PERMISSIONS', res.permissions)
|
||||||
commit('SET_ID', user.userId)
|
commit('SET_ID', user.userId)
|
||||||
|
commit('SET_PHONE', user.phonenumber)
|
||||||
commit('SET_NAME', user.userName)
|
commit('SET_NAME', user.userName)
|
||||||
commit('SET_AVATAR', avatar)
|
commit('SET_AVATAR', avatar)
|
||||||
return res
|
return res
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue