yuang-framework-ui-common 1.0.44 → 1.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -78,7 +78,7 @@ http.interceptors.response.use(async (res: any) => {
78
78
  return axios.request(res.config);
79
79
  } else if (res?.data?.statusCode === 500815006) {
80
80
  const fullPath = router.currentRoute.value.fullPath;
81
- router.push(`/sso/login/index?ssoRedirectRoutePath=${encodeURIComponent(fullPath)}`);
81
+ router.push(`/sso/auth/index?ssoRedirectRoutePath=${encodeURIComponent(fullPath)}`);
82
82
  return;
83
83
  } else if (res?.data?.statusCode === 500815003) {
84
84
  showErrorMessage(res?.data?.message || messageMap.requestError);
@@ -33,17 +33,17 @@ const getSsoLogoutUrl = (ssoRedirectUrl = '') => {
33
33
  }
34
34
 
35
35
  /**
36
- * 获取sso登录路由路径
36
+ * 获取sso认证路由路径
37
37
  * @param ssoRedirectRoutePath
38
38
  */
39
- const getSsoLoginRoutePath = (ssoRedirectRoutePath = '') => {
40
- let ssoLoginRoutePath = '/sso/login/index';
39
+ const getSsoAuthRoutePath = (ssoRedirectRoutePath = '') => {
40
+ let ssoAuthRoutePath = '/sso/auth/index';
41
41
  if (!ssoRedirectRoutePath) {
42
- ssoLoginRoutePath += `?ssoRedirectRoutePath=${encodeURIComponent('/sso/login/login-success')}`;
42
+ ssoAuthRoutePath += `?ssoRedirectRoutePath=${encodeURIComponent('/sso/auth/auth-success')}`;
43
43
  } else {
44
- ssoLoginRoutePath += `?ssoRedirectRoutePath=${encodeURIComponent(ssoRedirectRoutePath)}`;
44
+ ssoAuthRoutePath += `?ssoRedirectRoutePath=${encodeURIComponent(ssoRedirectRoutePath)}`;
45
45
  }
46
- return ssoLoginRoutePath;
46
+ return ssoAuthRoutePath;
47
47
  }
48
48
 
49
49
  /**
@@ -160,7 +160,7 @@ const logoutSso = () => {
160
160
  export {
161
161
  getSsoLoginUrl,
162
162
  getSsoLogoutUrl,
163
- getSsoLoginRoutePath,
163
+ getSsoAuthRoutePath,
164
164
 
165
165
  getSsoEncrypt,
166
166
  getSsoEncryptList,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yuang-framework-ui-common",
3
- "version": "1.0.44",
3
+ "version": "1.0.46",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,17 +1,17 @@
1
1
  import {createRouter, createWebHistory} from 'vue-router'
2
2
  import {getExceptionRoutes} from '../../lib/utils/vueRouterUtils'
3
3
 
4
- import { getSsoAccessToken, getSsoLoginRoutePath } from '../../lib/utils/ssoUtils';
4
+ import { getSsoAccessToken, getSsoAuthRoutePath } from '../../lib/utils/ssoUtils';
5
5
 
6
6
 
7
7
  const router = createRouter({
8
8
  history: createWebHistory(import.meta.env.BASE_URL),
9
9
  routes: [
10
10
  {
11
- path: '/sso/login/index',
12
- component: () => import('@/views/sso/login/index.vue'),
11
+ path: '/sso/auth/index',
12
+ component: () => import('@/views/sso/auth/index.vue'),
13
13
  meta: {
14
- title: '登录',
14
+ title: '认证',
15
15
  isAnonymous: true
16
16
  }
17
17
  },
@@ -53,7 +53,7 @@ const router = createRouter({
53
53
  router.beforeEach(async (to) => {
54
54
  if (!getSsoAccessToken()) {
55
55
  if (!to.meta?.isAnonymous) {
56
- return getSsoLoginRoutePath(to.fullPath);
56
+ return getSsoAuthRoutePath(to.fullPath);
57
57
  }
58
58
  return;
59
59
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <!-- <div>登录中...</div>-->
2
+ <div>认证中...</div>
3
3
  </template>
4
4
 
5
5
  <script setup lang="ts">
@@ -7,7 +7,7 @@
7
7
  import { useRouter } from 'vue-router';
8
8
 
9
9
  import { getSsoLoginUrl, setSsoAccessToken } from '../../../../lib/utils/ssoUtils';
10
- import { removeUrlParameter } from '../../../../lib/utils/urlUtils';
10
+ import { removeParameter } from '../../../../lib/utils/urlUtils';
11
11
 
12
12
  const router = useRouter();
13
13
 
@@ -24,8 +24,8 @@
24
24
  proxy.$http.get('/sso-api/client/sso-auth/getSsoAccessToken', { params: { ssoAuthCode: ssoAuthCode } }).then((res: any) => {
25
25
  setSsoAccessToken(res.data.data);
26
26
  let ssoRedirectRoutePath = router.currentRoute.value.query.ssoRedirectRoutePath as string;
27
- ssoRedirectRoutePath = (ssoRedirectRoutePath && decodeURIComponent(ssoRedirectRoutePath)) || ('/sso/login/login-success' as any);
28
- ssoRedirectRoutePath = removeUrlParameter(ssoRedirectRoutePath, 'ssoAuthCode');
27
+ ssoRedirectRoutePath = (ssoRedirectRoutePath && decodeURIComponent(ssoRedirectRoutePath)) || ('/sso/auth/auth-success' as any);
28
+ ssoRedirectRoutePath = removeParameter('ssoAuthCode', ssoRedirectRoutePath) || '';
29
29
  router.push(ssoRedirectRoutePath);
30
30
  });
31
31
  });