{"id":17521,"date":"2025-04-19T00:03:02","date_gmt":"2025-04-18T16:03:02","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/17521.html"},"modified":"2025-04-19T00:03:02","modified_gmt":"2025-04-18T16:03:02","slug":"%e4%b8%80%e8%a1%8c%e4%bb%a3%e7%a0%81%e8%a7%a3%e5%86%b3vue3%e5%89%8d%e7%ab%af%e6%89%93%e5%8c%85%e9%83%a8%e7%bd%b2%e5%88%b0%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%8c%e5%8a%a8%e6%80%81%e9%85%8d%e7%bd%aehttp","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/17521.html","title":{"rendered":"\u4e00\u884c\u4ee3\u7801\u89e3\u51b3vue3\u524d\u7aef\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668\uff0c\u52a8\u6001\u914d\u7f6ehttp\u8bf7\u6c42\u5934\u540e\u7aefip\u65b9\u6cd5\u6559\u7a0b\u65e0bug"},"content":{"rendered":"<p><span style=\"color:#be191c\">\u53ea\u9700\u8981\u4e00\u884c\u4ee3\u7801<\/span><\/p>\n<p>vue3\u82e5\u4f9d\u6846\u67b6\u524d\u7aef\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668&#xff0c;\u9700\u8981\u90e8\u7f72\u5230\u591a\u4e2a\u670d\u52a1\u5668\u4e0a&#xff0c;\u6bcf\u6b21\u6253\u5305\u4f1a\u5f88\u9ebb\u70e6&#xff0c;\u4eca\u5929\u6559\u5927\u5bb6\u4e00\u4e2a\u7b80\u5355\u7684\u52a8\u6001\u914d\u7f6e\u8bf7\u6c42\u5934api\u7684\u65b9\u6cd5&#xff0c;\u90e8\u7f72\u540e\u80fd\u52a8\u6001\u83b7\u53d6(\u4fee\u6539)\u5bf9\u5e94\u670d\u52a1\u5668\u7684\u8bf7\u6c42ip&#xff0c;<\/p>\n<p>\u4ecb\u7ecd\u4e24\u79cd\u65b9\u6cd5&#xff0c;\u5982\u6709\u9700\u8981\u53ef\u4ee5\u76f4\u63a5\u5c1d\u8bd5\u6b65\u9aa4\u4e00&#xff0c;\u4e0d\u884c\u518d\u7528\u6b65\u9aa4\u4e8c<\/p>\n<h2>\u65b9\u6cd5\u4e00 \u3001<\/h2>\n<p>\u53ea\u9700\u8981\u5728request\u4e2d\u83b7\u53d6\u5730\u5740\u680f\u7684\u4fe1\u606f&#xff0c;\u4e0d\u7528\u65b0\u5efa\u6587\u4ef6<\/p>\n<p>\u83b7\u53d6\u5730\u5740\u680f\u7684http\u8bf7\u6c42\u5934<\/p>\n<p>var baseUrlDt &#061;<br \/>\n  window.location.protocol &#043; &#034;\/\/&#034; &#043; window.location.hostname &#043; &#034;:8010&#034;;<br \/>\nlet downloadLoadingInstance; \/\/ \u52a8\u6001ip\u6253\u5305\u65f6\u4f7f\u7528\u8fd9\u6761\u4ee3\u7801 <\/p>\n<h2><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"846\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418160258-680277b25a2f9.png\" width=\"1200\" \/><\/h2>\n<p>request.js\u5168\u90e8\u4ee3\u7801&#xff1a;<\/p>\n<p>import axios from &#034;axios&#034;;<br \/>\nimport {<br \/>\n  ElNotification,<br \/>\n  ElMessageBox,<br \/>\n  ElMessage,<br \/>\n  ElLoading,<br \/>\n} from &#034;element-plus&#034;;<br \/>\nimport { getToken } from &#034;&#064;\/utils\/auth&#034;;<br \/>\nimport errorCode from &#034;&#064;\/utils\/errorCode&#034;;<br \/>\nimport { tansParams, blobValidate } from &#034;&#064;\/utils\/ruoyi&#034;;<br \/>\nimport cache from &#034;&#064;\/plugins\/cache&#034;;<br \/>\nimport { saveAs } from &#034;file-saver&#034;;<br \/>\nimport useUserStore from &#034;&#064;\/store\/modules\/user&#034;;<\/p>\n<p>var baseUrlDt &#061;<br \/>\n  window.location.protocol &#043; &#034;\/\/&#034; &#043; window.location.hostname &#043; &#034;:8010&#034;;<br \/>\nlet downloadLoadingInstance; \/\/ \u52a8\u6001ip\u6253\u5305\u65f6\u4f7f\u7528\u8fd9\u6761\u4ee3\u7801<\/p>\n<p>\/\/ \u662f\u5426\u663e\u793a\u91cd\u65b0\u767b\u5f55<br \/>\nexport let isRelogin &#061; { show: false };<\/p>\n<p>axios.defaults.headers[&#034;Content-Type&#034;] &#061; &#034;application\/json;charset&#061;utf-8&#034;;<br \/>\n\/\/ \u521b\u5efaaxios\u5b9e\u4f8b<br \/>\nconst service &#061; axios.create({<br \/>\n  \/\/ axios\u4e2d\u8bf7\u6c42\u914d\u7f6e\u6709baseURL\u9009\u9879&#xff0c;\u8868\u793a\u8bf7\u6c42URL\u516c\u5171\u90e8\u5206<br \/>\n  \/\/ baseURL: import.meta.env.VITE_APP_BASE_API,<\/p>\n<p>  baseURL: baseUrlDt, \/\/ \u52a8\u6001ip\u6253\u5305\u65f6\u4f7f\u7528\u8fd9\u6761\u4ee3\u7801<\/p>\n<p>  \/\/ \u8d85\u65f6<br \/>\n  timeout: 10000,<br \/>\n});<\/p>\n<p>\/\/ request\u62e6\u622a\u5668<br \/>\nservice.interceptors.request.use(<br \/>\n  (config) &#061;&gt; {<br \/>\n    \/\/ \u662f\u5426\u9700\u8981\u8bbe\u7f6e token<br \/>\n    const isToken &#061; (config.headers || {}).isToken &#061;&#061;&#061; false;<br \/>\n    \/\/ \u662f\u5426\u9700\u8981\u9632\u6b62\u6570\u636e\u91cd\u590d\u63d0\u4ea4<br \/>\n    const isRepeatSubmit &#061; (config.headers || {}).repeatSubmit &#061;&#061;&#061; false;<br \/>\n    if (getToken() &amp;&amp; !isToken) {<br \/>\n      config.headers[&#034;Authorization&#034;] &#061; &#034;Bearer &#034; &#043; getToken(); \/\/ \u8ba9\u6bcf\u4e2a\u8bf7\u6c42\u643a\u5e26\u81ea\u5b9a\u4e49token \u8bf7\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u81ea\u884c\u4fee\u6539<br \/>\n    }<br \/>\n    \/\/ get\u8bf7\u6c42\u6620\u5c04params\u53c2\u6570<br \/>\n    if (config.method &#061;&#061;&#061; &#034;get&#034; &amp;&amp; config.params) {<br \/>\n      let url &#061; config.url &#043; &#034;?&#034; &#043; tansParams(config.params);<br \/>\n      url &#061; url.slice(0, -1);<br \/>\n      config.params &#061; {};<br \/>\n      config.url &#061; url;<br \/>\n    }<br \/>\n    if (<br \/>\n      !isRepeatSubmit &amp;&amp;<br \/>\n      (config.method &#061;&#061;&#061; &#034;post&#034; || config.method &#061;&#061;&#061; &#034;put&#034;)<br \/>\n    ) {<br \/>\n      const requestObj &#061; {<br \/>\n        url: config.url,<br \/>\n        data:<br \/>\n          typeof config.data &#061;&#061;&#061; &#034;object&#034;<br \/>\n            ? JSON.stringify(config.data)<br \/>\n            : config.data,<br \/>\n        time: new Date().getTime(),<br \/>\n      };<br \/>\n      const requestSize &#061; Object.keys(JSON.stringify(requestObj)).length; \/\/ \u8bf7\u6c42\u6570\u636e\u5927\u5c0f<br \/>\n      const limitSize &#061; 5 * 1024 * 1024; \/\/ \u9650\u5236\u5b58\u653e\u6570\u636e5M<br \/>\n      if (requestSize &gt;&#061; limitSize) {<br \/>\n        console.warn(<br \/>\n          &#096;[${config.url}]: &#096; &#043;<br \/>\n            &#034;\u8bf7\u6c42\u6570\u636e\u5927\u5c0f\u8d85\u51fa\u5141\u8bb8\u76845M\u9650\u5236&#xff0c;\u65e0\u6cd5\u8fdb\u884c\u9632\u91cd\u590d\u63d0\u4ea4\u9a8c\u8bc1\u3002&#034;<br \/>\n        );<br \/>\n        return config;<br \/>\n      }<br \/>\n      const sessionObj &#061; cache.session.getJSON(&#034;sessionObj&#034;);<br \/>\n      if (<br \/>\n        sessionObj &#061;&#061;&#061; undefined ||<br \/>\n        sessionObj &#061;&#061;&#061; null ||<br \/>\n        sessionObj &#061;&#061;&#061; &#034;&#034;<br \/>\n      ) {<br \/>\n        cache.session.setJSON(&#034;sessionObj&#034;, requestObj);<br \/>\n      } else {<br \/>\n        const s_url &#061; sessionObj.url; \/\/ \u8bf7\u6c42\u5730\u5740<br \/>\n        const s_data &#061; sessionObj.data; \/\/ \u8bf7\u6c42\u6570\u636e<br \/>\n        const s_time &#061; sessionObj.time; \/\/ \u8bf7\u6c42\u65f6\u95f4<br \/>\n        const interval &#061; 1000; \/\/ \u95f4\u9694\u65f6\u95f4(ms)&#xff0c;\u5c0f\u4e8e\u6b64\u65f6\u95f4\u89c6\u4e3a\u91cd\u590d\u63d0\u4ea4<br \/>\n        if (<br \/>\n          s_data &#061;&#061;&#061; requestObj.data &amp;&amp;<br \/>\n          requestObj.time &#8211; s_time &lt; interval &amp;&amp;<br \/>\n          s_url &#061;&#061;&#061; requestObj.url<br \/>\n        ) {<br \/>\n          const message &#061; &#034;\u6570\u636e\u6b63\u5728\u5904\u7406&#xff0c;\u8bf7\u52ff\u91cd\u590d\u63d0\u4ea4&#034;;<br \/>\n          console.warn(&#096;[${s_url}]: &#096; &#043; message);<br \/>\n          return Promise.reject(new Error(message));<br \/>\n        } else {<br \/>\n          cache.session.setJSON(&#034;sessionObj&#034;, requestObj);<br \/>\n        }<br \/>\n      }<br \/>\n    }<br \/>\n    return config;<br \/>\n  },<br \/>\n  (error) &#061;&gt; {<br \/>\n    console.log(error);<br \/>\n    Promise.reject(error);<br \/>\n  }<br \/>\n);<\/p>\n<p>\/\/ \u54cd\u5e94\u62e6\u622a\u5668<br \/>\nservice.interceptors.response.use(<br \/>\n  (res) &#061;&gt; {<br \/>\n    \/\/ \u672a\u8bbe\u7f6e\u72b6\u6001\u7801\u5219\u9ed8\u8ba4\u6210\u529f\u72b6\u6001<br \/>\n    const code &#061; res.data.code || 200;<br \/>\n    \/\/ \u83b7\u53d6\u9519\u8bef\u4fe1\u606f<br \/>\n    const msg &#061; errorCode[code] || res.data.msg || errorCode[&#034;default&#034;];<br \/>\n    \/\/ \u4e8c\u8fdb\u5236\u6570\u636e\u5219\u76f4\u63a5\u8fd4\u56de<br \/>\n    if (<br \/>\n      res.request.responseType &#061;&#061;&#061; &#034;blob&#034; ||<br \/>\n      res.request.responseType &#061;&#061;&#061; &#034;arraybuffer&#034;<br \/>\n    ) {<br \/>\n      return res.data;<br \/>\n    }<br \/>\n    if (code &#061;&#061;&#061; 401) {<br \/>\n      if (!isRelogin.show) {<br \/>\n        isRelogin.show &#061; true;<br \/>\n        ElMessageBox.confirm(<br \/>\n          &#034;\u767b\u5f55\u72b6\u6001\u5df2\u8fc7\u671f&#xff0c;\u60a8\u53ef\u4ee5\u7ee7\u7eed\u7559\u5728\u8be5\u9875\u9762&#xff0c;\u6216\u8005\u91cd\u65b0\u767b\u5f55&#034;,<br \/>\n          &#034;\u7cfb\u7edf\u63d0\u793a&#034;,<br \/>\n          {<br \/>\n            confirmButtonText: &#034;\u91cd\u65b0\u767b\u5f55&#034;,<br \/>\n            cancelButtonText: &#034;\u53d6\u6d88&#034;,<br \/>\n            type: &#034;warning&#034;,<br \/>\n          }<br \/>\n        )<br \/>\n          .then(() &#061;&gt; {<br \/>\n            isRelogin.show &#061; false;<br \/>\n            useUserStore()<br \/>\n              .logOut()<br \/>\n              .then(() &#061;&gt; {<br \/>\n                location.href &#061; &#034;\/index&#034;;<br \/>\n              });<br \/>\n          })<br \/>\n          .catch(() &#061;&gt; {<br \/>\n            isRelogin.show &#061; false;<br \/>\n          });<br \/>\n      }<br \/>\n      return Promise.reject(&#034;\u65e0\u6548\u7684\u4f1a\u8bdd&#xff0c;\u6216\u8005\u4f1a\u8bdd\u5df2\u8fc7\u671f&#xff0c;\u8bf7\u91cd\u65b0\u767b\u5f55\u3002&#034;);<br \/>\n    } else if (code &#061;&#061;&#061; 500) {<br \/>\n      ElMessage({ message: msg, type: &#034;error&#034; });<br \/>\n      return Promise.reject(new Error(msg));<br \/>\n    } else if (code &#061;&#061;&#061; 601) {<br \/>\n      ElMessage({ message: msg, type: &#034;warning&#034; });<br \/>\n      return Promise.reject(new Error(msg));<br \/>\n    } else if (code !&#061;&#061; 200) {<br \/>\n      ElNotification.error({ title: msg });<br \/>\n      return Promise.reject(&#034;error&#034;);<br \/>\n    } else {<br \/>\n      return Promise.resolve(res.data);<br \/>\n    }<br \/>\n  },<br \/>\n  (error) &#061;&gt; {<br \/>\n    console.log(&#034;err&#034; &#043; error);<br \/>\n    let { message } &#061; error;<br \/>\n    if (message &#061;&#061; &#034;Network Error&#034;) {<br \/>\n      message &#061; &#034;\u540e\u7aef\u63a5\u53e3\u8fde\u63a5\u5f02\u5e38&#034;;<br \/>\n    } else if (message.includes(&#034;timeout&#034;)) {<br \/>\n      message &#061; &#034;\u7cfb\u7edf\u63a5\u53e3\u8bf7\u6c42\u8d85\u65f6&#034;;<br \/>\n    } else if (message.includes(&#034;Request failed with status code&#034;)) {<br \/>\n      message &#061; &#034;\u7cfb\u7edf\u63a5\u53e3&#034; &#043; message.substr(message.length &#8211; 3) &#043; &#034;\u5f02\u5e38&#034;;<br \/>\n    }<br \/>\n    ElMessage({ message: message, type: &#034;error&#034;, duration: 5 * 1000 });<br \/>\n    return Promise.reject(error);<br \/>\n  }<br \/>\n);<\/p>\n<p>\/\/ \u901a\u7528\u4e0b\u8f7d\u65b9\u6cd5<br \/>\nexport function download(url, params, filename, config) {<br \/>\n  downloadLoadingInstance &#061; ElLoading.service({<br \/>\n    text: &#034;\u6b63\u5728\u4e0b\u8f7d\u6570\u636e&#xff0c;\u8bf7\u7a0d\u5019&#034;,<br \/>\n    background: &#034;rgba(0, 0, 0, 0.7)&#034;,<br \/>\n  });<br \/>\n  return service<br \/>\n    .post(url, params, {<br \/>\n      transformRequest: [<br \/>\n        (params) &#061;&gt; {<br \/>\n          return tansParams(params);<br \/>\n        },<br \/>\n      ],<br \/>\n      headers: { &#034;Content-Type&#034;: &#034;application\/x-www-form-urlencoded&#034; },<br \/>\n      responseType: &#034;blob&#034;,<br \/>\n      &#8230;config,<br \/>\n    })<br \/>\n    .then(async (data) &#061;&gt; {<br \/>\n      const isBlob &#061; blobValidate(data);<br \/>\n      if (isBlob) {<br \/>\n        const blob &#061; new Blob([data]);<br \/>\n        saveAs(blob, filename);<br \/>\n      } else {<br \/>\n        const resText &#061; await data.text();<br \/>\n        const rspObj &#061; JSON.parse(resText);<br \/>\n        const errMsg &#061;<br \/>\n          errorCode[rspObj.code] || rspObj.msg || errorCode[&#034;default&#034;];<br \/>\n        ElMessage.error(errMsg);<br \/>\n      }<br \/>\n      downloadLoadingInstance.close();<br \/>\n    })<br \/>\n    .catch((r) &#061;&gt; {<br \/>\n      console.error(r);<br \/>\n      ElMessage.error(&#034;\u4e0b\u8f7d\u6587\u4ef6\u51fa\u73b0\u9519\u8bef&#xff0c;\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458&#xff01;&#034;);<br \/>\n      downloadLoadingInstance.close();<br \/>\n    });<br \/>\n}<\/p>\n<p>export default service;<\/p>\n<h2>\u65b9\u6cd5\u4e8c\u3001<\/h2>\n<p>\u539f\u7406&#xff1a;\u6253\u5305\u7684\u65f6\u5019\u5c06\u52a8\u6001\u7684ip\u6392\u9664\u5728\u6253\u5305\u5916,\u4e0d\u53c2\u4e0e\u6253\u5305,\u7c7b\u4f3c\u4e8epublic\u6587\u4ef6\u5939\u4e0b\u7684index.html<\/p>\n<h3>\u6b65\u9aa4\u4e00\u3001<\/h3>\n<p>\u5728public\u6587\u4ef6\u5939\u4e0b\u65b0\u5efaconfig.js\u6587\u4ef6&#xff0c;\u6709\u7684\u9879\u76ee\u662fstatic\u6587\u4ef6\u5939\u4e0b<\/p>\n<p>var ipConfig &#061; {<br \/>\n    AXIOS_TIMEOUT: 10000,<br \/>\n    baseUrl: &#034;http:\/\/xxx&#034;,\/\/\u914d\u7f6e\u670d\u52a1\u5668IP\u53ca\u7aef\u53e3<br \/>\n  } <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"726\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418160259-680277b337c38.png\" width=\"1200\" \/><\/p>\n<h3>\u6b65\u9aa4\u4e8c\u3001<\/h3>\n<p>\u5728\u6839\u76ee\u5f55\u7684index.html\u5f15\u5165\u65b0\u589econfig.js&#xff0c;\u5728\u9879\u76ee\u4e2d\u5c31\u53ef\u4ee5\u4f7f\u7528\u4e86\u00a0<\/p>\n<p>    &lt;!&#8211; \u52a8\u6001ip\u6253\u5305\u65f6\u4f7f\u7528\u8fd9\u6761\u4ee3\u7801 &#8211;&gt;<br \/>\n    &lt;script type&#061;&#034;text\/javascript&#034; src&#061;&#034;\/public\/config.js&#034;&gt;&lt;\/script&gt; <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1092\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418160259-680277b39ccd3.png\" width=\"1200\" \/><\/p>\n<h3>\u6b65\u9aa4\u4e09\u3001<\/h3>\n<p>\u627e\u5230request.js\u6587\u4ef6&#xff0c;\u5728\u62e6\u622a\u5668\u4e2d\u76f4\u63a5\u8c03\u7528\u5bf9\u8c61<\/p>\n<p>const baseURL &#061; window.ipConfig.baseUrl; \/\/ \u52a8\u6001ip\u6253\u5305\u65f6\u4f7f\u7528\u8fd9\u6761\u4ee3\u7801 <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1111\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418160300-680277b49f2a1.png\" width=\"1200\" \/><\/p>\n<p>request.js\u5168\u90e8\u4ee3\u7801&#xff1a;<\/p>\n<p>import axios from &#034;axios&#034;;<br \/>\nimport {<br \/>\n  ElNotification,<br \/>\n  ElMessageBox,<br \/>\n  ElMessage,<br \/>\n  ElLoading,<br \/>\n} from &#034;element-plus&#034;;<br \/>\nimport { getToken } from &#034;&#064;\/utils\/auth&#034;;<br \/>\nimport errorCode from &#034;&#064;\/utils\/errorCode&#034;;<br \/>\nimport { tansParams, blobValidate } from &#034;&#064;\/utils\/ruoyi&#034;;<br \/>\nimport cache from &#034;&#064;\/plugins\/cache&#034;;<br \/>\nimport { saveAs } from &#034;file-saver&#034;;<br \/>\nimport useUserStore from &#034;&#064;\/store\/modules\/user&#034;;<\/p>\n<p>\/\/ axios.defaults.baseURL &#061; window.ipConfig.BASE_URL\/\/&#039;http:\/\/192.168.1.177:8083\/&#039;<br \/>\n\/\/ \/\/ \u5f00\u542f\u8ba4\u8bc1<br \/>\n\/\/ axios.defaults.withCredentials &#061; true<br \/>\nconst baseURL &#061; window.ipConfig.baseUrl; \/\/ \u52a8\u6001ip\u6253\u5305\u65f6\u4f7f\u7528\u8fd9\u6761\u4ee3\u7801<br \/>\nlet downloadLoadingInstance;<br \/>\n\/\/ \u662f\u5426\u663e\u793a\u91cd\u65b0\u767b\u5f55<br \/>\nexport let isRelogin &#061; { show: false };<\/p>\n<p>axios.defaults.headers[&#034;Content-Type&#034;] &#061; &#034;application\/json;charset&#061;utf-8&#034;;<br \/>\n\/\/ \u521b\u5efaaxios\u5b9e\u4f8b<br \/>\nconst service &#061; axios.create({<br \/>\n  \/\/ axios\u4e2d\u8bf7\u6c42\u914d\u7f6e\u6709baseURL\u9009\u9879&#xff0c;\u8868\u793a\u8bf7\u6c42URL\u516c\u5171\u90e8\u5206<br \/>\n  \/\/ baseURL: import.meta.env.VITE_APP_BASE_API,<br \/>\n  baseURL: baseURL, \/\/ \u52a8\u6001ip\u6253\u5305\u65f6\u4f7f\u7528\u8fd9\u6761\u4ee3\u7801<br \/>\n  \/\/ \u8d85\u65f6<br \/>\n  timeout: 10000,<br \/>\n});<\/p>\n<p>\/\/ request\u62e6\u622a\u5668<br \/>\nservice.interceptors.request.use(<br \/>\n  (config) &#061;&gt; {<br \/>\n    \/\/ \u662f\u5426\u9700\u8981\u8bbe\u7f6e token<br \/>\n    const isToken &#061; (config.headers || {}).isToken &#061;&#061;&#061; false;<br \/>\n    \/\/ \u662f\u5426\u9700\u8981\u9632\u6b62\u6570\u636e\u91cd\u590d\u63d0\u4ea4<br \/>\n    const isRepeatSubmit &#061; (config.headers || {}).repeatSubmit &#061;&#061;&#061; false;<br \/>\n    if (getToken() &amp;&amp; !isToken) {<br \/>\n      config.headers[&#034;Authorization&#034;] &#061; &#034;Bearer &#034; &#043; getToken(); \/\/ \u8ba9\u6bcf\u4e2a\u8bf7\u6c42\u643a\u5e26\u81ea\u5b9a\u4e49token \u8bf7\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u81ea\u884c\u4fee\u6539<br \/>\n    }<br \/>\n    \/\/ get\u8bf7\u6c42\u6620\u5c04params\u53c2\u6570<br \/>\n    if (config.method &#061;&#061;&#061; &#034;get&#034; &amp;&amp; config.params) {<br \/>\n      let url &#061; config.url &#043; &#034;?&#034; &#043; tansParams(config.params);<br \/>\n      url &#061; url.slice(0, -1);<br \/>\n      config.params &#061; {};<br \/>\n      config.url &#061; url;<br \/>\n    }<br \/>\n    if (<br \/>\n      !isRepeatSubmit &amp;&amp;<br \/>\n      (config.method &#061;&#061;&#061; &#034;post&#034; || config.method &#061;&#061;&#061; &#034;put&#034;)<br \/>\n    ) {<br \/>\n      const requestObj &#061; {<br \/>\n        url: config.url,<br \/>\n        data:<br \/>\n          typeof config.data &#061;&#061;&#061; &#034;object&#034;<br \/>\n            ? JSON.stringify(config.data)<br \/>\n            : config.data,<br \/>\n        time: new Date().getTime(),<br \/>\n      };<br \/>\n      const requestSize &#061; Object.keys(JSON.stringify(requestObj)).length; \/\/ \u8bf7\u6c42\u6570\u636e\u5927\u5c0f<br \/>\n      const limitSize &#061; 5 * 1024 * 1024; \/\/ \u9650\u5236\u5b58\u653e\u6570\u636e5M<br \/>\n      if (requestSize &gt;&#061; limitSize) {<br \/>\n        console.warn(<br \/>\n          &#096;[${config.url}]: &#096; &#043;<br \/>\n            &#034;\u8bf7\u6c42\u6570\u636e\u5927\u5c0f\u8d85\u51fa\u5141\u8bb8\u76845M\u9650\u5236&#xff0c;\u65e0\u6cd5\u8fdb\u884c\u9632\u91cd\u590d\u63d0\u4ea4\u9a8c\u8bc1\u3002&#034;<br \/>\n        );<br \/>\n        return config;<br \/>\n      }<br \/>\n      const sessionObj &#061; cache.session.getJSON(&#034;sessionObj&#034;);<br \/>\n      if (<br \/>\n        sessionObj &#061;&#061;&#061; undefined ||<br \/>\n        sessionObj &#061;&#061;&#061; null ||<br \/>\n        sessionObj &#061;&#061;&#061; &#034;&#034;<br \/>\n      ) {<br \/>\n        cache.session.setJSON(&#034;sessionObj&#034;, requestObj);<br \/>\n      } else {<br \/>\n        const s_url &#061; sessionObj.url; \/\/ \u8bf7\u6c42\u5730\u5740<br \/>\n        const s_data &#061; sessionObj.data; \/\/ \u8bf7\u6c42\u6570\u636e<br \/>\n        const s_time &#061; sessionObj.time; \/\/ \u8bf7\u6c42\u65f6\u95f4<br \/>\n        const interval &#061; 1000; \/\/ \u95f4\u9694\u65f6\u95f4(ms)&#xff0c;\u5c0f\u4e8e\u6b64\u65f6\u95f4\u89c6\u4e3a\u91cd\u590d\u63d0\u4ea4<br \/>\n        if (<br \/>\n          s_data &#061;&#061;&#061; requestObj.data &amp;&amp;<br \/>\n          requestObj.time &#8211; s_time &lt; interval &amp;&amp;<br \/>\n          s_url &#061;&#061;&#061; requestObj.url<br \/>\n        ) {<br \/>\n          const message &#061; &#034;\u6570\u636e\u6b63\u5728\u5904\u7406&#xff0c;\u8bf7\u52ff\u91cd\u590d\u63d0\u4ea4&#034;;<br \/>\n          console.warn(&#096;[${s_url}]: &#096; &#043; message);<br \/>\n          return Promise.reject(new Error(message));<br \/>\n        } else {<br \/>\n          cache.session.setJSON(&#034;sessionObj&#034;, requestObj);<br \/>\n        }<br \/>\n      }<br \/>\n    }<br \/>\n    return config;<br \/>\n  },<br \/>\n  (error) &#061;&gt; {<br \/>\n    console.log(error);<br \/>\n    Promise.reject(error);<br \/>\n  }<br \/>\n);<\/p>\n<p>\/\/ \u54cd\u5e94\u62e6\u622a\u5668<br \/>\nservice.interceptors.response.use(<br \/>\n  (res) &#061;&gt; {<br \/>\n    \/\/ \u672a\u8bbe\u7f6e\u72b6\u6001\u7801\u5219\u9ed8\u8ba4\u6210\u529f\u72b6\u6001<br \/>\n    const code &#061; res.data.code || 200;<br \/>\n    \/\/ \u83b7\u53d6\u9519\u8bef\u4fe1\u606f<br \/>\n    const msg &#061; errorCode[code] || res.data.msg || errorCode[&#034;default&#034;];<br \/>\n    \/\/ \u4e8c\u8fdb\u5236\u6570\u636e\u5219\u76f4\u63a5\u8fd4\u56de<br \/>\n    if (<br \/>\n      res.request.responseType &#061;&#061;&#061; &#034;blob&#034; ||<br \/>\n      res.request.responseType &#061;&#061;&#061; &#034;arraybuffer&#034;<br \/>\n    ) {<br \/>\n      return res.data;<br \/>\n    }<br \/>\n    if (code &#061;&#061;&#061; 401) {<br \/>\n      if (!isRelogin.show) {<br \/>\n        isRelogin.show &#061; true;<br \/>\n        ElMessageBox.confirm(<br \/>\n          &#034;\u767b\u5f55\u72b6\u6001\u5df2\u8fc7\u671f&#xff0c;\u60a8\u53ef\u4ee5\u7ee7\u7eed\u7559\u5728\u8be5\u9875\u9762&#xff0c;\u6216\u8005\u91cd\u65b0\u767b\u5f55&#034;,<br \/>\n          &#034;\u7cfb\u7edf\u63d0\u793a&#034;,<br \/>\n          {<br \/>\n            confirmButtonText: &#034;\u91cd\u65b0\u767b\u5f55&#034;,<br \/>\n            cancelButtonText: &#034;\u53d6\u6d88&#034;,<br \/>\n            type: &#034;warning&#034;,<br \/>\n          }<br \/>\n        )<br \/>\n          .then(() &#061;&gt; {<br \/>\n            isRelogin.show &#061; false;<br \/>\n            useUserStore()<br \/>\n              .logOut()<br \/>\n              .then(() &#061;&gt; {<br \/>\n                location.href &#061; &#034;\/index&#034;;<br \/>\n              });<br \/>\n          })<br \/>\n          .catch(() &#061;&gt; {<br \/>\n            isRelogin.show &#061; false;<br \/>\n          });<br \/>\n      }<br \/>\n      return Promise.reject(&#034;\u65e0\u6548\u7684\u4f1a\u8bdd&#xff0c;\u6216\u8005\u4f1a\u8bdd\u5df2\u8fc7\u671f&#xff0c;\u8bf7\u91cd\u65b0\u767b\u5f55\u3002&#034;);<br \/>\n    } else if (code &#061;&#061;&#061; 500) {<br \/>\n      ElMessage({ message: msg, type: &#034;error&#034; });<br \/>\n      return Promise.reject(new Error(msg));<br \/>\n    } else if (code &#061;&#061;&#061; 601) {<br \/>\n      ElMessage({ message: msg, type: &#034;warning&#034; });<br \/>\n      return Promise.reject(new Error(msg));<br \/>\n    } else if (code !&#061;&#061; 200) {<br \/>\n      ElNotification.error({ title: msg });<br \/>\n      return Promise.reject(&#034;error&#034;);<br \/>\n    } else {<br \/>\n      return Promise.resolve(res.data);<br \/>\n    }<br \/>\n  },<br \/>\n  (error) &#061;&gt; {<br \/>\n    console.log(&#034;err&#034; &#043; error);<br \/>\n    let { message } &#061; error;<br \/>\n    if (message &#061;&#061; &#034;Network Error&#034;) {<br \/>\n      message &#061; &#034;\u540e\u7aef\u63a5\u53e3\u8fde\u63a5\u5f02\u5e38&#034;;<br \/>\n    } else if (message.includes(&#034;timeout&#034;)) {<br \/>\n      message &#061; &#034;\u7cfb\u7edf\u63a5\u53e3\u8bf7\u6c42\u8d85\u65f6&#034;;<br \/>\n    } else if (message.includes(&#034;Request failed with status code&#034;)) {<br \/>\n      message &#061; &#034;\u7cfb\u7edf\u63a5\u53e3&#034; &#043; message.substr(message.length &#8211; 3) &#043; &#034;\u5f02\u5e38&#034;;<br \/>\n    }<br \/>\n    ElMessage({ message: message, type: &#034;error&#034;, duration: 5 * 1000 });<br \/>\n    return Promise.reject(error);<br \/>\n  }<br \/>\n);<\/p>\n<p>\/\/ \u901a\u7528\u4e0b\u8f7d\u65b9\u6cd5<br \/>\nexport function download(url, params, filename, config) {<br \/>\n  downloadLoadingInstance &#061; ElLoading.service({<br \/>\n    text: &#034;\u6b63\u5728\u4e0b\u8f7d\u6570\u636e&#xff0c;\u8bf7\u7a0d\u5019&#034;,<br \/>\n    background: &#034;rgba(0, 0, 0, 0.7)&#034;,<br \/>\n  });<br \/>\n  return service<br \/>\n    .post(url, params, {<br \/>\n      transformRequest: [<br \/>\n        (params) &#061;&gt; {<br \/>\n          return tansParams(params);<br \/>\n        },<br \/>\n      ],<br \/>\n      headers: { &#034;Content-Type&#034;: &#034;application\/x-www-form-urlencoded&#034; },<br \/>\n      responseType: &#034;blob&#034;,<br \/>\n      &#8230;config,<br \/>\n    })<br \/>\n    .then(async (data) &#061;&gt; {<br \/>\n      const isBlob &#061; blobValidate(data);<br \/>\n      if (isBlob) {<br \/>\n        const blob &#061; new Blob([data]);<br \/>\n        saveAs(blob, filename);<br \/>\n      } else {<br \/>\n        const resText &#061; await data.text();<br \/>\n        const rspObj &#061; JSON.parse(resText);<br \/>\n        const errMsg &#061;<br \/>\n          errorCode[rspObj.code] || rspObj.msg || errorCode[&#034;default&#034;];<br \/>\n        ElMessage.error(errMsg);<br \/>\n      }<br \/>\n      downloadLoadingInstance.close();<br \/>\n    })<br \/>\n    .catch((r) &#061;&gt; {<br \/>\n      console.error(r);<br \/>\n      ElMessage.error(&#034;\u4e0b\u8f7d\u6587\u4ef6\u51fa\u73b0\u9519\u8bef&#xff0c;\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458&#xff01;&#034;);<br \/>\n      downloadLoadingInstance.close();<br \/>\n    });<br \/>\n}<\/p>\n<p>export default service;<\/p>\n<p>\u5982\u679c\u5bf9\u4f60\u6709\u5e2e\u52a9&#xff0c;\u70b9\u4e2a&#x1f44d;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e6\u6b21\uff0c\u6536\u85cf6\u6b21\u3002vue3\u82e5\u4f9d\u6846\u67b6\u524d\u7aef\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668\uff0c\u9700\u8981\u90e8\u7f72\u5230\u591a\u4e2a\u670d\u52a1\u5668\u4e0a\uff0c\u6bcf\u6b21\u6253\u5305\u4f1a\u5f88\u9ebb\u70e6\uff0c\u4eca\u5929\u6559\u5927\u5bb6\u4e00\u4e2a\u52a8\u6001\u914d\u7f6e\u8bf7\u6c42\u5934api\u7684\u65b9\u6cd5\uff0c\u90e8\u7f72\u540e\u80fd\u52a8\u6001\u83b7\u53d6(\u4fee\u6539)\u5bf9\u5e94\u670d\u52a1\u5668\u7684\u8bf7\u6c42ip\u4ecb\u7ecd\u4e24\u79cd\u65b9\u6cd5_vue3\u82e5\u4f9d\u6846\u67b6\u524d\u7aef\u4ee3\u7801<\/p>\n","protected":false},"author":2,"featured_media":17517,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[187,625,87,1315,43],"topic":[],"class_list":["post-17521","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-javascript","tag-vue-js","tag-87","tag-vue","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4e00\u884c\u4ee3\u7801\u89e3\u51b3vue3\u524d\u7aef\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668\uff0c\u52a8\u6001\u914d\u7f6ehttp\u8bf7\u6c42\u5934\u540e\u7aefip\u65b9\u6cd5\u6559\u7a0b\u65e0bug - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/17521.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4e00\u884c\u4ee3\u7801\u89e3\u51b3vue3\u524d\u7aef\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668\uff0c\u52a8\u6001\u914d\u7f6ehttp\u8bf7\u6c42\u5934\u540e\u7aefip\u65b9\u6cd5\u6559\u7a0b\u65e0bug - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e6\u6b21\uff0c\u6536\u85cf6\u6b21\u3002vue3\u82e5\u4f9d\u6846\u67b6\u524d\u7aef\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668\uff0c\u9700\u8981\u90e8\u7f72\u5230\u591a\u4e2a\u670d\u52a1\u5668\u4e0a\uff0c\u6bcf\u6b21\u6253\u5305\u4f1a\u5f88\u9ebb\u70e6\uff0c\u4eca\u5929\u6559\u5927\u5bb6\u4e00\u4e2a\u52a8\u6001\u914d\u7f6e\u8bf7\u6c42\u5934api\u7684\u65b9\u6cd5\uff0c\u90e8\u7f72\u540e\u80fd\u52a8\u6001\u83b7\u53d6(\u4fee\u6539)\u5bf9\u5e94\u670d\u52a1\u5668\u7684\u8bf7\u6c42ip\u4ecb\u7ecd\u4e24\u79cd\u65b9\u6cd5_vue3\u82e5\u4f9d\u6846\u67b6\u524d\u7aef\u4ee3\u7801\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/17521.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T16:03:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418160258-680277b25a2f9.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/17521.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/17521.html\",\"name\":\"\u4e00\u884c\u4ee3\u7801\u89e3\u51b3vue3\u524d\u7aef\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668\uff0c\u52a8\u6001\u914d\u7f6ehttp\u8bf7\u6c42\u5934\u540e\u7aefip\u65b9\u6cd5\u6559\u7a0b\u65e0bug - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T16:03:02+00:00\",\"dateModified\":\"2025-04-18T16:03:02+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/17521.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/17521.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/17521.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4e00\u884c\u4ee3\u7801\u89e3\u51b3vue3\u524d\u7aef\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668\uff0c\u52a8\u6001\u914d\u7f6ehttp\u8bf7\u6c42\u5934\u540e\u7aefip\u65b9\u6cd5\u6559\u7a0b\u65e0bug\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4e00\u884c\u4ee3\u7801\u89e3\u51b3vue3\u524d\u7aef\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668\uff0c\u52a8\u6001\u914d\u7f6ehttp\u8bf7\u6c42\u5934\u540e\u7aefip\u65b9\u6cd5\u6559\u7a0b\u65e0bug - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/17521.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4e00\u884c\u4ee3\u7801\u89e3\u51b3vue3\u524d\u7aef\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668\uff0c\u52a8\u6001\u914d\u7f6ehttp\u8bf7\u6c42\u5934\u540e\u7aefip\u65b9\u6cd5\u6559\u7a0b\u65e0bug - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e6\u6b21\uff0c\u6536\u85cf6\u6b21\u3002vue3\u82e5\u4f9d\u6846\u67b6\u524d\u7aef\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668\uff0c\u9700\u8981\u90e8\u7f72\u5230\u591a\u4e2a\u670d\u52a1\u5668\u4e0a\uff0c\u6bcf\u6b21\u6253\u5305\u4f1a\u5f88\u9ebb\u70e6\uff0c\u4eca\u5929\u6559\u5927\u5bb6\u4e00\u4e2a\u52a8\u6001\u914d\u7f6e\u8bf7\u6c42\u5934api\u7684\u65b9\u6cd5\uff0c\u90e8\u7f72\u540e\u80fd\u52a8\u6001\u83b7\u53d6(\u4fee\u6539)\u5bf9\u5e94\u670d\u52a1\u5668\u7684\u8bf7\u6c42ip\u4ecb\u7ecd\u4e24\u79cd\u65b9\u6cd5_vue3\u82e5\u4f9d\u6846\u67b6\u524d\u7aef\u4ee3\u7801","og_url":"https:\/\/www.wsisp.com\/helps\/17521.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T16:03:02+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418160258-680277b25a2f9.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/17521.html","url":"https:\/\/www.wsisp.com\/helps\/17521.html","name":"\u4e00\u884c\u4ee3\u7801\u89e3\u51b3vue3\u524d\u7aef\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668\uff0c\u52a8\u6001\u914d\u7f6ehttp\u8bf7\u6c42\u5934\u540e\u7aefip\u65b9\u6cd5\u6559\u7a0b\u65e0bug - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T16:03:02+00:00","dateModified":"2025-04-18T16:03:02+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/17521.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/17521.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/17521.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4e00\u884c\u4ee3\u7801\u89e3\u51b3vue3\u524d\u7aef\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668\uff0c\u52a8\u6001\u914d\u7f6ehttp\u8bf7\u6c42\u5934\u540e\u7aefip\u65b9\u6cd5\u6559\u7a0b\u65e0bug"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/17521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=17521"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/17521\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/17517"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=17521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=17521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=17521"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=17521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}