yuang-framework-ui-pc 1.0.9 → 1.0.10

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.
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- button[data-v-842edfb2]{width:100px;height:50px;display:flex;align-items:center;justify-content:center;border:none;border-radius:10px;cursor:pointer}
1
+ button[data-v-581224de]{width:100px;height:50px;display:flex;align-items:center;justify-content:center;border:none;border-radius:10px;cursor:pointer}
@@ -14,11 +14,11 @@ const l = /* @__PURE__ */ s({
14
14
  for (const [o, c] of t)
15
15
  n[o] = c;
16
16
  return n;
17
- }, m = /* @__PURE__ */ p(l, [["__scopeId", "data-v-842edfb2"]]), f = [m], d = function(e) {
18
- f.forEach((t) => {
17
+ }, m = /* @__PURE__ */ p(l, [["__scopeId", "data-v-581224de"]]), i = [m], f = function(e) {
18
+ i.forEach((t) => {
19
19
  e.component(t.name, t);
20
20
  });
21
21
  };
22
22
  export {
23
- d as default
23
+ f as default
24
24
  };
@@ -1 +1 @@
1
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("vue")):typeof define=="function"&&define.amd?define(["vue"],o):(e=typeof globalThis<"u"?globalThis:e||self,e["yuang-framework-ui-pc"]=o(e.Vue))})(this,function(e){"use strict";const i=[((t,n)=>{const c=t.__vccOpts||t;for(const[s,u]of n)c[s]=u;return c})(e.defineComponent({__name:"index",setup(t){const{proxy:n}=e.getCurrentInstance(),c=()=>{n.$message.success("我是测试按钮")};return(s,u)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{onClick:c},"我是测试按钮")]))}}),[["__scopeId","data-v-842edfb2"]])];return function(t){i.forEach(n=>{t.component(n.name,n)})}});
1
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("vue")):typeof define=="function"&&define.amd?define(["vue"],o):(e=typeof globalThis<"u"?globalThis:e||self,e["yuang-framework-ui-pc"]=o(e.Vue))})(this,function(e){"use strict";const i=[((t,n)=>{const c=t.__vccOpts||t;for(const[s,u]of n)c[s]=u;return c})(e.defineComponent({__name:"index",setup(t){const{proxy:n}=e.getCurrentInstance(),c=()=>{n.$message.success("我是测试按钮")};return(s,u)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{onClick:c},"我是测试按钮")]))}}),[["__scopeId","data-v-581224de"]])];return function(t){i.forEach(n=>{t.component(n.name,n)})}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yuang-framework-ui-pc",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -23,15 +23,8 @@
23
23
  "author": "yuang",
24
24
  "license": "ISC",
25
25
  "dependencies": {
26
- "@wangeditor/editor": "^5.1.23",
27
- "@wangeditor/editor-for-vue": "^5.1.12",
28
- "axios": "^1.7.3",
29
26
  "element-plus": "^2.7.8",
30
- "js-cookie": "^3.0.5",
31
- "moment": "^2.30.1",
32
- "pinia": "^2.1.7",
33
- "vue": "^3.4.29",
34
- "vue-router": "^4.3.3"
27
+ "yuang-framework-ui-common": "^1.0.3"
35
28
  },
