@beclab/olaresid 0.1.5 → 0.1.6
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/utils/crypto-utils.d.ts.map +1 -1
- package/dist/utils/crypto-utils.js +29 -4
- package/dist/utils/crypto-utils.js.map +1 -1
- package/examples/frontend-demo/.dockerignore +40 -0
- package/examples/frontend-demo/index.html +13 -0
- package/examples/frontend-demo/package-lock.json +5304 -0
- package/examples/frontend-demo/package.json +32 -0
- package/examples/frontend-demo/src/App.vue +1156 -0
- package/examples/frontend-demo/src/main.ts +5 -0
- package/examples/frontend-demo/src/style.css +323 -0
- package/examples/frontend-demo/tsconfig.json +24 -0
- package/examples/frontend-demo/webpack.config.js +86 -0
- package/package.json +1 -1
- package/src/utils/crypto-utils.ts +29 -4
- package/examples/quasar-demo/.eslintrc.js +0 -23
- package/examples/quasar-demo/.quasar/app.js +0 -43
- package/examples/quasar-demo/.quasar/client-entry.js +0 -38
- package/examples/quasar-demo/.quasar/client-prefetch.js +0 -130
- package/examples/quasar-demo/.quasar/quasar-user-options.js +0 -16
- package/examples/quasar-demo/README.md +0 -49
- package/examples/quasar-demo/index.html +0 -11
- package/examples/quasar-demo/package-lock.json +0 -6407
- package/examples/quasar-demo/package.json +0 -36
- package/examples/quasar-demo/quasar.config.js +0 -73
- package/examples/quasar-demo/src/App.vue +0 -13
- package/examples/quasar-demo/src/css/app.scss +0 -1
- package/examples/quasar-demo/src/layouts/MainLayout.vue +0 -21
- package/examples/quasar-demo/src/pages/IndexPage.vue +0 -905
- package/examples/quasar-demo/src/router/index.ts +0 -25
- package/examples/quasar-demo/src/router/routes.ts +0 -11
- package/examples/quasar-demo/tsconfig.json +0 -28
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/**
|
|
3
|
-
* THIS FILE IS GENERATED AUTOMATICALLY.
|
|
4
|
-
* DO NOT EDIT.
|
|
5
|
-
*
|
|
6
|
-
* You are probably looking on adding startup/initialization code.
|
|
7
|
-
* Use "quasar new boot <name>" and add it there.
|
|
8
|
-
* One boot file per concern. Then reference the file(s) in quasar.config.js > boot:
|
|
9
|
-
* boot: ['file', ...] // do not add ".js" extension to it.
|
|
10
|
-
*
|
|
11
|
-
* Boot files are your "main.js"
|
|
12
|
-
**/
|
|
13
|
-
|
|
14
|
-
import App from 'app/src/App.vue';
|
|
15
|
-
let appPrefetch =
|
|
16
|
-
typeof App.preFetch === 'function'
|
|
17
|
-
? App.preFetch
|
|
18
|
-
: // Class components return the component options (and the preFetch hook) inside __c property
|
|
19
|
-
App.__c !== void 0 && typeof App.__c.preFetch === 'function'
|
|
20
|
-
? App.__c.preFetch
|
|
21
|
-
: false;
|
|
22
|
-
|
|
23
|
-
function getMatchedComponents(to, router) {
|
|
24
|
-
const route = to
|
|
25
|
-
? to.matched
|
|
26
|
-
? to
|
|
27
|
-
: router.resolve(to).route
|
|
28
|
-
: router.currentRoute.value;
|
|
29
|
-
|
|
30
|
-
if (!route) {
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const matched = route.matched.filter((m) => m.components !== void 0);
|
|
35
|
-
|
|
36
|
-
if (matched.length === 0) {
|
|
37
|
-
return [];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return Array.prototype.concat.apply(
|
|
41
|
-
[],
|
|
42
|
-
matched.map((m) => {
|
|
43
|
-
return Object.keys(m.components).map((key) => {
|
|
44
|
-
const comp = m.components[key];
|
|
45
|
-
return {
|
|
46
|
-
path: m.path,
|
|
47
|
-
c: comp
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
})
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export function addPreFetchHooks({ router, publicPath }) {
|
|
55
|
-
// Add router hook for handling preFetch.
|
|
56
|
-
// Doing it after initial route is resolved so that we don't double-fetch
|
|
57
|
-
// the data that we already have. Using router.beforeResolve() so that all
|
|
58
|
-
// async components are resolved.
|
|
59
|
-
router.beforeResolve((to, from, next) => {
|
|
60
|
-
const urlPath = window.location.href.replace(
|
|
61
|
-
window.location.origin,
|
|
62
|
-
''
|
|
63
|
-
),
|
|
64
|
-
matched = getMatchedComponents(to, router),
|
|
65
|
-
prevMatched = getMatchedComponents(from, router);
|
|
66
|
-
|
|
67
|
-
let diffed = false;
|
|
68
|
-
const preFetchList = matched
|
|
69
|
-
.filter((m, i) => {
|
|
70
|
-
return (
|
|
71
|
-
diffed ||
|
|
72
|
-
(diffed =
|
|
73
|
-
!prevMatched[i] ||
|
|
74
|
-
prevMatched[i].c !== m.c ||
|
|
75
|
-
m.path.indexOf('/:') > -1) // does it has params?
|
|
76
|
-
);
|
|
77
|
-
})
|
|
78
|
-
.filter(
|
|
79
|
-
(m) =>
|
|
80
|
-
m.c !== void 0 &&
|
|
81
|
-
(typeof m.c.preFetch === 'function' ||
|
|
82
|
-
// Class components return the component options (and the preFetch hook) inside __c property
|
|
83
|
-
(m.c.__c !== void 0 &&
|
|
84
|
-
typeof m.c.__c.preFetch === 'function'))
|
|
85
|
-
)
|
|
86
|
-
.map((m) => (m.c.__c !== void 0 ? m.c.__c.preFetch : m.c.preFetch));
|
|
87
|
-
|
|
88
|
-
if (appPrefetch !== false) {
|
|
89
|
-
preFetchList.unshift(appPrefetch);
|
|
90
|
-
appPrefetch = false;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (preFetchList.length === 0) {
|
|
94
|
-
return next();
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
let hasRedirected = false;
|
|
98
|
-
const redirect = (url) => {
|
|
99
|
-
hasRedirected = true;
|
|
100
|
-
next(url);
|
|
101
|
-
};
|
|
102
|
-
const proceed = () => {
|
|
103
|
-
if (hasRedirected === false) {
|
|
104
|
-
next();
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
preFetchList
|
|
109
|
-
.reduce(
|
|
110
|
-
(promise, preFetch) =>
|
|
111
|
-
promise.then(
|
|
112
|
-
() =>
|
|
113
|
-
hasRedirected === false &&
|
|
114
|
-
preFetch({
|
|
115
|
-
currentRoute: to,
|
|
116
|
-
previousRoute: from,
|
|
117
|
-
redirect,
|
|
118
|
-
urlPath,
|
|
119
|
-
publicPath
|
|
120
|
-
})
|
|
121
|
-
),
|
|
122
|
-
Promise.resolve()
|
|
123
|
-
)
|
|
124
|
-
.then(proceed)
|
|
125
|
-
.catch((e) => {
|
|
126
|
-
console.error(e);
|
|
127
|
-
proceed();
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/**
|
|
3
|
-
* THIS FILE IS GENERATED AUTOMATICALLY.
|
|
4
|
-
* DO NOT EDIT.
|
|
5
|
-
*
|
|
6
|
-
* You are probably looking on adding startup/initialization code.
|
|
7
|
-
* Use "quasar new boot <name>" and add it there.
|
|
8
|
-
* One boot file per concern. Then reference the file(s) in quasar.config.js > boot:
|
|
9
|
-
* boot: ['file', ...] // do not add ".js" extension to it.
|
|
10
|
-
*
|
|
11
|
-
* Boot files are your "main.js"
|
|
12
|
-
**/
|
|
13
|
-
|
|
14
|
-
import { Notify } from 'quasar';
|
|
15
|
-
|
|
16
|
-
export default { config: { notify: {} }, plugins: { Notify } };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# OlaresID Quasar Demo
|
|
2
|
-
|
|
3
|
-
最简化的 Quasar 演示项目,展示如何在 Quasar 应用中使用 `@beclab/olaresid` 库。
|
|
4
|
-
|
|
5
|
-
## 安装
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
# 进入项目目录
|
|
9
|
-
cd did-system/packages/olaresid/examples/quasar-demo
|
|
10
|
-
|
|
11
|
-
# 安装依赖
|
|
12
|
-
npm install
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## 运行
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
# 开发模式
|
|
19
|
-
npm run dev
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
项目将在 `http://localhost:9001` 运行。
|
|
23
|
-
|
|
24
|
-
## 项目结构
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
quasar-demo/
|
|
28
|
-
├── src/
|
|
29
|
-
│ ├── layouts/
|
|
30
|
-
│ │ └── MainLayout.vue # 主布局
|
|
31
|
-
│ ├── pages/
|
|
32
|
-
│ │ └── IndexPage.vue # 首页(演示 OlaresID)
|
|
33
|
-
│ ├── router/
|
|
34
|
-
│ │ ├── index.ts # 路由配置
|
|
35
|
-
│ │ └── routes.ts # 路由定义
|
|
36
|
-
│ ├── css/
|
|
37
|
-
│ │ └── app.scss # 全局样式
|
|
38
|
-
│ └── App.vue # 根组件
|
|
39
|
-
├── index.html # HTML 模板
|
|
40
|
-
├── package.json # 依赖配置
|
|
41
|
-
├── quasar.config.js # Quasar 配置
|
|
42
|
-
└── tsconfig.json # TypeScript 配置
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## 功能
|
|
46
|
-
|
|
47
|
-
- 显示 OlaresID 实例信息
|
|
48
|
-
- 测试域名查询功能
|
|
49
|
-
- 示例域名:`tw7613781.olares.com`
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>OlaresID Demo</title>
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
|
|
7
|
-
</head>
|
|
8
|
-
<body>
|
|
9
|
-
<!-- quasar:entry-point -->
|
|
10
|
-
</body>
|
|
11
|
-
</html>
|