7.10 增加登录页面,事件详情接口对接,我的点赞,关注收藏页面搭建,接口对接

This commit is contained in:
尚政杰
2025-07-10 18:08:16 +08:00
parent c4267a0e27
commit 58b3414bdd
356 changed files with 7710 additions and 978 deletions

View File

@@ -0,0 +1 @@
"use strict";const e=require("./http.js");exports.calendarDataList=t=>e.get("/api/calendar/data",t),exports.calendarEventCount=t=>e.get("/api/calendar-event-counts",t),exports.calendarEventList=t=>e.get("/api/calendar/events",t),exports.eventHistoryEvent=t=>e.get("/api/event/"+t+"/historical-events"),exports.eventList=t=>e.get("/api/events",t),exports.eventRelatedConcept=t=>e.get("/api/event/"+t+"/related-concepts"),exports.eventRelatedStock=t=>e.get("/api/event/"+t+"/related-stocks-detail"),exports.filterOptions=t=>e.get("/api/filter/options",t),exports.homeData=t=>e.get("/api/home",t),exports.industryCategoryList=t=>e.get("/api/industry-classifications",t),exports.investEventDetails=(t,a)=>e.get("/event/"+t,a),exports.loginByEmail=t=>e.post("/api/auth/login/email",t),exports.userInfo=t=>e.get("/api/user/profile",t);

View File

@@ -0,0 +1 @@
"use strict";const e=require("../common/vendor.js");let o="";o="http://43.143.189.195:5002",exports.get=function(t,n){return new Promise(((i,a)=>{let r=e.index.getStorageSync("token");e.index.request({url:o+t,data:n,header:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded",Authorization:r?"Bearer "+r:""},method:"GET",success:o=>{console.log(o),-200==o.data.code?e.index.navigateTo({url:"/pages/login/login"}):i(o.data)},fail:e=>{a(e.response)}})}))},exports.post=function(t,n){return new Promise(((i,a)=>{let r=e.index.getStorageSync("token"),s=0;n&&(s=n.isJson),e.index.request({url:o+t,data:n,header:{Accept:"application/json","Content-Type":s?"application/json":"application/x-www-form-urlencoded",Authorization:r?"bearer"+r:""},method:"POST",success:o=>{console.log(JSON.parse(JSON.stringify(o)));let t="Set-Cookie";if(o.header[t]&&!n.isNotSaveToken){let n=o.header[t].split(";")[0].split("=.")[1];e.index.setStorageSync("token",n)}n&&n.isNotNeedLogin||(-200==o.data.code?(e.index.removeStorageSync("token"),e.index.navigateTo({url:"/pages/login/login"}),a(o.data)):i(o.data))},fail:o=>{e.index.showToast({title:"网络请求失败",icon:"none"}),a(o.response)}})}))};