36
29
  "devDependencies": {
37
30
  "@rushstack/eslint-patch": "^1.8.0",
package/src/App.vue CHANGED
@@ -1,9 +1,28 @@
1
1
  <template>
2
- <RouterView/>
2
+ <RouterView v-if="isShowRouterView"/>
3
3
  </template>
4
4
  <script setup lang="ts">
5
5
  import {RouterView} from 'vue-router'
6
+ import {onBeforeMount, ref, getCurrentInstance} from 'vue';
7
+ import {initGateway} from 'yuang-framework-ui-common/lib/utils/gatewayUtils'
6
8
 
9
+ let isShowRouterView = ref(false);
10
+
11
+ const {proxy} = getCurrentInstance() as any;
12
+
13
+ onBeforeMount(async () => {
14
+ await initGateway();
15
+ isShowRouterView.value = true;
16
+
17
+
18
+ // proxy.$http.post("/sso-api/server/sso/login", {}).then((res: any) => {
19
+ // if (res.data.statusCode != 200) {
20
+ // return proxy.$message.error(res.data.message);
21
+ // }
22
+ // });
23
+
24
+
25
+ })
7
26
  </script>
8
27
 
9
28
 
package/src/main.ts CHANGED
@@ -15,7 +15,7 @@ import { ElMessage } from 'element-plus'
15
15
  const app = createApp(App)
16
16
 
17
17
 
18
- import http from '@/config/http';
18
+ import http from 'yuang-framework-ui-common/lib/config/http';
19
19
 
20
20
  app.config.globalProperties.$http = http;
21
21
  app.config.globalProperties.$message = ElMessage
@@ -36,4 +36,7 @@ npm config get registry
36
36
  npm config set registry=https://registry.npmmirror.com
37
37
 
38
38
 
39
+ npm run build
40
+ npm publish
41
+
39
42
  */
@@ -4,8 +4,8 @@ const router = createRouter({
4
4
  history: createWebHistory(import.meta.env.BASE_URL),
5
5
  routes: [
6
6
  {
7
- path: '/packages/yu-button/index',
8
- component: () => import('@/views/packages/yu-button/index.vue'),
7
+ path: '/components/yu-button/index',
8
+ component: () => import('@/views/components/yu-button/index.vue'),
9
9
  meta: {
10
10
  title: ''
11
11
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * shims-vue.d.ts文件是一种声明文件,用来告诉TypeScript如何处理.vue文件,填补TypeScript对.vue文件类型识别缺失的文件,为Vue.js的单文件组件提供类型定义支持。
3
- * 否则会报错:Vue: Could not find a declaration file for module @/packages/YuButton/index.
3
+ * 否则会报错:Vue: Could not find a declaration file for module @/components/YuButton/index.
4
4
  */
5
5
  /* eslint-disable */
6
6
  declare module '*.vue' {
@@ -1,44 +0,0 @@
1
- import axios from "axios"
2
- import router from "@/router/index";
3
-
4
- import {clearSsoAccessToken} from '../utils/ssoUtils';
5
-
6
-
7
- const $http = axios.create({
8
- baseURL: '/gateway-api/',
9
- timeout: 5000,
10
- headers: {}
11
- })
12
-
13
-
14
- /* 请求拦截 */
15
- $http.interceptors.request.use(config => {
16
-
17
- let gatewayAccessToken = localStorage.getItem("gatewayAccessToken") ?? '';
18
- let ssoAccessToken = localStorage.getItem("ssoAccessToken") ?? '';
19
- if (gatewayAccessToken) {
20
- config.headers["Gateway-Access-Token"] = gatewayAccessToken;
21
- }
22
- if (ssoAccessToken) {
23
- config.headers["Sso-Access-Token"] = ssoAccessToken;
24
- }
25
- config.headers["Request-Id"] = 'test';
26
- return config;
27
- }, err => Promise.reject(err));
28
-
29
-
30
- /* 响应拦截器 */
31
- $http.interceptors.response.use((res) => {
32
- // 登录过期处理
33
- if (res.data.statusCode === 401) {
34
- clearSsoAccessToken();
35
- router.push('/sso/login');
36
- return Promise.reject(new Error(res.data.message));
37
- }
38
- return res;
39
- }, (error) => {
40
- return Promise.reject(error);
41
- });
42
-
43
-
44
- export default $http
@@ -1,22 +0,0 @@
1
- import {ElMessage} from 'element-plus/es';
2
-
3
- import http from '@/config/http';
4
-
5
- const initGateway = () => {
6
- return new Promise(async resolve => {
7
- let gatewayAccessToken = localStorage.getItem("gatewayAccessToken");
8
- if (!gatewayAccessToken) {
9
- let res = await http.get('/server/gateway/getGatewayAccessToken');
10
- if (res.data.statusCode != 200) {
11
- return EleMessage.error(res.data.message);
12
- }
13
- localStorage.setItem("gatewayAccessToken", res.data.data.gatewayAccessToken);
14
- }
15
- resolve();
16
- })
17
-
18
- }
19
-
20
- export {
21
- initGateway
22
- }
@@ -1,57 +0,0 @@
1
- 'use strict'
2
-
3
-
4
- import Cookies from 'js-cookie'
5
-
6
- const getSsoLoginUrl = function () {
7
- return 'http://localhost:8110/sso-ui-pc/sso/login';
8
- }
9
-
10
- const getSsoLogoutUrl = function () {
11
- return 'http://localhost:8110/sso-ui-pc/sso/logout';
12
- }
13
-
14
-
15
- const ssoAccessTokenCookieKey:string = 'Sso-Access-Token';
16
- const ssoAccessTokenLocalKey:string = 'ssoAccessToken';
17
- const ssoRefreshTokenLocalKey:string = 'ssoRefreshToken';
18
-
19
-
20
- const getSsoAccessToken = function () {
21
- let ssoAccessToken = Cookies.get(ssoAccessTokenCookieKey);
22
-
23
- if (!ssoAccessToken) {
24
- ssoAccessToken = localStorage.getItem(ssoAccessTokenLocalKey) as string;
25
- return ssoAccessToken
26
- }
27
-
28
- return ssoAccessToken
29
- }
30
-
31
-
32
- const setSsoAccessToken = function (param: any) {
33
- localStorage.setItem(ssoAccessTokenLocalKey, param.ssoAccessToken);
34
- localStorage.setItem(ssoRefreshTokenLocalKey, param.ssoRefreshToken);
35
-
36
- }
37
-
38
-
39
- const clearSsoAccessToken = function () {
40
- Cookies.remove(ssoAccessTokenCookieKey);
41
-
42
- localStorage.removeItem(ssoAccessTokenLocalKey);
43
- localStorage.removeItem(ssoRefreshTokenLocalKey);
44
-
45
- }
46
-
47
-
48
- export {
49
- getSsoLoginUrl,
50
- getSsoLogoutUrl,
51
-
52
- getSsoAccessToken,
53
- setSsoAccessToken,
54
-
55
- clearSsoAccessToken,
56
-
57
- }
File without changes
File without changes