yuang-framework-ui-pc 1.0.9 → 1.0.11

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/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.11",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "files": [
17
17
  "dist",
18
- "src"
18
+ "lib"
19
19
  ],
20
20
  "main": "dist/yuang-framework-ui-pc.umd.js",
21
21
  "module": "dist/yuang-framework-ui-pc.es.js",
@@ -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 DELETED
@@ -1,12 +0,0 @@
1
- <template>
2
- <RouterView/>
3
- </template>
4
- <script setup lang="ts">
5
- import {RouterView} from 'vue-router'
6
-
7
- </script>
8
-
9
-
10
- <style scoped>
11
-
12
- </style>
@@ -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
package/src/main.ts DELETED
@@ -1,39 +0,0 @@
1
-
2
- import { createApp } from 'vue'
3
- import { createPinia } from 'pinia'
4
-
5
- import App from './App.vue'
6
- import router from './router'
7
-
8
-
9
- import ElementPlus from 'element-plus'
10
- import 'element-plus/dist/index.css'
11
- import { ElMessage } from 'element-plus'
12
-
13
-
14
-
15
- const app = createApp(App)
16
-
17
-
18
- import http from '@/config/http';
19
-
20
- app.config.globalProperties.$http = http;
21
- app.config.globalProperties.$message = ElMessage
22
-
23
-
24
- app.use(createPinia())
25
- app.use(router)
26
-
27
- app.use(ElementPlus)
28
-
29
- app.mount('#app')
30
-
31
-
32
- /*
33
- npm config get registry
34
-
35
- npm config set registry=https://registry.npmjs.org
36
- npm config set registry=https://registry.npmmirror.com
37
-
38
-
39
- */
@@ -1,25 +0,0 @@
1
- <template>
2
- <div>
3
- <button @click="clickButton">我是测试按钮</button>
4
- </div>
5
- </template>
6
- <script lang="ts" setup name="YuButton">
7
- import {getCurrentInstance} from 'vue';
8
- const {proxy} = getCurrentInstance() as any;
9
-
10
- const clickButton = () => {
11
- proxy.$message.success('我是测试按钮');
12
- }
13
- </script>
14
- <style scoped>
15
- button {
16
- width: 100px;
17
- height: 50px;
18
- display: flex;
19
- align-items: center;
20
- justify-content: center;
21
- border: none;
22
- border-radius: 10px;
23
- cursor: pointer;
24
- }
25
- </style>
@@ -1,13 +0,0 @@
1
- // 引入封装好的组件
2
- import YuButton from "./YuButton/index.vue";
3
- // 将来如果有其它组件,都可以写到这个数组里
4
- const components = [ YuButton ];
5
-
6
- // 批量组件注册
7
- const install = function (Vue) {
8
- components.forEach((component) => {
9
- Vue.component(component.name, component);
10
- });
11
- };
12
-
13
- export default install;
@@ -1,23 +0,0 @@
1
- import {createRouter, createWebHistory} from 'vue-router'
2
-
3
- const router = createRouter({
4
- history: createWebHistory(import.meta.env.BASE_URL),
5
- routes: [
6
- {
7
- path: '/packages/yu-button/index',
8
- component: () => import('@/views/packages/yu-button/index.vue'),
9
- meta: {
10
- title: ''
11
- }
12
- }
13
- ]
14
- })
15
-
16
-
17
- /* 路由守卫 */
18
- router.beforeEach(async (to, from, next) => {
19
- next();
20
- });
21
-
22
-
23
- export default router
@@ -1,10 +0,0 @@
1
- /**
2
- * shims-vue.d.ts文件是一种声明文件,用来告诉TypeScript如何处理.vue文件,填补TypeScript对.vue文件类型识别缺失的文件,为Vue.js的单文件组件提供类型定义支持。
3
- * 否则会报错:Vue: Could not find a declaration file for module @/packages/YuButton/index.
4
- */
5
- /* eslint-disable */
6
- declare module '*.vue' {
7
- import type { DefineComponent } from 'vue';
8
- const component: DefineComponent<{}, {}, any>;
9
- export default component;
10
- }
@@ -1,12 +0,0 @@
1
- import { ref, computed } from 'vue'
2
- import { defineStore } from 'pinia'
3
-
4
- export const useCounterStore = defineStore('counter', () => {
5
- const count = ref(0)
6
- const doubleCount = computed(() => count.value * 2)
7
- function increment() {
8
- count.value++
9
- }
10
-
11
- return { count, doubleCount, increment }
12
- })
@@ -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
- }
@@ -1,13 +0,0 @@
1
- <template>
2
-
3
- <yu-button></yu-button>
4
- </template>
5
- <script setup lang="ts">
6
-
7
- import YuButton from '@/packages/YuButton/index.vue';
8
-
9
- </script>
10
-
11
- <style scoped>
12
-
13
- </style>