Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhn
2022-03-22 10:22:06 +08:00
3 changed files with 45 additions and 11 deletions
@@ -284,7 +284,7 @@
content: '',
onOk:
async () => {
getAction(`tag/onlCgformTag/delete`, params).then(res => {
getAction(`tag/onlCgformTag/logicDelete`, params).then(res => {
if (res.success) {
if (this.key == 1) {
this.$message.success(this.$t('OperationSuccessful'))
+1 -1
View File
@@ -285,7 +285,7 @@
return
}
var that = this
deleteAction(that.url.delete2, { roleId: this.currentRoleId, userId: id }).then((res) => {
getAction(that.url.delete2, { roleId: this.currentRoleId, userId: id }).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadData2()
+43 -9
View File
@@ -190,12 +190,12 @@
</template>
<script>
import { mapActions } from 'vuex'
import { timeFix } from '@/utils/util'
import { timeFix, welcome } from '@/utils/util'
import Vue from 'vue'
import { ACCESS_TOKEN, ENCRYPTED_STRING } from '@/store/mutation-types'
import { putAction, postAction, getAction } from '@/api/manage'
import { USER_INFO } from '@/store/mutation-types'
import { getRSAPublicKey } from '@/api/login.js'
import { login, logout, phoneLogin, thirdLogin } from "@/api/login"
import { ACCESS_TOKEN, USER_NAME,USER_INFO,UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"
const Base64 = require('js-base64').Base64
import { JSEncrypt } from 'jsencrypt'
@@ -228,15 +228,25 @@
currdatetime: '',
randCodeImage: '',
requestCodeSuccess: false,
rsaPublicKey: ''
rsaPublicKey: '',
code:''
}
},
created() {
this.currdatetime = new Date().getTime()
Vue.ls.remove(ACCESS_TOKEN)
this.getRouterData()
this.handleChangeCheckCode()
this.handleChangeCheckCode()
let query =[]
if(this.$route.query.redirect){
query=this.$route.query.redirect.includes('code=')?this.$route.query.redirect.split('code='):[]
this.code=query[1]
}
if(this.code){
this.ssoLoginSuccess()
}
this.getRouterData()
// redirect=%2F%3Fcode%3DST-213-iZP4qQMa2xC3Thfn4Irg-signin.nio.com
},
methods: {
...mapActions(['Login', 'Logout', 'PhoneLogin']),
@@ -404,9 +414,33 @@
},
//sso登录跳转
ssoLogin(){
window.open('https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri=http%3A%2F%2F139.9.235.66%3A8008%2Fjero-boot%2Fopensso%2Fcallback&response_type=code', '_blank')
}
window.open('https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri=http%3A%2F%2F139.9.235.66%3A8010&response_type=code', '_blank')
},
//sso登录成功
ssoLoginSuccess(){
let that = this
let loginParams = {}
loginParams.checkKey = that.currdatetime
loginParams.rsaPublicKey = that.rsaPublicKey
// 新建JSEncrypt对象
let encrypt = new JSEncrypt()
encrypt.setPublicKey(loginParams.rsaPublicKey)
getAction(`opensso/callback`,{code:this.code}).then(res=>{
if(res.success){
Vue.ls.set(ACCESS_TOKEN, res.result.token, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set(USER_NAME, res.result.userInfo.username, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set(USER_INFO, res.result.userInfo, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result.sysAllDictItems, 7 * 24 * 60 * 60 * 1000)
this.$store.commit('SET_TOKEN', res.result.token)
this.$store.commit('SET_INFO', res.result.userInfo)
this.$store.commit('SET_NAME', { username: res.result.userInfo.username,realname: res.result.userInfo.realname, welcome: welcome() })
this.$store.commit('SET_AVATAR', res.result.userInfo.avatar)
this.loginSuccess()
}else{
this.ssoLogin()
}
})
},
}
}