giime 0.6.44 → 0.7.0
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/index.css +67 -67
- package/es/api/gstore/request.mjs +2 -1
- package/es/api/gstore/request.mjs.map +1 -1
- package/es/api/guardBasic/request.mjs +5 -9
- package/es/api/guardBasic/request.mjs.map +1 -1
- package/es/api/materialApi/request.mjs +5 -8
- package/es/api/materialApi/request.mjs.map +1 -1
- package/es/api/productCenter/request.mjs +5 -5
- package/es/api/productCenter/request.mjs.map +1 -1
- package/es/api/resource/request.mjs +5 -9
- package/es/api/resource/request.mjs.map +1 -1
- package/es/api/shopAdmin/request.mjs +4 -3
- package/es/api/shopAdmin/request.mjs.map +1 -1
- package/es/api/utils/createModes.d.ts +17 -0
- package/es/api/utils/createModes.mjs +20 -0
- package/es/api/utils/createModes.mjs.map +1 -0
- package/es/api/utils/index.d.ts +1 -0
- package/es/api/utils/index.mjs +1 -0
- package/es/api/utils/index.mjs.map +1 -1
- package/es/api/utils/resetAxiosBaseUrl.mjs.map +1 -1
- package/es/components/src/base/row/Row.vue.d.ts +6 -6
- package/es/components/src/base/row/index.d.ts +16 -16
- package/es/components/src/base/row/row.d.ts +1 -1
- package/es/components/src/business/loginDialog/LoginDialog.vue2.mjs +7 -5
- package/es/components/src/business/loginDialog/LoginDialog.vue2.mjs.map +1 -1
- package/es/components/src/business/uploadPro/UploadPro.vue.d.ts +35 -35
- package/es/components/src/business/uploadPro/UploadPro.vue.mjs +1 -1
- package/es/components/src/business/uploadPro/UploadPro.vue2.mjs +1 -1
- package/es/components/src/business/uploadPro/UploadPro.vue2.mjs.map +1 -1
- package/es/components/src/business/uploadPro/index.d.ts +10 -10
- package/es/giime/index.mjs +1 -1
- package/es/giime/version.d.ts +1 -1
- package/es/giime/version.mjs +1 -1
- package/es/giime/version.mjs.map +1 -1
- package/es/hooks/store/userCenter/useOrgTreeList/index.mjs +1 -1
- package/es/hooks/store/userCenter/useOrgTreeList/index.mjs.map +1 -1
- package/es/index.css +67 -67
- package/es/utils/index.mjs +1 -1
- package/es/utils/src/http/index.mjs +1 -1
- package/es/utils/src/http/url.d.ts +7 -0
- package/es/utils/src/http/url.mjs +14 -1
- package/es/utils/src/http/url.mjs.map +1 -1
- package/es/utils/src/vue/resolver.d.ts +4 -1
- package/es/utils/src/vue/resolver.mjs +4 -1
- package/es/utils/src/vue/resolver.mjs.map +1 -1
- package/lib/api/gstore/request.js +2 -1
- package/lib/api/gstore/request.js.map +1 -1
- package/lib/api/guardBasic/request.js +5 -9
- package/lib/api/guardBasic/request.js.map +1 -1
- package/lib/api/materialApi/request.js +5 -8
- package/lib/api/materialApi/request.js.map +1 -1
- package/lib/api/productCenter/request.js +5 -5
- package/lib/api/productCenter/request.js.map +1 -1
- package/lib/api/resource/request.js +5 -9
- package/lib/api/resource/request.js.map +1 -1
- package/lib/api/shopAdmin/request.js +4 -3
- package/lib/api/shopAdmin/request.js.map +1 -1
- package/lib/api/utils/createModes.d.ts +17 -0
- package/lib/api/utils/createModes.js +22 -0
- package/lib/api/utils/createModes.js.map +1 -0
- package/lib/api/utils/index.d.ts +1 -0
- package/lib/api/utils/index.js +2 -0
- package/lib/api/utils/index.js.map +1 -1
- package/lib/api/utils/resetAxiosBaseUrl.js.map +1 -1
- package/lib/components/src/base/row/Row.vue.d.ts +6 -6
- package/lib/components/src/base/row/index.d.ts +16 -16
- package/lib/components/src/base/row/row.d.ts +1 -1
- package/lib/components/src/business/loginDialog/LoginDialog.vue2.js +7 -5
- package/lib/components/src/business/loginDialog/LoginDialog.vue2.js.map +1 -1
- package/lib/components/src/business/uploadPro/UploadPro.vue.d.ts +35 -35
- package/lib/components/src/business/uploadPro/UploadPro.vue.js +1 -1
- package/lib/components/src/business/uploadPro/UploadPro.vue2.js +1 -1
- package/lib/components/src/business/uploadPro/UploadPro.vue2.js.map +1 -1
- package/lib/components/src/business/uploadPro/index.d.ts +10 -10
- package/lib/giime/index.js +1 -0
- package/lib/giime/index.js.map +1 -1
- package/lib/giime/version.d.ts +1 -1
- package/lib/giime/version.js +1 -1
- package/lib/giime/version.js.map +1 -1
- package/lib/hooks/store/userCenter/useOrgTreeList/index.js +1 -1
- package/lib/hooks/store/userCenter/useOrgTreeList/index.js.map +1 -1
- package/lib/index.css +67 -67
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/src/http/index.js +1 -0
- package/lib/utils/src/http/index.js.map +1 -1
- package/lib/utils/src/http/url.d.ts +7 -0
- package/lib/utils/src/http/url.js +14 -0
- package/lib/utils/src/http/url.js.map +1 -1
- package/lib/utils/src/vue/resolver.d.ts +4 -1
- package/lib/utils/src/vue/resolver.js +4 -1
- package/lib/utils/src/vue/resolver.js.map +1 -1
- package/package.json +1 -1
package/lib/index.css
CHANGED
|
@@ -878,11 +878,18 @@ video {
|
|
|
878
878
|
margin: 0;
|
|
879
879
|
}
|
|
880
880
|
|
|
881
|
-
.gm-
|
|
881
|
+
.gm-flex-center[data-v-c17deec9] {
|
|
882
|
+
align-items: center;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
.gm-flex-justify-between[data-v-c17deec9] {
|
|
886
|
+
justify-content: space-between;
|
|
887
|
+
}
|
|
888
|
+
.gm-upload-pro-preview-dialog[data-v-c2c42dbb] [data-v-c2c42dbb] .el-dialog__body {
|
|
882
889
|
padding: 0;
|
|
883
890
|
}
|
|
884
891
|
|
|
885
|
-
.gm-upload-pro-file-picture-card[data-v-
|
|
892
|
+
.gm-upload-pro-file-picture-card[data-v-c2c42dbb] [data-v-c2c42dbb] .el-upload-list__item, .gm-upload-pro-file-picture-card[data-v-c2c42dbb] [data-v-c2c42dbb] .el-upload--picture-card {
|
|
886
893
|
width: auto;
|
|
887
894
|
height: auto;
|
|
888
895
|
}
|
|
@@ -924,37 +931,6 @@ video {
|
|
|
924
931
|
.gm-upload-pro-file-disabled .el-upload-list__item-status-label {
|
|
925
932
|
display: none;
|
|
926
933
|
}
|
|
927
|
-
.circular[data-v-d7b04fae] {
|
|
928
|
-
animation: loading-rotate-d7b04fae 2s linear infinite;
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
.path[data-v-d7b04fae] {
|
|
932
|
-
animation: loading-dash-d7b04fae 1.5s ease-in-out infinite;
|
|
933
|
-
stroke-dasharray: 90, 150;
|
|
934
|
-
stroke-dashoffset: 0;
|
|
935
|
-
stroke: var(--el-color-primary);
|
|
936
|
-
stroke-linecap: round;
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
@keyframes loading-rotate-d7b04fae {
|
|
940
|
-
to {
|
|
941
|
-
transform: rotate(360deg);
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
@keyframes loading-dash-d7b04fae {
|
|
945
|
-
0% {
|
|
946
|
-
stroke-dasharray: 1, 200;
|
|
947
|
-
stroke-dashoffset: 0;
|
|
948
|
-
}
|
|
949
|
-
50% {
|
|
950
|
-
stroke-dasharray: 90, 150;
|
|
951
|
-
stroke-dashoffset: -40px;
|
|
952
|
-
}
|
|
953
|
-
100% {
|
|
954
|
-
stroke-dasharray: 90, 150;
|
|
955
|
-
stroke-dashoffset: -120px;
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
934
|
[data-v-98c2e804] .gmTableNoBorder .el-table__body .el-table__cell {
|
|
959
935
|
border-right: none;
|
|
960
936
|
}
|
|
@@ -978,12 +954,9 @@ video {
|
|
|
978
954
|
[data-v-98c2e804] .gmTableNoBorder .el-table__border-left-patch {
|
|
979
955
|
height: 0;
|
|
980
956
|
}
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
.gm-flex-justify-between[data-v-c17deec9] {
|
|
986
|
-
justify-content: space-between;
|
|
957
|
+
[data-v-488ca110] .gmSearchForm .el-form-item {
|
|
958
|
+
margin-right: 0;
|
|
959
|
+
margin-bottom: 4px;
|
|
987
960
|
}
|
|
988
961
|
.gm-number-interval-single[data-v-4e6f4d6f] {
|
|
989
962
|
border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
|
|
@@ -1003,10 +976,6 @@ video {
|
|
|
1003
976
|
.gm-number-interval-single[data-v-4e6f4d6f]:hover .gm-number-interval-close[data-v-4e6f4d6f] {
|
|
1004
977
|
display: flex;
|
|
1005
978
|
}
|
|
1006
|
-
[data-v-488ca110] .gmSearchForm .el-form-item {
|
|
1007
|
-
margin-right: 0;
|
|
1008
|
-
margin-bottom: 4px;
|
|
1009
|
-
}
|
|
1010
979
|
.gm-upload-preview-dialog[data-v-62eb3199] [data-v-62eb3199] .el-dialog__body {
|
|
1011
980
|
padding: 0;
|
|
1012
981
|
}
|
|
@@ -1073,6 +1042,37 @@ video {
|
|
|
1073
1042
|
.gm-upload-file-disabled .el-upload-list__item-status-label {
|
|
1074
1043
|
display: none;
|
|
1075
1044
|
}
|
|
1045
|
+
.circular[data-v-d7b04fae] {
|
|
1046
|
+
animation: loading-rotate-d7b04fae 2s linear infinite;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
.path[data-v-d7b04fae] {
|
|
1050
|
+
animation: loading-dash-d7b04fae 1.5s ease-in-out infinite;
|
|
1051
|
+
stroke-dasharray: 90, 150;
|
|
1052
|
+
stroke-dashoffset: 0;
|
|
1053
|
+
stroke: var(--el-color-primary);
|
|
1054
|
+
stroke-linecap: round;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
@keyframes loading-rotate-d7b04fae {
|
|
1058
|
+
to {
|
|
1059
|
+
transform: rotate(360deg);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
@keyframes loading-dash-d7b04fae {
|
|
1063
|
+
0% {
|
|
1064
|
+
stroke-dasharray: 1, 200;
|
|
1065
|
+
stroke-dashoffset: 0;
|
|
1066
|
+
}
|
|
1067
|
+
50% {
|
|
1068
|
+
stroke-dasharray: 90, 150;
|
|
1069
|
+
stroke-dashoffset: -40px;
|
|
1070
|
+
}
|
|
1071
|
+
100% {
|
|
1072
|
+
stroke-dasharray: 90, 150;
|
|
1073
|
+
stroke-dashoffset: -120px;
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
1076
|
|
|
1077
1077
|
.pagination-container[data-v-47d35e7b] {
|
|
1078
1078
|
background: #fff;
|
|
@@ -1083,112 +1083,112 @@ video {
|
|
|
1083
1083
|
}
|
|
1084
1084
|
|
|
1085
1085
|
@charset "UTF-8";
|
|
1086
|
-
.
|
|
1086
|
+
.custom-operate-drawer .el-drawer__header {
|
|
1087
1087
|
padding: 10px 15px;
|
|
1088
1088
|
margin: 0;
|
|
1089
1089
|
border-bottom: 1px solid #ebeef5;
|
|
1090
1090
|
}
|
|
1091
|
-
.
|
|
1091
|
+
.custom-operate-drawer .el-drawer__title {
|
|
1092
1092
|
font-size: 14px;
|
|
1093
1093
|
color: #333;
|
|
1094
1094
|
}
|
|
1095
|
-
.
|
|
1095
|
+
.custom-operate-drawer .el-drawer__body {
|
|
1096
1096
|
padding: 15px;
|
|
1097
1097
|
}
|
|
1098
|
-
.
|
|
1098
|
+
.custom-operate-drawer .el-drawer__footer {
|
|
1099
1099
|
padding: 10px 15px;
|
|
1100
1100
|
border-top: 1px solid #ebeef5;
|
|
1101
1101
|
}
|
|
1102
|
-
.
|
|
1102
|
+
.custom-operate-drawer .el-checkbox {
|
|
1103
1103
|
display: flex;
|
|
1104
1104
|
align-items: center;
|
|
1105
1105
|
}
|
|
1106
|
-
.
|
|
1106
|
+
.custom-operate-drawer .el-input__inner {
|
|
1107
1107
|
text-align: center;
|
|
1108
1108
|
}
|
|
1109
|
-
.
|
|
1109
|
+
.custom-operate-drawer .el-input__suffix {
|
|
1110
1110
|
position: absolute;
|
|
1111
1111
|
right: 10px;
|
|
1112
1112
|
}
|
|
1113
|
-
.
|
|
1113
|
+
.custom-operate-drawer .custom-content li {
|
|
1114
1114
|
display: flex;
|
|
1115
1115
|
align-items: center;
|
|
1116
1116
|
justify-content: center;
|
|
1117
1117
|
height: 44px;
|
|
1118
1118
|
}
|
|
1119
|
-
.
|
|
1119
|
+
.custom-operate-drawer .custom-group {
|
|
1120
1120
|
max-height: calc(100vh - 226px);
|
|
1121
1121
|
overflow-y: auto;
|
|
1122
1122
|
}
|
|
1123
|
-
.
|
|
1123
|
+
.custom-operate-drawer .custom-group::-webkit-scrollbar {
|
|
1124
1124
|
/*滚动条整体样式*/
|
|
1125
1125
|
width: 4px;
|
|
1126
1126
|
/*高宽分别对应横竖滚动条的尺寸*/
|
|
1127
1127
|
height: 1px;
|
|
1128
1128
|
}
|
|
1129
|
-
.
|
|
1129
|
+
.custom-operate-drawer .custom-group::-webkit-scrollbar-thumb {
|
|
1130
1130
|
/*滚动条里面小方块*/
|
|
1131
1131
|
border-radius: 10px;
|
|
1132
1132
|
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
|
|
1133
1133
|
background: #999;
|
|
1134
1134
|
}
|
|
1135
|
-
.
|
|
1135
|
+
.custom-operate-drawer .custom-group::-webkit-scrollbar-track {
|
|
1136
1136
|
/*滚动条里面轨道*/
|
|
1137
1137
|
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
|
|
1138
1138
|
border-radius: 10px;
|
|
1139
1139
|
background: #eee;
|
|
1140
1140
|
}
|
|
1141
1141
|
@charset "UTF-8";
|
|
1142
|
-
.custom-
|
|
1142
|
+
.table-custom-header-drawer .el-drawer__header {
|
|
1143
1143
|
padding: 10px 15px;
|
|
1144
1144
|
margin: 0;
|
|
1145
1145
|
border-bottom: 1px solid #ebeef5;
|
|
1146
1146
|
}
|
|
1147
|
-
.custom-
|
|
1147
|
+
.table-custom-header-drawer .el-drawer__title {
|
|
1148
1148
|
font-size: 14px;
|
|
1149
1149
|
color: #333;
|
|
1150
1150
|
}
|
|
1151
|
-
.custom-
|
|
1151
|
+
.table-custom-header-drawer .el-drawer__body {
|
|
1152
1152
|
padding: 15px;
|
|
1153
1153
|
}
|
|
1154
|
-
.custom-
|
|
1154
|
+
.table-custom-header-drawer .el-drawer__footer {
|
|
1155
1155
|
padding: 10px 15px;
|
|
1156
1156
|
border-top: 1px solid #ebeef5;
|
|
1157
1157
|
}
|
|
1158
|
-
.custom-
|
|
1158
|
+
.table-custom-header-drawer .el-checkbox {
|
|
1159
1159
|
display: flex;
|
|
1160
1160
|
align-items: center;
|
|
1161
1161
|
}
|
|
1162
|
-
.custom-
|
|
1162
|
+
.table-custom-header-drawer .el-input__inner {
|
|
1163
1163
|
text-align: center;
|
|
1164
1164
|
}
|
|
1165
|
-
.custom-
|
|
1165
|
+
.table-custom-header-drawer .el-input__suffix {
|
|
1166
1166
|
position: absolute;
|
|
1167
1167
|
right: 10px;
|
|
1168
1168
|
}
|
|
1169
|
-
.custom-
|
|
1169
|
+
.table-custom-header-drawer .custom-content li {
|
|
1170
1170
|
display: flex;
|
|
1171
1171
|
align-items: center;
|
|
1172
1172
|
justify-content: center;
|
|
1173
1173
|
height: 44px;
|
|
1174
1174
|
}
|
|
1175
|
-
.custom-
|
|
1175
|
+
.table-custom-header-drawer .custom-group {
|
|
1176
1176
|
max-height: calc(100vh - 226px);
|
|
1177
1177
|
overflow-y: auto;
|
|
1178
1178
|
}
|
|
1179
|
-
.custom-
|
|
1179
|
+
.table-custom-header-drawer .custom-group::-webkit-scrollbar {
|
|
1180
1180
|
/*滚动条整体样式*/
|
|
1181
1181
|
width: 4px;
|
|
1182
1182
|
/*高宽分别对应横竖滚动条的尺寸*/
|
|
1183
1183
|
height: 1px;
|
|
1184
1184
|
}
|
|
1185
|
-
.custom-
|
|
1185
|
+
.table-custom-header-drawer .custom-group::-webkit-scrollbar-thumb {
|
|
1186
1186
|
/*滚动条里面小方块*/
|
|
1187
1187
|
border-radius: 10px;
|
|
1188
1188
|
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
|
|
1189
1189
|
background: #999;
|
|
1190
1190
|
}
|
|
1191
|
-
.custom-
|
|
1191
|
+
.table-custom-header-drawer .custom-group::-webkit-scrollbar-track {
|
|
1192
1192
|
/*滚动条里面轨道*/
|
|
1193
1193
|
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
|
|
1194
1194
|
border-radius: 10px;
|
package/lib/utils/index.js
CHANGED
|
@@ -115,6 +115,7 @@ exports.req401Interceptors = interceptors.req401Interceptors;
|
|
|
115
115
|
exports.res401Interceptors = interceptors.res401Interceptors;
|
|
116
116
|
exports.giimeDevProxy = devProxy.giimeDevProxy;
|
|
117
117
|
exports.getDomain = url.getDomain;
|
|
118
|
+
exports.urlJoin = url.urlJoin;
|
|
118
119
|
exports.getDateShortcuts = dateShortcuts.getDateShortcuts;
|
|
119
120
|
Object.defineProperty(exports, "genFileId", {
|
|
120
121
|
enumerable: true,
|
package/lib/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -15,4 +15,5 @@ exports.req401Interceptors = interceptors.req401Interceptors;
|
|
|
15
15
|
exports.res401Interceptors = interceptors.res401Interceptors;
|
|
16
16
|
exports.giimeDevProxy = devProxy.giimeDevProxy;
|
|
17
17
|
exports.getDomain = url.getDomain;
|
|
18
|
+
exports.urlJoin = url.urlJoin;
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
|
@@ -3,3 +3,10 @@
|
|
|
3
3
|
* @example https://www.baidu.com/s?wd=hello&ie=utf-8 => .baidu.com
|
|
4
4
|
*/
|
|
5
5
|
export declare function getDomain(): string | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* 拼接 url 路径,自动处理多余的 /
|
|
8
|
+
* @param {...string[]} parts 路径片段
|
|
9
|
+
* @returns {string}
|
|
10
|
+
* @example urlJoin('https://www.baidu.com', 's', 'wd=hello') => https://www.baidu.com/s/wd=hello
|
|
11
|
+
*/
|
|
12
|
+
export declare function urlJoin(...parts: string[]): string;
|
|
@@ -18,6 +18,20 @@ function getDomain() {
|
|
|
18
18
|
}
|
|
19
19
|
return void 0;
|
|
20
20
|
}
|
|
21
|
+
function urlJoin(...parts) {
|
|
22
|
+
if (parts.length === 0)
|
|
23
|
+
return "";
|
|
24
|
+
if (parts.length === 1)
|
|
25
|
+
return parts[0];
|
|
26
|
+
return parts.map((part, i) => {
|
|
27
|
+
if (i === 0)
|
|
28
|
+
return part.replace(/\/+$/, "");
|
|
29
|
+
if (i === parts.length - 1)
|
|
30
|
+
return part.replace(/^\/+/, "");
|
|
31
|
+
return part.replace(/^\/+|\/+$/g, "");
|
|
32
|
+
}).filter(Boolean).join("/");
|
|
33
|
+
}
|
|
21
34
|
|
|
22
35
|
exports.getDomain = getDomain;
|
|
36
|
+
exports.urlJoin = urlJoin;
|
|
23
37
|
//# sourceMappingURL=url.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","sources":["../../../../../../packages/utils/src/http/url.ts"],"sourcesContent":["/**\n * 获取当前页面的域\n * @example https://www.baidu.com/s?wd=hello&ie=utf-8 => .baidu.com\n */\nexport function getDomain() {\n const url = window.location.href;\n // eslint-disable-next-line no-useless-escape\n const domainPattern = /https?:\\/\\/([^\\/]+)/;\n const match = url.match(domainPattern);\n\n if (match) {\n const domain = match[1];\n // 检查是否是IP地址或localhost\n if (/^(localhost|(\\d{1,3}\\.){3}\\d{1,3})$/.test(domain)) {\n return undefined;\n }\n\n // 提取主域名部分\n const domainParts = domain.split('.');\n if (domainParts.length > 2) {\n return `.${domainParts.slice(-2).join('.')}`;\n } else {\n return `.${domain}`;\n }\n }\n\n return undefined;\n}\n\n// // 使用示例\n// console.log(getDomain());\n"],"names":[],"mappings":";;AAIO,SAAS,SAAY,GAAA;AAC1B,EAAM,MAAA,GAAA,GAAM,OAAO,QAAS,CAAA,IAAA,CAAA;AAE5B,EAAA,MAAM,aAAgB,GAAA,qBAAA,CAAA;AACtB,EAAM,MAAA,KAAA,GAAQ,GAAI,CAAA,KAAA,CAAM,aAAa,CAAA,CAAA;AAErC,EAAA,IAAI,KAAO,EAAA;AACT,IAAM,MAAA,MAAA,GAAS,MAAM,CAAC,CAAA,CAAA;AAEtB,IAAI,IAAA,qCAAA,CAAsC,IAAK,CAAA,MAAM,CAAG,EAAA;AACtD,MAAO,OAAA,KAAA,CAAA,CAAA;AAAA,KACT;AAGA,IAAM,MAAA,WAAA,GAAc,MAAO,CAAA,KAAA,CAAM,GAAG,CAAA,CAAA;AACpC,IAAI,IAAA,WAAA,CAAY,SAAS,CAAG,EAAA;AAC1B,MAAA,OAAO,IAAI,WAAY,CAAA,KAAA,CAAM,EAAE,CAAE,CAAA,IAAA,CAAK,GAAG,CAAC,CAAA,CAAA,CAAA;AAAA,KACrC,MAAA;AACL,MAAA,OAAO,IAAI,MAAM,CAAA,CAAA,CAAA;AAAA,KACnB;AAAA,GACF;AAEA,EAAO,OAAA,KAAA,CAAA,CAAA;AACT
|
|
1
|
+
{"version":3,"file":"url.js","sources":["../../../../../../packages/utils/src/http/url.ts"],"sourcesContent":["/**\n * 获取当前页面的域\n * @example https://www.baidu.com/s?wd=hello&ie=utf-8 => .baidu.com\n */\nexport function getDomain() {\n const url = window.location.href;\n // eslint-disable-next-line no-useless-escape\n const domainPattern = /https?:\\/\\/([^\\/]+)/;\n const match = url.match(domainPattern);\n\n if (match) {\n const domain = match[1];\n // 检查是否是IP地址或localhost\n if (/^(localhost|(\\d{1,3}\\.){3}\\d{1,3})$/.test(domain)) {\n return undefined;\n }\n\n // 提取主域名部分\n const domainParts = domain.split('.');\n if (domainParts.length > 2) {\n return `.${domainParts.slice(-2).join('.')}`;\n } else {\n return `.${domain}`;\n }\n }\n\n return undefined;\n}\n\n// // 使用示例\n// console.log(getDomain());\n/**\n * 拼接 url 路径,自动处理多余的 /\n * @param {...string[]} parts 路径片段\n * @returns {string}\n * @example urlJoin('https://www.baidu.com', 's', 'wd=hello') => https://www.baidu.com/s/wd=hello\n */\nexport function urlJoin(...parts: string[]): string {\n if (parts.length === 0) return '';\n if (parts.length === 1) return parts[0];\n\n return parts\n .map((part, i) => {\n if (i === 0) return part.replace(/\\/+$/, ''); // 第一个去掉结尾/\n if (i === parts.length - 1) return part.replace(/^\\/+/, ''); // 最后一个去掉开头/\n\n return part.replace(/^\\/+|\\/+$/g, ''); // 中间的去掉头尾/\n })\n .filter(Boolean)\n .join('/');\n}\n"],"names":[],"mappings":";;AAIO,SAAS,SAAY,GAAA;AAC1B,EAAM,MAAA,GAAA,GAAM,OAAO,QAAS,CAAA,IAAA,CAAA;AAE5B,EAAA,MAAM,aAAgB,GAAA,qBAAA,CAAA;AACtB,EAAM,MAAA,KAAA,GAAQ,GAAI,CAAA,KAAA,CAAM,aAAa,CAAA,CAAA;AAErC,EAAA,IAAI,KAAO,EAAA;AACT,IAAM,MAAA,MAAA,GAAS,MAAM,CAAC,CAAA,CAAA;AAEtB,IAAI,IAAA,qCAAA,CAAsC,IAAK,CAAA,MAAM,CAAG,EAAA;AACtD,MAAO,OAAA,KAAA,CAAA,CAAA;AAAA,KACT;AAGA,IAAM,MAAA,WAAA,GAAc,MAAO,CAAA,KAAA,CAAM,GAAG,CAAA,CAAA;AACpC,IAAI,IAAA,WAAA,CAAY,SAAS,CAAG,EAAA;AAC1B,MAAA,OAAO,IAAI,WAAY,CAAA,KAAA,CAAM,EAAE,CAAE,CAAA,IAAA,CAAK,GAAG,CAAC,CAAA,CAAA,CAAA;AAAA,KACrC,MAAA;AACL,MAAA,OAAO,IAAI,MAAM,CAAA,CAAA,CAAA;AAAA,KACnB;AAAA,GACF;AAEA,EAAO,OAAA,KAAA,CAAA,CAAA;AACT,CAAA;AAUO,SAAS,WAAW,KAAyB,EAAA;AAClD,EAAA,IAAI,MAAM,MAAW,KAAA,CAAA;AAAG,IAAO,OAAA,EAAA,CAAA;AAC/B,EAAA,IAAI,MAAM,MAAW,KAAA,CAAA;AAAG,IAAA,OAAO,MAAM,CAAC,CAAA,CAAA;AAEtC,EAAA,OAAO,KACJ,CAAA,GAAA,CAAI,CAAC,IAAA,EAAM,CAAM,KAAA;AAChB,IAAA,IAAI,CAAM,KAAA,CAAA;AAAG,MAAO,OAAA,IAAA,CAAK,OAAQ,CAAA,MAAA,EAAQ,EAAE,CAAA,CAAA;AAC3C,IAAI,IAAA,CAAA,KAAM,MAAM,MAAS,GAAA,CAAA;AAAG,MAAO,OAAA,IAAA,CAAK,OAAQ,CAAA,MAAA,EAAQ,EAAE,CAAA,CAAA;AAE1D,IAAO,OAAA,IAAA,CAAK,OAAQ,CAAA,YAAA,EAAc,EAAE,CAAA,CAAA;AAAA,GACrC,CACA,CAAA,MAAA,CAAO,OAAO,CAAA,CACd,KAAK,GAAG,CAAA,CAAA;AACb;;;;;"}
|
|
@@ -4,7 +4,10 @@ import type { ProxyOptions } from 'vite';
|
|
|
4
4
|
import * as http from 'node:http';
|
|
5
5
|
export declare function kebabCase(key: string): string;
|
|
6
6
|
export declare const GiimeResolver: () => ComponentResolver[];
|
|
7
|
+
export interface GiimeBypassOptions {
|
|
8
|
+
showLog?: boolean;
|
|
9
|
+
}
|
|
7
10
|
/**
|
|
8
11
|
* webpack-dev-server style bypass function
|
|
9
12
|
*/
|
|
10
|
-
export declare const bypass: (req: http.IncomingMessage, res: http.ServerResponse | undefined, options: ProxyOptions) => void;
|
|
13
|
+
export declare const bypass: (req: http.IncomingMessage, res: http.ServerResponse | undefined, options: ProxyOptions, giimeOptions?: GiimeBypassOptions) => void;
|
|
@@ -22,11 +22,14 @@ const GiimeResolver = () => {
|
|
|
22
22
|
}
|
|
23
23
|
];
|
|
24
24
|
};
|
|
25
|
-
const bypass = (req, res, options) => {
|
|
25
|
+
const bypass = (req, res, options, giimeOptions) => {
|
|
26
26
|
const targetPath = new URL(options.target?.toString() ?? "").pathname.replace(/\/$/, "");
|
|
27
27
|
const rewrittenPath = options.rewrite?.(req.url) ?? "";
|
|
28
28
|
const fullPath = `${targetPath}${rewrittenPath}`;
|
|
29
29
|
const proxyUrl = new URL(fullPath, options.target?.toString());
|
|
30
|
+
if (giimeOptions?.showLog) {
|
|
31
|
+
console.log("proxyUrl", proxyUrl.toString());
|
|
32
|
+
}
|
|
30
33
|
res?.setHeader("x-giime-proxy-url", proxyUrl.toString());
|
|
31
34
|
};
|
|
32
35
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.js","sources":["../../../../../../packages/utils/src/vue/resolver.ts"],"sourcesContent":["import type { ComponentResolver } from 'unplugin-vue-components';\nimport type { ProxyOptions } from 'vite';\nimport * as http from 'node:http';\n\nexport function kebabCase(key: string) {\n const result = key.replace(/([A-Z])/g, ' $1').trim();\n return result.split(' ').join('-').toLowerCase();\n}\nexport const GiimeResolver = (): ComponentResolver[] => {\n return [\n {\n type: 'component',\n resolve: async (name: string) => {\n if (!name.match(/^Gm[A-Z]/)) return;\n // const partialName = kebabCase(name.slice(2));\n // where `componentName` is always CapitalCase\n return { name, from: 'giime' };\n },\n },\n {\n type: 'directive',\n resolve: async () => {\n return;\n },\n },\n ];\n};\n/**\n * webpack-dev-server style bypass function\n */\nexport const bypass = (\n req: http.IncomingMessage,\n /** undefined for WebSocket upgrade requests */\n res: http.ServerResponse | undefined,\n options: ProxyOptions,\n) => {\n // 获取请求路径,处理后缀斜杠的问题\n const targetPath = new URL(options.target?.toString() ?? '').pathname.replace(/\\/$/, '');\n // 使用 rewrite 函数处理请求路径,并处理后缀斜杠的问题\n const rewrittenPath = options.rewrite?.(req.url!) ?? '';\n // 合并路径\n const fullPath = `${targetPath}${rewrittenPath}`;\n\n // 构造完整的代理 URL\n const proxyUrl = new URL(fullPath, options.target?.toString());\n\n // 设置响应头\n res?.setHeader('x-giime-proxy-url', proxyUrl.toString());\n};\n"],"names":[],"mappings":";;AAIO,SAAS,UAAU,GAAa,EAAA;AACrC,EAAA,MAAM,SAAS,GAAI,CAAA,OAAA,CAAQ,UAAY,EAAA,KAAK,EAAE,IAAK,EAAA,CAAA;AACnD,EAAA,OAAO,OAAO,KAAM,CAAA,GAAG,EAAE,IAAK,CAAA,GAAG,EAAE,WAAY,EAAA,CAAA;AACjD,CAAA;AACO,MAAM,gBAAgB,MAA2B;AACtD,EAAO,OAAA;AAAA,IACL;AAAA,MACE,IAAM,EAAA,WAAA;AAAA,MACN,OAAA,EAAS,OAAO,IAAiB,KAAA;AAC/B,QAAI,IAAA,CAAC,IAAK,CAAA,KAAA,CAAM,UAAU,CAAA;AAAG,UAAA,OAAA;AAG7B,QAAO,OAAA,EAAE,IAAM,EAAA,IAAA,EAAM,OAAQ,EAAA,CAAA;AAAA,OAC/B;AAAA,KACF;AAAA,IACA;AAAA,MACE,IAAM,EAAA,WAAA;AAAA,MACN,SAAS,YAAY;AACnB,QAAA,OAAA;AAAA,OACF;AAAA,KACF;AAAA,GACF,CAAA;AACF,EAAA;
|
|
1
|
+
{"version":3,"file":"resolver.js","sources":["../../../../../../packages/utils/src/vue/resolver.ts"],"sourcesContent":["import type { ComponentResolver } from 'unplugin-vue-components';\nimport type { ProxyOptions } from 'vite';\nimport * as http from 'node:http';\n\nexport function kebabCase(key: string) {\n const result = key.replace(/([A-Z])/g, ' $1').trim();\n return result.split(' ').join('-').toLowerCase();\n}\nexport const GiimeResolver = (): ComponentResolver[] => {\n return [\n {\n type: 'component',\n resolve: async (name: string) => {\n if (!name.match(/^Gm[A-Z]/)) return;\n // const partialName = kebabCase(name.slice(2));\n // where `componentName` is always CapitalCase\n return { name, from: 'giime' };\n },\n },\n {\n type: 'directive',\n resolve: async () => {\n return;\n },\n },\n ];\n};\nexport interface GiimeBypassOptions {\n showLog?: boolean;\n}\n\n/**\n * webpack-dev-server style bypass function\n */\nexport const bypass = (\n req: http.IncomingMessage,\n /** undefined for WebSocket upgrade requests */\n res: http.ServerResponse | undefined,\n options: ProxyOptions,\n giimeOptions?: GiimeBypassOptions,\n) => {\n // 获取请求路径,处理后缀斜杠的问题\n const targetPath = new URL(options.target?.toString() ?? '').pathname.replace(/\\/$/, '');\n // 使用 rewrite 函数处理请求路径,并处理后缀斜杠的问题\n const rewrittenPath = options.rewrite?.(req.url!) ?? '';\n // 合并路径\n const fullPath = `${targetPath}${rewrittenPath}`;\n\n // 构造完整的代理 URL\n const proxyUrl = new URL(fullPath, options.target?.toString());\n\n if (giimeOptions?.showLog) {\n console.log('proxyUrl', proxyUrl.toString());\n }\n // 设置响应头\n res?.setHeader('x-giime-proxy-url', proxyUrl.toString());\n};\n"],"names":[],"mappings":";;AAIO,SAAS,UAAU,GAAa,EAAA;AACrC,EAAA,MAAM,SAAS,GAAI,CAAA,OAAA,CAAQ,UAAY,EAAA,KAAK,EAAE,IAAK,EAAA,CAAA;AACnD,EAAA,OAAO,OAAO,KAAM,CAAA,GAAG,EAAE,IAAK,CAAA,GAAG,EAAE,WAAY,EAAA,CAAA;AACjD,CAAA;AACO,MAAM,gBAAgB,MAA2B;AACtD,EAAO,OAAA;AAAA,IACL;AAAA,MACE,IAAM,EAAA,WAAA;AAAA,MACN,OAAA,EAAS,OAAO,IAAiB,KAAA;AAC/B,QAAI,IAAA,CAAC,IAAK,CAAA,KAAA,CAAM,UAAU,CAAA;AAAG,UAAA,OAAA;AAG7B,QAAO,OAAA,EAAE,IAAM,EAAA,IAAA,EAAM,OAAQ,EAAA,CAAA;AAAA,OAC/B;AAAA,KACF;AAAA,IACA;AAAA,MACE,IAAM,EAAA,WAAA;AAAA,MACN,SAAS,YAAY;AACnB,QAAA,OAAA;AAAA,OACF;AAAA,KACF;AAAA,GACF,CAAA;AACF,EAAA;AAQO,MAAM,MAAS,GAAA,CACpB,GAEA,EAAA,GAAA,EACA,SACA,YACG,KAAA;AAEH,EAAA,MAAM,UAAa,GAAA,IAAI,GAAI,CAAA,OAAA,CAAQ,MAAQ,EAAA,QAAA,EAAc,IAAA,EAAE,CAAE,CAAA,QAAA,CAAS,OAAQ,CAAA,KAAA,EAAO,EAAE,CAAA,CAAA;AAEvF,EAAA,MAAM,aAAgB,GAAA,OAAA,CAAQ,OAAU,GAAA,GAAA,CAAI,GAAI,CAAK,IAAA,EAAA,CAAA;AAErD,EAAA,MAAM,QAAW,GAAA,CAAA,EAAG,UAAU,CAAA,EAAG,aAAa,CAAA,CAAA,CAAA;AAG9C,EAAA,MAAM,WAAW,IAAI,GAAA,CAAI,UAAU,OAAQ,CAAA,MAAA,EAAQ,UAAU,CAAA,CAAA;AAE7D,EAAA,IAAI,cAAc,OAAS,EAAA;AACzB,IAAA,OAAA,CAAQ,GAAI,CAAA,UAAA,EAAY,QAAS,CAAA,QAAA,EAAU,CAAA,CAAA;AAAA,GAC7C;AAEA,EAAA,GAAA,EAAK,SAAU,CAAA,mBAAA,EAAqB,QAAS,CAAA,QAAA,EAAU,CAAA,CAAA;AACzD;;;;;;"}
|