cloud-web-corejs 1.0.54-dev.513 → 1.0.54-dev.515

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,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.54-dev.513",
4
+ "version": "1.0.54-dev.515",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -401,12 +401,44 @@ export default {
401
401
  jumpOutLink(route) {
402
402
  let path = route.url || route.path;
403
403
  if (route.type == 4 && path) {
404
- if (path.indexOf("token={token}") >= 0) {
404
+ let params = this.getCustomReqUrlAndCleanUrl(path);
405
+ let reqUrl = params.custom_req_url;
406
+ if (reqUrl) {
407
+ this.$http({
408
+ url: reqUrl,
409
+ method: `post`,
410
+ data: { thirdUrl: params.newUrl },
411
+ isLoading: true,
412
+ success: (res) => {
413
+ path = res.objx;
414
+ window.open(path);
415
+ },
416
+ });
417
+ } else if (path.indexOf("token={token}") >= 0) {
405
418
  path = path.replace("token={token}", "token=" + getToken());
419
+ window.open(path);
406
420
  }
407
- window.open(path);
408
421
  }
409
422
  },
423
+ getCustomReqUrlAndCleanUrl(url) {
424
+ // 直接使用正则表达式匹配
425
+ const match = url.match(/[?&]custom_req_url=([^&?#]+)/);
426
+ if (match) {
427
+ const customReqUrl = decodeURIComponent(match[1]);
428
+ // 移除匹配到的参数部分
429
+ const newUrl = url.replace(match[0], match[0].startsWith("?") ? "?" : "");
430
+
431
+ return {
432
+ custom_req_url: customReqUrl,
433
+ newUrl: newUrl.replace(/\?$/, "").replace(/\?&/, "?"),
434
+ };
435
+ }
436
+
437
+ return {
438
+ custom_req_url: "",
439
+ newUrl: url,
440
+ };
441
+ },
410
442
  changeModules(row, cRow) {
411
443
  if (!row.route) return;
412
444
  localStorage.setItem("currentMenuId", row.id);