nvue3 1.1.31 → 1.1.33

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/http.js +14 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nvue3",
3
- "version": "1.1.31",
3
+ "version": "1.1.33",
4
4
  "description": "for uniapp & vue3",
5
5
  "main": "src/kernel.js",
6
6
  "scripts": {
package/src/http.js CHANGED
@@ -75,21 +75,21 @@ const _request = class {
75
75
  return;
76
76
  }
77
77
 
78
- if (uri[0] === '!') { //uri第1个字符为!,静默处理
79
- this.silent = true;
80
- uri = uri.slice(1);
81
- }
82
-
83
- if (uri[0] === '@') { //uri第1个字符为@,不进行频率检查
84
- uri = uri.slice(1);
85
- }
86
-
87
78
  if (uri[0] !== '/') { //uri第1个字符为toast,提取出来
88
- this.toast = toastConf[uri[0]] || '';
89
- uri = uri.slice(1);
79
+ this.uri = uri.slice(1);
80
+ this.toast = uri[0];
81
+ if (toastConf[this.toast]) {
82
+ this.toast = toastConf[this.toast];
83
+ }
84
+ else {
85
+ this.silent = true;
86
+ }
87
+ }
88
+ else {
89
+ this.uri = uri;
90
90
  }
91
91
 
92
- this.uri = apiAlias(uri);
92
+ // this.uri = apiAlias(this.uri);
93
93
  this.gateway = config.path;
94
94
  this.api = config.path + this.uri;
95
95
  }
@@ -100,11 +100,11 @@ const _request = class {
100
100
  method = 'POST';
101
101
  code = 0;
102
102
  message = '';
103
+ toast = '';
103
104
  silent = false; // 直接返回
104
105
  loading = false;
105
106
  encode = 'json';
106
107
  timeout = config.timeout;
107
- toast = '';
108
108
  header = {
109
109
  put: {}, //发出的head
110
110
  get: {}, //收到的head
@@ -199,7 +199,7 @@ function failMessage(RFM, resolve, reject) {
199
199
  }
200
200
 
201
201
  if (RFM.response.toast) {
202
- const { timeout, icon } = RFM.response.toast;
202
+ const { timeout, icon } = RFM.response;
203
203
  uni.showToast({
204
204
  duration: parseInt(timeout || 3000),
205
205
  title: RFM.message,