- 您正在授权登录,{{ appName }}将获得以下权限:
+ 您正在授权登录, {{ appName }} 将获得以下权限:
- 关联{{userName}}账号
@@ -32,15 +33,16 @@
+ 授权登录
-
-
+
+
-
+
-
+
import { TOKEN_KEY } from '@/utils/variable'
-import { config, code, getOAuth2, initApplication, authLogin } from '@/api/login'
+import { config, code, getOAuth2, initApplication, authLogin, settingDetail } from '@/api/login'
import { getMe_api } from '@/api/home'
import { getImage, getToken } from '@/utils/comm'
+import Config from '../../../config/config'
const spinning = ref(true)
const isLogin = ref(false)
@@ -85,6 +88,9 @@ const userName = ref('-')
const internal = ref('false')
const params = ref()
+document.title = `OAuth授权-${Config.title}`;
+headerImg.value = getImage(Config.layout.logo)
+
type LoginParam = {
username: string;
password: string;
@@ -104,6 +110,8 @@ const captcha = reactive<{base64?: string, key?: string }>({
key: undefined
})
+const formRef = ref()
+
const getApplication = async (clientId: string) => {
const res = await initApplication(clientId)
if (res.success && res.result) {
@@ -141,7 +149,6 @@ const changeAccount = () => {
}
const getLoginUser = async (data?: any) => {
- console.log(getToken())
if (getToken()) { // 未登录
const res = await getMe_api()
if (res.success) {
@@ -182,19 +189,21 @@ const getQueryVariable = (variable: any) => {
return '';
}
-const doLogin = async () => {
- const res = await authLogin({
- verifyKey: captcha.key,
- ...formModel
+const doLogin = () => {
+ formRef.value.validate().then( async data => {
+ const res = await authLogin({
+ verifyKey: captcha.key,
+ ...formModel
+ })
+ if (res.success) {
+ const token = res.result.token
+ localStorage.setItem(TOKEN_KEY, token)
+ getLoginUser()
+ // goOAuth2Fn()
+ } else {
+ getCode()
+ }
})
- if (res.success) {
- const token = res.result.token
- localStorage.setItem(TOKEN_KEY, token)
- getLoginUser()
- goOAuth2Fn()
- } else {
- getCode()
- }
}
const initPage = async () => {
@@ -213,7 +222,6 @@ const initPage = async () => {
const url = `${origin.join('/')}${items.redirect_uri?.split('redirect=')[1]}`
// redirectUrl = `${items.redirect_uri?.split('redirect_uri=')[0]}?redirect=${url}`
redirectUrl = items.redirect_uri
- console.log(origin, items.redirect_uri)
}
// 获取用户信息
getLoginUser({
@@ -229,9 +237,22 @@ const initPage = async () => {
}
}
-document.title = 'OAuth授权-jetlinks';
-headerImg.value = getImage('/logo.png')
+const getSettingDetail = () => {
+ settingDetail('front').then((res: any) => {
+ if (res.status === 200) {
+ const ico: any = document.querySelector('link[rel="icon"]');
+ ico.href = res.result.ico;
+ headerImg.value = res.result.logo
+ if (res.result.title) {
+ document.title = `OAuth授权-${res.result.title}`;
+ } else {
+ document.title = 'OAuth授权';
+ }
+ }
+ });
+}
+getSettingDetail()
getCode()
initPage()
@@ -320,7 +341,8 @@ initPage()
gap: 24px;
}
.oauth-content-login {
- max-width: 300px;
+ width: 100%;
+ padding: 0 24px;
}
}
}
From 056c694a926d9643bf9f533b914fd7064fc26b81 Mon Sep 17 00:00:00 2001
From: XieYongHong <18010623010@163.com>
Date: Thu, 27 Apr 2023 17:57:19 +0800
Subject: [PATCH 16/32] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Diot=E8=B4=A6?=
=?UTF-8?q?=E5=8F=B7=E6=97=A0=E6=B3=95=E7=99=BB=E5=BD=95=E5=8F=AF=E8=A7=86?=
=?UTF-8?q?=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix: 优化oauth页面
* fix: 修复iot账号无法登录可视化
---
config/config.ts | 2 +-
src/router/index.ts | 7 +--
src/utils/request.ts | 19 +++++--
src/views/oauth/index.vue | 111 ++++++++++++++++++++++++--------------
4 files changed, 91 insertions(+), 48 deletions(-)
diff --git a/config/config.ts b/config/config.ts
index 9a3c3b8a..6b94b56b 100644
--- a/config/config.ts
+++ b/config/config.ts
@@ -6,7 +6,7 @@ export default {
title: 'Jetlinks', // 浏览器标签页title
layout: {
title: '物联网平台', // 平台title
- logo: '/icons/icon-192x192.png', // 平台logo
+ logo: '/logo.png', // 平台logo
siderWidth: 208, // 左侧菜单栏宽度
headerHeight: 48, // 头部高度
collapsedWidth: 48,
diff --git a/src/router/index.ts b/src/router/index.ts
index 1ecbc43e..1641803e 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -1,5 +1,5 @@
import { createRouter, createWebHashHistory } from 'vue-router'
-import menus, { AccountCenterBindPath, InitHomePath, LoginPath } from './menu'
+import menus, { AccountCenterBindPath, InitHomePath, LoginPath, OauthPath } from './menu'
import { cleanToken, getToken } from '@/utils/comm'
import { useUserInfo } from '@/store/userInfo'
import { useSystem } from '@/store/system'
@@ -14,12 +14,13 @@ const router = createRouter({
}
})
-const filterPath = [ InitHomePath, AccountCenterBindPath ]
+const filterPath = [ InitHomePath ]
+const noTokenPath = [ AccountCenterBindPath, OauthPath ]
router.beforeEach((to, from, next) => {
// TODO 切换路由取消请求
const token = getToken()
- if (to.path === AccountCenterBindPath) {
+ if (noTokenPath.includes(to.path)) {
next()
} else if (token) {
if (to.path === LoginPath) {
diff --git a/src/utils/request.ts b/src/utils/request.ts
index 9676b40d..f6b2d6ed 100644
--- a/src/utils/request.ts
+++ b/src/utils/request.ts
@@ -13,7 +13,16 @@ interface AxiosResponseRewrite extends AxiosResponse {
export const SUCCESS_CODE = 200 // 成功代码
-const filterApiUrl = ['/system/version', '/system/config/front', '/authorize/captcha/config', '/application/sso/_all', '/authorize/captcha/image', '/application/sso/bind-code', '/authorize/login']
+const filterApiUrl = [
+ '/system/version',
+ '/system/config/front',
+ '/authorize/captcha/config',
+ '/application/sso/_all',
+ '/authorize/captcha/image',
+ '/application/sso/bind-code',
+ '/authorize/login',
+ '/application/'
+]
export const request = axios.create({
withCredentials: false,
@@ -149,10 +158,10 @@ const errorHandler = (error: any) => {
} else if (status === 401) {
showNotification('Unauthorized', '用户未登录', '401')
setTimeout(() => {
- cleanToken()
- router.replace({
- path: LoginPath
- })
+ // cleanToken()
+ // router.replace({
+ // path: LoginPath
+ // })
}, 0)
} else if (status === 404) {
showNotification(error?.code, error?.response?.data?.message, '404')
diff --git a/src/views/oauth/index.vue b/src/views/oauth/index.vue
index 547796f1..6fc36ac6 100644
--- a/src/views/oauth/index.vue
+++ b/src/views/oauth/index.vue
@@ -14,9 +14,10 @@
+ 授权登录
- 您正在授权登录,{{ appName }}将获得以下权限:
+ 您正在授权登录, {{ appName }} 将获得以下权限:
- 关联{{userName}}账号
@@ -32,15 +33,16 @@
+ 授权登录
-
-
+
+
-
+
-
+
import { TOKEN_KEY } from '@/utils/variable'
-import { config, code, getOAuth2, initApplication, authLogin } from '@/api/login'
+import { config, code, getOAuth2, initApplication, authLogin, settingDetail } from '@/api/login'
import { getMe_api } from '@/api/home'
-import { getImage } from '@/utils/comm'
+import { getImage, getToken } from '@/utils/comm'
+import Config from '../../../config/config'
const spinning = ref(true)
const isLogin = ref(false)
@@ -85,6 +88,9 @@ const userName = ref('-')
const internal = ref('false')
const params = ref()
+document.title = `OAuth授权-${Config.title}`;
+headerImg.value = getImage(Config.layout.logo)
+
type LoginParam = {
username: string;
password: string;
@@ -104,13 +110,18 @@ const captcha = reactive<{base64?: string, key?: string }>({
key: undefined
})
+const formRef = ref()
+
const getApplication = async (clientId: string) => {
const res = await initApplication(clientId)
- if (res.success) {
+ if (res.success && res.result) {
appName.value = res.result.name
}
}
+/**
+ * 获取验证码配置
+ */
const getCode = async () => {
const resp = await config()
if (resp.result?.enabled) {
@@ -138,26 +149,32 @@ const changeAccount = () => {
}
const getLoginUser = async (data?: any) => {
- const res = await getMe_api()
- if (res.success) {
- userName.value = res.result?.user.name
- isLogin.value = true
- getApplication(data.client_id || params.value.client_id)
- if (data.internal === 'true' || internal.value === 'true') { // 是否走oauth2
- goOAuth2Fn(data)
+ if (getToken()) { // 未登录
+ const res = await getMe_api()
+ if (res.success) {
+ userName.value = res.result?.user.name
+ isLogin.value = true
+ getApplication(data.client_id || params.value.client_id)
+ if (data.internal === 'true' || internal.value === 'true') { // 是否走oauth2
+ goOAuth2Fn(data)
+ }
+ } else if (res.status === 401) {
+ setTimeout(() => {
+ spinning.value = false
+ })
+ getCode()
+ getApplication(data.client_id || params.value.client_id)
+ } else {
+ setTimeout(() => {
+ spinning.value = false
+ })
}
- } else if (res.status === 401) {
- setTimeout(() => {
- spinning.value = false
- })
- getCode()
- getApplication(data.client_id || params.value.client_id)
} else {
+ getApplication(data.client_id || params.value.client_id)
setTimeout(() => {
spinning.value = false
})
}
-
}
const getQueryVariable = (variable: any) => {
@@ -172,23 +189,26 @@ const getQueryVariable = (variable: any) => {
return '';
}
-const doLogin = async () => {
- const res = await authLogin({
- verifyKey: captcha.key,
- ...formModel
+const doLogin = () => {
+ formRef.value.validate().then( async data => {
+ const res = await authLogin({
+ verifyKey: captcha.key,
+ ...formModel
+ })
+ if (res.success) {
+ const token = res.result.token
+ localStorage.setItem(TOKEN_KEY, token)
+ getLoginUser()
+ // goOAuth2Fn()
+ } else {
+ getCode()
+ }
})
- if (res.success) {
- getLoginUser()
- const token = res.result.token
- localStorage.setItem(TOKEN_KEY, token)
- goOAuth2Fn()
- } else {
- getCode()
- }
}
const initPage = async () => {
let redirectUrl
+ // 获取url中的配置信息
const items = {
client_id: getQueryVariable('client_id'),
state: getQueryVariable('state'),
@@ -202,9 +222,8 @@ const initPage = async () => {
const url = `${origin.join('/')}${items.redirect_uri?.split('redirect=')[1]}`
// redirectUrl = `${items.redirect_uri?.split('redirect_uri=')[0]}?redirect=${url}`
redirectUrl = items.redirect_uri
- console.log(origin, items.redirect_uri)
}
-
+ // 获取用户信息
getLoginUser({
...items,
internal: getQueryVariable('internal'),
@@ -218,9 +237,22 @@ const initPage = async () => {
}
}
-document.title = 'OAuth授权-jetlinks';
-headerImg.value = getImage('/logo.png')
+const getSettingDetail = () => {
+ settingDetail('front').then((res: any) => {
+ if (res.status === 200) {
+ const ico: any = document.querySelector('link[rel="icon"]');
+ ico.href = res.result.ico;
+ headerImg.value = res.result.logo
+ if (res.result.title) {
+ document.title = `OAuth授权-${res.result.title}`;
+ } else {
+ document.title = 'OAuth授权';
+ }
+ }
+ });
+}
+getSettingDetail()
getCode()
initPage()
@@ -309,7 +341,8 @@ initPage()
gap: 24px;
}
.oauth-content-login {
- max-width: 300px;
+ width: 100%;
+ padding: 0 24px;
}
}
}
From 7ae187ba6301ae7ab2b70e52dad71167398ebd8d Mon Sep 17 00:00:00 2001
From: xieyonghong <18010623010@163.com>
Date: Fri, 28 Apr 2023 15:08:01 +0800
Subject: [PATCH 17/32] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=E8=B6=85=E6=97=B6=E6=96=87=E6=A1=88=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/utils/request.ts | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/utils/request.ts b/src/utils/request.ts
index c7ffca50..757a934a 100644
--- a/src/utils/request.ts
+++ b/src/utils/request.ts
@@ -166,7 +166,11 @@ const errorHandler = (error: any) => {
showNotification(error?.code, error?.response?.data?.message, '404')
}
} else if (error.response === undefined) {
- showNotification(error.message, (error.stack + '').substr(0, 90), undefined)
+ if (error.message.includes('timeout')) {
+ showNotification(error.message, '接口响应超时', undefined)
+ } else {
+ showNotification(error.message, (error.stack + '').substr(0, 90), undefined)
+ }
}
return Promise.reject(error)
}
From 66bfd6bae87dcd813c4e152371cd374af1da3d7f Mon Sep 17 00:00:00 2001
From: XieYongHong <18010623010@163.com>
Date: Fri, 28 Apr 2023 15:10:40 +0800
Subject: [PATCH 18/32] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=E8=B6=85=E6=97=B6=E6=96=87=E6=A1=88=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/utils/request.ts | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/utils/request.ts b/src/utils/request.ts
index f6b2d6ed..54687a0d 100644
--- a/src/utils/request.ts
+++ b/src/utils/request.ts
@@ -167,7 +167,11 @@ const errorHandler = (error: any) => {
showNotification(error?.code, error?.response?.data?.message, '404')
}
} else if (error.response === undefined) {
- showNotification(error.message, (error.stack + '').substr(0, 90), undefined)
+ if (error.message.includes('timeout')) {
+ showNotification(error.message, '接口响应超时', undefined)
+ } else {
+ showNotification(error.message, (error.stack + '').substr(0, 90), undefined)
+ }
}
return Promise.reject(error)
}
From a0e46a7dff33bd3e8cf51d54bea67408d88a5962 Mon Sep 17 00:00:00 2001
From: xieyonghong <18010623010@163.com>
Date: Fri, 28 Apr 2023 15:45:25 +0800
Subject: [PATCH 19/32] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=AE=BE?=
=?UTF-8?q?=E5=A4=87=E6=8E=A5=E5=85=A5=E4=BD=BF=E7=94=A8=E6=8F=92=E4=BB=B6?=
=?UTF-8?q?=E6=97=A0=E6=95=88=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Product/Detail/DeviceAccess/index.vue | 17 +++++++++++++++--
vite.config.ts | 2 +-
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/views/device/Product/Detail/DeviceAccess/index.vue b/src/views/device/Product/Detail/DeviceAccess/index.vue
index fd0e1672..6f4ebf47 100644
--- a/src/views/device/Product/Detail/DeviceAccess/index.vue
+++ b/src/views/device/Product/Detail/DeviceAccess/index.vue
@@ -686,7 +686,7 @@ const getData = async (accessId?: string) => {
productTypes.value = resp.result.map(item => {
if (pluginRes?.result?.externalId === item.id) {
productData.id = pluginRes?.result?.externalId
- productData.metadata = JSON.stringify(item.metadata || {})
+ productData.metadata = item.metadata
}
return { ...item, label: item.name, value: item.id }
})
@@ -724,7 +724,20 @@ const submitDevice = async () => {
const id = productStore.current?.id;
// 该产品是否有物模型,有则弹窗进行处理
const _metadata = JSON.parse(productStore.current?.metadata || '{}')
- if (_metadata.properties?.length || _metadata.events?.length || _metadata.functions?.length || _metadata.tags?.length) {
+ console.log(_metadata.properties, productData.metadata)
+ if (
+ (_metadata.properties?.length ||
+ _metadata.events?.length ||
+ _metadata.functions?.length ||
+ _metadata.tags?.length
+ ) &&
+ (
+ productData.metadata?.properties?.length ||
+ productData.metadata?.events?.length ||
+ productData.metadata?.functions?.length ||
+ productData.metadata?.tags?.length
+ )
+ ) {
metadataModalCacheData.value = {
id,
values,
diff --git a/vite.config.ts b/vite.config.ts
index 4f292d21..8aae6161 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -92,7 +92,7 @@ export default defineConfig(({ mode}) => {
proxy: {
[env.VITE_APP_BASE_API]: {
- // target: 'http://192.168.32.226:8844',
+ // target: 'http://192.168.32.70:8844',
// target: 'http://192.168.32.244:8881',
target: 'http://120.77.179.54:8844', // 120测试
// target: 'http://192.168.33.46:8844', // 本地开发环境
From 3fb2b4b9567f9a40db0d2395b066788b46ca3487 Mon Sep 17 00:00:00 2001
From: xieyonghong <18010623010@163.com>
Date: Fri, 28 Apr 2023 17:20:18 +0800
Subject: [PATCH 20/32] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=8F=9C?=
=?UTF-8?q?=E5=8D=95=E9=85=8D=E7=BD=AE=E6=97=A0=E6=B3=95=E8=B0=83=E6=95=B4?=
=?UTF-8?q?=E9=A1=BA=E5=BA=8F=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/system/Menu/Setting/index.vue | 47 +++++++++++++------------
src/views/system/Menu/Setting/utils.ts | 14 ++++++++
2 files changed, 39 insertions(+), 22 deletions(-)
diff --git a/src/views/system/Menu/Setting/index.vue b/src/views/system/Menu/Setting/index.vue
index cad1e29d..c26096f3 100644
--- a/src/views/system/Menu/Setting/index.vue
+++ b/src/views/system/Menu/Setting/index.vue
@@ -10,30 +10,31 @@
@@ -70,6 +71,7 @@ import {
getMaxDepth,
mergeArr,
findAllParentsAndChildren,
+ handleSorts
} from './utils';
import BaseMenu from '@/views/init-home/data/baseMenu';
import type { AntTreeNodeDropEvent } from 'ant-design-vue/es/tree';
@@ -134,9 +136,9 @@ function filterTree(nodes: Array, selectedKeys: Array) {
const handleOk = async () => {
const _dataArr = filterTree(cloneDeep(treeData.value), selectedKeys.value);
-
+ const _dataSorts = handleSorts(_dataArr)
loading.value = true;
- const res = await updateMenus(_dataArr).catch(() => {});
+ const res = await updateMenus(_dataSorts).catch(() => {});
if (res?.status === 200) {
onlyMessage('操作成功', 'success');
}
@@ -260,6 +262,7 @@ onMounted(() => {
border-radius: 4px;
overflow: hidden;
width: 100%;
+ height: 540px;
&-content {
display: flex;
diff --git a/src/views/system/Menu/Setting/utils.ts b/src/views/system/Menu/Setting/utils.ts
index 1b48299c..c49f6661 100644
--- a/src/views/system/Menu/Setting/utils.ts
+++ b/src/views/system/Menu/Setting/utils.ts
@@ -304,3 +304,17 @@ export const getNodeDepth = (node: any) => {
}
return depth;
};
+
+
+export const handleSorts = (node: any[]) => {
+ if (!node) return []
+ return node.map((item, index) => {
+ if (item.index !== index) {
+ item.sortIndex = index
+ if (item.children) {
+ item.children = handleSorts(item.children)
+ }
+ }
+ return item
+ })
+}
\ No newline at end of file
From baea9bd5aa1b2673d6e26349d68487728fbcdb26 Mon Sep 17 00:00:00 2001
From: XieYongHong <18010623010@163.com>
Date: Fri, 28 Apr 2023 17:23:44 +0800
Subject: [PATCH 21/32] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=8F=9C?=
=?UTF-8?q?=E5=8D=95=E9=85=8D=E7=BD=AE=E6=97=A0=E6=B3=95=E8=B0=83=E6=95=B4?=
=?UTF-8?q?=E9=A1=BA=E5=BA=8F=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/system/Menu/Setting/index.vue | 47 +++++++++++++------------
src/views/system/Menu/Setting/utils.ts | 14 ++++++++
2 files changed, 39 insertions(+), 22 deletions(-)
diff --git a/src/views/system/Menu/Setting/index.vue b/src/views/system/Menu/Setting/index.vue
index cad1e29d..c26096f3 100644
--- a/src/views/system/Menu/Setting/index.vue
+++ b/src/views/system/Menu/Setting/index.vue
@@ -10,30 +10,31 @@
@@ -70,6 +71,7 @@ import {
getMaxDepth,
mergeArr,
findAllParentsAndChildren,
+ handleSorts
} from './utils';
import BaseMenu from '@/views/init-home/data/baseMenu';
import type { AntTreeNodeDropEvent } from 'ant-design-vue/es/tree';
@@ -134,9 +136,9 @@ function filterTree(nodes: Array, selectedKeys: Array) {
const handleOk = async () => {
const _dataArr = filterTree(cloneDeep(treeData.value), selectedKeys.value);
-
+ const _dataSorts = handleSorts(_dataArr)
loading.value = true;
- const res = await updateMenus(_dataArr).catch(() => {});
+ const res = await updateMenus(_dataSorts).catch(() => {});
if (res?.status === 200) {
onlyMessage('操作成功', 'success');
}
@@ -260,6 +262,7 @@ onMounted(() => {
border-radius: 4px;
overflow: hidden;
width: 100%;
+ height: 540px;
&-content {
display: flex;
diff --git a/src/views/system/Menu/Setting/utils.ts b/src/views/system/Menu/Setting/utils.ts
index 1b48299c..c49f6661 100644
--- a/src/views/system/Menu/Setting/utils.ts
+++ b/src/views/system/Menu/Setting/utils.ts
@@ -304,3 +304,17 @@ export const getNodeDepth = (node: any) => {
}
return depth;
};
+
+
+export const handleSorts = (node: any[]) => {
+ if (!node) return []
+ return node.map((item, index) => {
+ if (item.index !== index) {
+ item.sortIndex = index
+ if (item.children) {
+ item.children = handleSorts(item.children)
+ }
+ }
+ return item
+ })
+}
\ No newline at end of file
From d66ea9c8a8e361b0501525267ac545711397ad82 Mon Sep 17 00:00:00 2001
From: xieyonghong <18010623010@163.com>
Date: Thu, 4 May 2023 15:30:13 +0800
Subject: [PATCH 22/32] fix: bug#12763
---
build.sh | 4 ++--
src/views/oauth/index.vue | 8 +++----
.../Save/components/DropdownButton/Menus.vue | 13 ++++++------
.../Save/components/ParamsDropdown/index.vue | 21 ++++++++++++-------
.../Save/components/ParamsDropdown/typings.ts | 4 ++++
.../Save/components/Terms/ParamsItem.vue | 1 +
6 files changed, 30 insertions(+), 21 deletions(-)
diff --git a/build.sh b/build.sh
index 8849f58c..bf6d3418 100644
--- a/build.sh
+++ b/build.sh
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
-docker build -t registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:1.0.0 .
-docker push registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:1.0.0
+docker build -t registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.1 .
+docker push registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.1
diff --git a/src/views/oauth/index.vue b/src/views/oauth/index.vue
index 6fc36ac6..53b71bb6 100644
--- a/src/views/oauth/index.vue
+++ b/src/views/oauth/index.vue
@@ -154,8 +154,8 @@ const getLoginUser = async (data?: any) => {
if (res.success) {
userName.value = res.result?.user.name
isLogin.value = true
- getApplication(data.client_id || params.value.client_id)
- if (data.internal === 'true' || internal.value === 'true') { // 是否走oauth2
+ getApplication(data?.client_id || params.value.client_id)
+ if (data?.internal === 'true' || internal.value === 'true') { // 是否走oauth2
goOAuth2Fn(data)
}
} else if (res.status === 401) {
@@ -163,14 +163,14 @@ const getLoginUser = async (data?: any) => {
spinning.value = false
})
getCode()
- getApplication(data.client_id || params.value.client_id)
+ getApplication(data?.client_id || params.value.client_id)
} else {
setTimeout(() => {
spinning.value = false
})
}
} else {
- getApplication(data.client_id || params.value.client_id)
+ getApplication(data?.client_id || params.value.client_id)
setTimeout(() => {
spinning.value = false
})
diff --git a/src/views/rule-engine/Scene/Save/components/DropdownButton/Menus.vue b/src/views/rule-engine/Scene/Save/components/DropdownButton/Menus.vue
index a4e76bda..0b2c811d 100644
--- a/src/views/rule-engine/Scene/Save/components/DropdownButton/Menus.vue
+++ b/src/views/rule-engine/Scene/Save/components/DropdownButton/Menus.vue
@@ -1,6 +1,6 @@