处理问题

This commit is contained in:
2026-01-17 02:33:39 +08:00
parent 9ea4f0e999
commit 32993ff52c
10 changed files with 54 additions and 28 deletions

View File

@@ -1 +1 @@
"use strict";const e=require("../../common/vendor.js"),n=require("../../api/index.js");if(!Array){(e.resolveComponent("nut-input")+e.resolveComponent("nut-button"))()}Math||((()=>"../../uni_modules/nutui-uni/components/input/input.js")+(()=>"../../uni_modules/nutui-uni/components/button/button.js"))();const o={__name:"index",setup(o){const t=e.ref(""),s=e.ref(""),u=()=>{""!==t.value?""!==s.value?n.fetchLogin({user_name:t.value,password:s.value}).then((n=>{console.log(n),e.index.setStorageSync("token",n.token),e.index.setStorageSync("uid",n.user.user_id),e.index.setStorageSync("username",n.user.user_name),e.index.setStorageSync("role",n.user.role.value),e.index.showToast({title:"登录成功",icon:"success"}),e.index.switchTab({url:"/pages/index/index"})})):e.index.showToast({title:"请输入密码",icon:"none"}):e.index.showToast({title:"请输入用户名",icon:"none"})};return(n,o)=>({a:e.o((e=>t.value=e)),b:e.p({placeholder:"请输入用户名",clearable:!0,label:"用户名",modelValue:t.value}),c:e.o((e=>s.value=e)),d:e.p({placeholder:"请输入密码",clearable:!0,label:"密码",type:"password",modelValue:s.value}),e:e.o(u),f:e.p({type:"primary",block:!0})})}},t=e._export_sfc(o,[["__scopeId","data-v-fd61bb51"]]);wx.createPage(t);
"use strict";const e=require("../../common/vendor.js"),n=require("../../api/index.js");if(!Array){(e.resolveComponent("nut-input")+e.resolveComponent("nut-button"))()}Math||((()=>"../../uni_modules/nutui-uni/components/input/input.js")+(()=>"../../uni_modules/nutui-uni/components/button/button.js"))();const o={__name:"index",setup(o){const t=e.ref(""),a=e.ref(""),s=()=>{""!==t.value?""!==a.value?n.fetchLogin({user_name:t.value,password:a.value}).then((n=>{console.log(n),e.index.setStorageSync("token",n.token),e.index.setStorageSync("uid",n.user.user_id),e.index.setStorageSync("user_name",n.user.user_name),e.index.setStorageSync("role",n.user.role.value),e.index.setStorageSync("staff_name",n.user.staff_name),e.index.showToast({title:"登录成功",icon:"success"}),e.index.switchTab({url:"/pages/index/index"})})):e.index.showToast({title:"请输入密码",icon:"none"}):e.index.showToast({title:"请输入用户名",icon:"none"})};return(n,o)=>({a:e.o((e=>t.value=e)),b:e.p({placeholder:"请输入用户名",clearable:!0,label:"用户名",modelValue:t.value}),c:e.o((e=>a.value=e)),d:e.p({placeholder:"请输入密码",clearable:!0,label:"密码",type:"password",modelValue:a.value}),e:e.o(s),f:e.p({type:"primary",block:!0})})}},t=e._export_sfc(o,[["__scopeId","data-v-310c5fa3"]]);wx.createPage(t);