hldy_xcx/unpackage/resources/__UNI__010B3C0/www/app-service.js

2 lines
307 KiB
JavaScript
Raw Normal View History

2025-09-28 16:21:54 +08:00
if("undefined"==typeof Promise||Promise.prototype.finally||(Promise.prototype.finally=function(e){const t=this.constructor;return this.then((a=>t.resolve(e()).then((()=>a))),(a=>t.resolve(e()).then((()=>{throw a}))))}),"undefined"!=typeof uni&&uni&&uni.requireGlobal){const e=uni.requireGlobal();ArrayBuffer=e.ArrayBuffer,Int8Array=e.Int8Array,Uint8Array=e.Uint8Array,Uint8ClampedArray=e.Uint8ClampedArray,Int16Array=e.Int16Array,Uint16Array=e.Uint16Array,Int32Array=e.Int32Array,Uint32Array=e.Uint32Array,Float32Array=e.Float32Array,Float64Array=e.Float64Array,BigInt64Array=e.BigInt64Array,BigUint64Array=e.BigUint64Array}uni.restoreGlobal&&uni.restoreGlobal(Vue,weex,plus,setTimeout,clearTimeout,setInterval,clearInterval),function(e){"use strict";function t(e,t,...a){uni.__log__?uni.__log__(e,t,...a):console[e].apply(console,[...a,t])}function a(e,t){return"string"==typeof e?t:e}const n=(t,a=0)=>(a,n=e.getCurrentInstance())=>{!e.isInSSRComponentSetup&&e.injectHook(t,a,n)},o=n("onShow",3),i=n("onLoad",2),l=n("onUnload",2),c=n("onPullDownRefresh",2),s="http://192.168.2.19:8081/opeapi",r=e=>{let t=e.url,a=e.method||"get",n=e.data||{},o={"X-Access-Token":uni.getStorageSync("token")||"","Content-Type":"application/json;charset=UTF-8",Authorization:"Basic c2FiZXI6c2FiZXJfc2VjcmV0",...e.header};return new Promise(((i,l)=>{uni.request({url:s+t,method:a,header:o,data:n,timeout:5e3,success(t){const a=t;if(200==a.statusCode)i(a.data);else switch(uni.clearStorageSync(),a.statusCode){case 401:e.no401||uni.showModal({title:"登录过期",content:"登录过期,请重新登录",showCancel:!1,success(){setTimeout((()=>{uni.reLaunch({url:"/pages/login/callback"})}),1e3)}});break;case 404:uni.showToast({title:"请求地址不存在...",icon:"error",duration:2e3});break;default:uni.showToast({title:"请重试...",icon:"error",duration:2e3})}},fail(e){-1!==e.errMsg.indexOf("request:fail")?uni.showToast({title:"网络异常",icon:"error",duration:2e3}):uni.showToast({title:"未知异常",duration:2e3}),l(e)}})})).catch((()=>{}))};function d(e){return r({url:`/weixin/wechat/callback?code=${e}`,method:"get"})}function u(e){return r({url:`/api/elderInfo/queryWeixinInfo?openId=${e}`,method:"get"})}function m(e){return r({url:`/api/advisoryInfo/changeClientType?openId=${uni.getStorageSync("openid")}&type=${e}`,method:"put"})}const p=(e,t)=>{const a=e.__vccOpts||e;for(const[n,o]of t)a[n]=o;return a},g=p({__name:"callback",setup:a=>(i((e=>{e.type?uni.setStorageSync("special",!0):uni.setStorageSync("special",!1),uni.login({provider:"weixin",success(e){d(e.code).then((e=>{let t=e.data.openid;uni.setStorageSync("openid",t),u(t).then((e=>{if(uni.setStorageSync("tel",e.result.tel),uni.setStorageSync("token",e.result.token),uni.setStorageSync("serverUrl",e.result.serverUrl),uni.setStorageSync("platId",e.result.platId),uni.setStorageSync("izJg",e.result.izJg),uni.setStorageSync("izJs",e.result.izJs),uni.setStorageSync("izYg",e.result.izYg),uni.setStorageSync("allinfo",e.result),e.result.tel)if(uni.getStorageSync("special"))uni.reLaunch({url:"/pages/login/specialloginafther"});else switch(e.result.advisoryType){case"1":uni.reLaunch({url:"/pages/oldmanindex/index"});break;case"2":uni.reLaunch({url:"/pages/yuangongindex/index"});break;case"3":uni.reLaunch({url:"/pages/index/index"});break;default:uni.reLaunch({url:"/pages/login/threeselectone"})}else uni.reLaunch({url:"/pages/login/xuanchuan"})}))}))},fail(e){t("error","at pages/login/callback.vue:81","获取 code 失败:",e)}})})),(t,a)=>(e.openBlock(),e.createElementBlock("view",{class:"login-container"},[e.createElementVNode("image",{class:"login-imge",src:"https://www.focusnu.com/media/directive/login/loading.gif",mode:"widthFix","lazy-load":"false"})])))},[["__scopeId","data-v-5a68ae29"]]),h=p({__name:"index",setup(a){const n=e.ref(!1),o=e.ref(!1),i=e.ref("rgba(0, 0, 0, 0.5)");function l(){o.value=!1}const c=()=>{n.value?uni.login({provider:"weixin",success(e){d(e.code).then((e=>{let t=e.data.openid;uni.setStorageSync("openid",t),uni.navigateTo({url:"/pages/login/phonebumber"})}))},fail(e){t("error","at p