cosey 0.2.1 → 0.2.3
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/README.md +10 -0
- package/config/http.d.ts +4 -0
- package/config/http.js +4 -0
- package/layout/layout-user-menu/layout-user-menu.vue.js +6 -4
- package/package.json +1 -1
- package/request/useRequest.js +1 -1
package/README.md
CHANGED
|
@@ -59,3 +59,13 @@ Cosey 基于 element-plus 并补充了众多组件,意在使开发者更加专
|
|
|
59
59
|
## 开源协议
|
|
60
60
|
|
|
61
61
|
本项目基于 [MIT](https://zh.wikipedia.org/wiki/MIT%E8%A8%B1%E5%8F%AF%E8%AD%89) 协议,请自由地享受和参与开源。
|
|
62
|
+
|
|
63
|
+
## 构建流程
|
|
64
|
+
|
|
65
|
+
- 更新版本 `npm run cosey:version`
|
|
66
|
+
- 构建库 `npm run cosey:build`
|
|
67
|
+
- 发布库 `npm run cosey:publish`
|
|
68
|
+
- 打包案例 `npm run build`
|
|
69
|
+
- 打包文档 `npm run docs:build`
|
|
70
|
+
- 部署案例和文档 `npm run cosey:deploy`
|
|
71
|
+
- 暂存提交代码
|
package/config/http.d.ts
CHANGED
package/config/http.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, resolveComponent, createBlock, openBlock, withCtx, createElementVNode, normalizeClass, unref, createVNode, toDisplayString, resolveDynamicComponent } from 'vue';
|
|
1
|
+
import { defineComponent, resolveComponent, createBlock, openBlock, withCtx, createElementVNode, normalizeClass, unref, createVNode, toDisplayString, createCommentVNode, resolveDynamicComponent } from 'vue';
|
|
2
2
|
import { useRouter } from 'vue-router';
|
|
3
3
|
import { useGlobalConfig } from '../../config/index.js';
|
|
4
4
|
import { useUserStore } from '../../store/user.js';
|
|
@@ -27,7 +27,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
27
27
|
const userStore = useUserStore();
|
|
28
28
|
const {
|
|
29
29
|
router: routerConfig,
|
|
30
|
-
slots: slotsConfig
|
|
30
|
+
slots: slotsConfig,
|
|
31
|
+
api: apiConfig
|
|
31
32
|
} = useGlobalConfig();
|
|
32
33
|
const UserMenu = defineTemplate(() => slotsConfig.userMenu?.());
|
|
33
34
|
const toHome = () => {
|
|
@@ -62,7 +63,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
62
63
|
/* TEXT, CLASS */)]),
|
|
63
64
|
_: 1
|
|
64
65
|
/* STABLE */
|
|
65
|
-
}), (openBlock(), createBlock(resolveDynamicComponent(unref(UserMenu)))),
|
|
66
|
+
}), (openBlock(), createBlock(resolveDynamicComponent(unref(UserMenu)))), unref(apiConfig).changePassword ? (openBlock(), createBlock(_component_el_dropdown_item, {
|
|
67
|
+
key: 0,
|
|
66
68
|
onClick: toChangePassword
|
|
67
69
|
}, {
|
|
68
70
|
default: withCtx(() => [createVNode(unref(_Icon), {
|
|
@@ -74,7 +76,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
74
76
|
/* TEXT, CLASS */)]),
|
|
75
77
|
_: 1
|
|
76
78
|
/* STABLE */
|
|
77
|
-
}), createVNode(_component_el_dropdown_item, {
|
|
79
|
+
})) : createCommentVNode("v-if", true), createVNode(_component_el_dropdown_item, {
|
|
78
80
|
divided: "",
|
|
79
81
|
onClick: logout
|
|
80
82
|
}, {
|
package/package.json
CHANGED
package/request/useRequest.js
CHANGED
|
@@ -45,7 +45,7 @@ function useRequest(config = {}) {
|
|
|
45
45
|
Object.assign(config2, httpConfig.headers);
|
|
46
46
|
const token = persist.get(TOKEN_NAME);
|
|
47
47
|
if (token) {
|
|
48
|
-
config2.headers.
|
|
48
|
+
config2.headers[httpConfig.authHeaderKey] = httpConfig.authScheme ? `${httpConfig.authScheme} ${token}` : token;
|
|
49
49
|
}
|
|
50
50
|
return config2;
|
|
51
51
|
},
|