@mu-cabin/opms-permission 0.8.1 → 0.8.2

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.cjs CHANGED
@@ -206,9 +206,12 @@ axiosClient.interceptors.request.use((config) => {
206
206
  axiosClient.interceptors.response.use(
207
207
  (response) => {
208
208
  const res = response.data;
209
- const { code, msg } = res;
210
- if (code !== 200) {
211
- throw new Error(msg);
209
+ const { success, code, msg } = res;
210
+ if (!success) {
211
+ return Promise.reject({
212
+ code,
213
+ msg
214
+ });
212
215
  }
213
216
  return res;
214
217
  },
package/dist/index.mjs CHANGED
@@ -168,9 +168,12 @@ axiosClient.interceptors.request.use((config) => {
168
168
  axiosClient.interceptors.response.use(
169
169
  (response) => {
170
170
  const res = response.data;
171
- const { code, msg } = res;
172
- if (code !== 200) {
173
- throw new Error(msg);
171
+ const { success, code, msg } = res;
172
+ if (!success) {
173
+ return Promise.reject({
174
+ code,
175
+ msg
176
+ });
174
177
  }
175
178
  return res;
176
179
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mu-cabin/opms-permission",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "Frontend SDK for OPMS permission and auth management.",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",