style: 修改代码格式

This commit is contained in:
zyn
2023-12-15 11:41:23 +08:00
parent 19a18489a8
commit 221e68134b
2 changed files with 34 additions and 25 deletions
+15 -6
View File
@@ -1,8 +1,17 @@
<template> <template>
<div class="blankPage"> <div class="blankPage">
<van-icon name="clear" color="#dabb27" size="70"/> <van-icon name="clear" color="#dabb27" size="70" />
<div style="font-size: 15px;margin-top: 20px;color: #8c939d">当前任务不支持手机端处理</div> <div style="font-size: 15px;margin-top: 20px;color: #8c939d">
<el-button type="primary" size="small" style="margin-top: 30px;width: 270px;" @click="closeWindow()">返回</el-button> 当前任务不支持手机端处理
</div>
<el-button
type="primary"
size="small"
style="margin-top: 30px;width: 270px;"
@click="closeWindow()"
>
返回
</el-button>
</div> </div>
</template> </template>
@@ -12,12 +21,12 @@ import { Icon } from 'vant';
Vue.use(Icon); Vue.use(Icon);
export default { export default {
name: 'blankPage', name: 'BlankPage',
data() { data () {
return {} return {}
}, },
methods: { methods: {
closeWindow(){ closeWindow () {
// hwh5.close() // hwh5.close()
// this.$router.go(-2) // this.$router.go(-2)
this.$close() this.$close()
+19 -19
View File
@@ -8,8 +8,8 @@ import hwh5 from '@/api/hwh5-cloudonline.js'
import { Message, MessageBox, Loading } from 'element-ui' import { Message, MessageBox, Loading } from 'element-ui'
import { Dialog } from 'vant' import { Dialog } from 'vant'
function getCode() { function getCode () {
let url = window.location.href const url = window.location.href
if (url && url !== '') { if (url && url !== '') {
if (url.split('code=').length > 1) { if (url.split('code=').length > 1) {
return url.split('code=')[1] return url.split('code=')[1]
@@ -17,7 +17,7 @@ function getCode() {
} }
} }
function toIdmLoginPage(url) { function toIdmLoginPage (url) {
if (webLoginType === 'idm') { if (webLoginType === 'idm') {
let href = url let href = url
if (href.indexOf('localhost:9090' > -1)) { if (href.indexOf('localhost:9090' > -1)) {
@@ -29,7 +29,7 @@ function toIdmLoginPage(url) {
} }
// 重新登录 // 重新登录
function loginAgain() { function loginAgain () {
store.dispatch('logout').then(() => { store.dispatch('logout').then(() => {
if (webLoginType === 'idm') { if (webLoginType === 'idm') {
if (isMobile()) { if (isMobile()) {
@@ -47,7 +47,7 @@ function loginAgain() {
} }
// 退出登录 // 退出登录
function loginOut() { function loginOut () {
store.dispatch('logout').then(() => { store.dispatch('logout').then(() => {
if (webLoginType === 'idm') { if (webLoginType === 'idm') {
window.location.href = ssoLogout + encodeURIComponent(window.location.origin) window.location.href = ssoLogout + encodeURIComponent(window.location.origin)
@@ -59,14 +59,14 @@ function loginOut() {
} }
// idm登录 // idm登录
function loginInIdm(code) { function loginInIdm (code) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let loading = Loading.service({ const loading = Loading.service({
lock: true, lock: true,
text: '登录中...', text: '登录中...',
spinner: 'el-icon-loading' spinner: 'el-icon-loading'
}) })
let _formData = new FormData() const _formData = new FormData()
_formData.append('code', code) _formData.append('code', code)
// 获取用户信息 // 获取用户信息
loginIdm(_formData).then(res => { loginIdm(_formData).then(res => {
@@ -89,9 +89,9 @@ function loginInIdm(code) {
} }
// welink登录 // welink登录
function loginInPhone() { function loginInPhone () {
return new Promise(async (resolve, reject) => { return new Promise( (resolve, reject) => {
let loading = Loading.service({ const loading = Loading.service({
lock: true, lock: true,
text: '登录中...', text: '登录中...',
spinner: 'el-icon-loading' spinner: 'el-icon-loading'
@@ -99,7 +99,7 @@ function loginInPhone() {
hwh5.getAuthCode().then(data => { hwh5.getAuthCode().then(data => {
console.log('获取到了welinkCode', data) console.log('获取到了welinkCode', data)
if (data) { if (data) {
let code = data.code const code = data.code
getTokenToWeLink({ getTokenToWeLink({
code: code, code: code,
name: encodeURIComponent('standards' + '-' + 'regulations'), name: encodeURIComponent('standards' + '-' + 'regulations'),
@@ -128,17 +128,17 @@ function loginInPhone() {
}) })
} }
function loginNew(res) { function loginNew (res) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (res.data.orgId === null || res.data.orgId === '') { if (res.data.orgId === null || res.data.orgId === '') {
Message.warning('未分配组织机构,请联系管理员分配后重新登录') Message.warning('未分配组织机构,请联系管理员分配后重新登录')
return return
} }
let Base64 = require('js-base64').Base64 const Base64 = require('js-base64').Base64
// 解析用户信息 // 解析用户信息
let userInfoStr = Base64.decode(res.data) const userInfoStr = Base64.decode(res.data)
let userInfoJSON = decodeURIComponent(userInfoStr) const userInfoJSON = decodeURIComponent(userInfoStr)
let userInfo = JSON.parse(userInfoJSON) const userInfo = JSON.parse(userInfoJSON)
userInfo.userId = userInfo.usid userInfo.userId = userInfo.usid
store.commit('setToken', userInfo.token) store.commit('setToken', userInfo.token)
store.commit('setUserInfo', JSON.stringify(userInfo)) store.commit('setUserInfo', JSON.stringify(userInfo))
@@ -167,7 +167,7 @@ function loginNew(res) {
}) })
} }
function quit() { function quit () {
Message.warning('系统无权限访问') Message.warning('系统无权限访问')
if (isMobile()) { if (isMobile()) {
Dialog.confirm({ Dialog.confirm({
@@ -191,7 +191,7 @@ function quit() {
} }
} }
function close() { function close () {
if (isMobile()) { if (isMobile()) {
hwh5.close() hwh5.close()
} }