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

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.514",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -401,12 +401,43 @@ 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
+ },
415
+ });
416
+ } else if (path.indexOf("token={token}") >= 0) {
405
417
  path = path.replace("token={token}", "token=" + getToken());
406
418
  }
407
419
  window.open(path);
408
420
  }
409
421
  },
422
+ getCustomReqUrlAndCleanUrl(url) {
423
+ // 直接使用正则表达式匹配
424
+ const match = url.match(/[?&]custom_req_url=([^&?#]+)/);
425
+ if (match) {
426
+ const customReqUrl = decodeURIComponent(match[1]);
427
+ // 移除匹配到的参数部分
428
+ const newUrl = url.replace(match[0], match[0].startsWith("?") ? "?" : "");
429
+
430
+ return {
431
+ custom_req_url: customReqUrl,
432
+ newUrl: newUrl.replace(/\?$/, "").replace(/\?&/, "?"),
433
+ };
434
+ }
435
+
436
+ return {
437
+ custom_req_url: "",
438
+ newUrl: url,
439
+ };
440
+ },
410
441
  changeModules(row, cRow) {
411
442
  if (!row.route) return;
412
443
  localStorage.setItem("currentMenuId", row.id);