12.4 概念模块功能完善

This commit is contained in:
尚政杰
2025-12-04 17:41:33 +08:00
parent 4e64455b9b
commit 44842120da
5090 changed files with 9843 additions and 146120 deletions

View File

@@ -1 +1 @@
"use strict";const e=require("../common/vendor.js");let o="";o="https://api.valuefrontier.cn:5002",exports.get=function(n,t){return new Promise(((i,a)=>{let r=e.index.getStorageSync("token");e.index.showLoading({title:"加载中"}),e.index.request({url:o+n,data:t,header:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded",Authorization:r?"Bearer "+r:""},method:"GET",success:o=>{console.log(o),e.index.hideLoading(),401==o.data.code?(e.index.removeStorageSync("token"),e.index.navigateTo({url:"/pages/login/login"})):i(o.data)},fail:o=>{e.index.hideLoading(),e.index.showToast({title:"请求失败",icon:"error"}),a(o.response)}})}))},exports.post=function(n,t){return new Promise(((i,a)=>{let r=e.index.getStorageSync("token"),d=0,s=0;if(t&&(d=t.isJson),t&&(s=t.isFile),e.index.showLoading({title:"加载中"}),s){let r=e.index.getStorageSync("token");e.index.uploadFile({url:o+n,filePath:t.avatar,name:"avatar",header:{Authorization:r?"Bearer "+r:""},formData:t,success:o=>{console.log(o),e.index.hideLoading(),401==o.data.code?(e.index.removeStorageSync("token"),e.index.navigateTo({url:"/pages/login/login"}),a(o.data)):i(o.data)},fail:o=>{console.log("上传失败"+o.errMsg),e.index.hideLoading(),e.index.showToast({title:"请求失败",icon:"error"}),a()}})}else{let l=o;n.indexOf("concept-api")>-1&&(l="https://valuefrontier.cn"),e.index.request({url:l+n,data:t,header:{Accept:"application/json","Content-Type":d?"application/json":s?"multipart/form-data":"application/x-www-form-urlencoded",Authorization:r?"Bearer "+r:""},method:"POST",success:o=>{e.index.hideLoading(),t&&t.isNotNeedLogin||(console.log(o.data),401==o.data.code?(e.index.removeStorageSync("token"),e.index.navigateTo({url:"/pages/login/login"}),a(o.data)):i(o.data))},fail:o=>{e.index.hideLoading(),e.index.showToast({title:"请求失败",icon:"error"}),a(o.response)}})}}))};
"use strict";const e=require("../common/vendor.js");let o="";o="https://api.valuefrontier.cn:5002",exports.get=function(n,t){return new Promise(((i,a)=>{let r=e.index.getStorageSync("token");e.index.showLoading({title:"加载中"});let d=o;n.indexOf("concept-api")>-1&&(d="https://valuefrontier.cn"),e.index.request({url:d+n,data:t,header:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded",Authorization:r?"Bearer "+r:""},method:"GET",success:o=>{console.log(o),e.index.hideLoading(),401==o.data.code?(e.index.removeStorageSync("token"),e.index.navigateTo({url:"/pages/login/login"})):i(o.data)},fail:o=>{e.index.hideLoading(),e.index.showToast({title:"请求失败",icon:"error"}),a(o.response)}})}))},exports.post=function(n,t){return new Promise(((i,a)=>{let r=e.index.getStorageSync("token"),d=0,s=0;if(t&&(d=t.isJson),t&&(s=t.isFile),e.index.showLoading({title:"加载中"}),s){let r=e.index.getStorageSync("token");e.index.uploadFile({url:o+n,filePath:t.avatar,name:"avatar",header:{Authorization:r?"Bearer "+r:""},formData:t,success:o=>{console.log(o),e.index.hideLoading(),401==o.data.code?(e.index.removeStorageSync("token"),e.index.navigateTo({url:"/pages/login/login"}),a(o.data)):i(o.data)},fail:o=>{console.log("上传失败"+o.errMsg),e.index.hideLoading(),e.index.showToast({title:"请求失败",icon:"error"}),a()}})}else{let l=o;n.indexOf("concept-api")>-1&&(l="https://valuefrontier.cn"),e.index.request({url:l+n,data:t,header:{Accept:"application/json","Content-Type":d?"application/json":s?"multipart/form-data":"application/x-www-form-urlencoded",Authorization:r?"Bearer "+r:""},method:"POST",success:o=>{e.index.hideLoading(),t&&t.isNotNeedLogin||(console.log(o.data),401==o.data.code?(e.index.removeStorageSync("token"),e.index.navigateTo({url:"/pages/login/login"}),a(o.data)):i(o.data))},fail:o=>{e.index.hideLoading(),e.index.showToast({title:"请求失败",icon:"error"}),a(o.response)}})}}))};