diff --git a/api/system/ApiList.js b/api/system/ApiList.js index 8143427..48aec88 100644 --- a/api/system/ApiList.js +++ b/api/system/ApiList.js @@ -69,4 +69,29 @@ export function massEventsId(params) { // params }) } - +// 登录 +// export function login(data){ +// return request({ +// url: '/earlyWarningAudit/massEvents/appLogin', +// headers: { +// isToken: false +// }, +// method: 'psot', +// data +// }) +// } +export function login(username, password) { + const data = { + username, + password, + } + return request({ + 'url': '/api/earlyWarningAudit/massEvents/appLogin', + headers: { + isToken: false, + repeatSubmit: false + }, + 'method': 'post', + 'data': data + }) +} diff --git a/config.js b/config.js index 91a3fd4..91ebe71 100644 --- a/config.js +++ b/config.js @@ -1,7 +1,7 @@ // 应用全局配置 module.exports = { // baseUrl: 'https://vue.ruoyi.vip/prod-api', - baseUrl: 'http://192.168.0.107:9102', + baseUrl: 'http://localhost:9002/api', // 应用信息 appInfo: { // 应用名称 diff --git a/main.js b/main.js index 146e9d9..9a2ba3d 100644 --- a/main.js +++ b/main.js @@ -5,6 +5,9 @@ import plugins from './plugins' // plugins // import './permission' // permission Vue.use(plugins) // main.js +/** + * 首页面的onShow去除login接口调用即可 + */ import uView from '@/uni_modules/uview-ui' Vue.use(uView) Vue.config.productionTip = false diff --git a/manifest.json b/manifest.json index 05a7649..13317ae 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name" : "若依移动端", - "appid" : "__UNI__25A9D80", + "appid" : "__UNI__23373BF", "description" : "", "versionName" : "1.1.0", "versionCode" : "100", @@ -57,26 +57,26 @@ "h5" : { "template" : "static/index.html", "devServer" : { - "port" : 88, - "https" : false, - "proxy" : { - "/baseApi" : { - "target" : "https://yth.scjg.ln.gov.cn/api/shianliaoning/lnapi", - "changeOrigin" : true, - "secure" : false, - "pathRewrite" : { - "^/baseApi" : "" - } - }, - "/lnapi" : { - "target" : "https://yth.scjg.ln.gov.cn", - "changeOrigin" : true, - "secure" : false, - "pathRewrite" : { - "^/lnapi" : "" - } - } - } + "port" : 88, + "https" : false, + "proxy" : { + "/baseApi" : { + "target" : "https://yth.scjg.ln.gov.cn/api/shianliaoning/lnapi", + "changeOrigin" : true, + "secure" : false, + "pathRewrite" : { + "^/baseApi" : "" + } + }, + "/lnapi" : { + "target" : "https://yth.scjg.ln.gov.cn", + "changeOrigin" : true, + "secure" : false, + "pathRewrite" : { + "^/lnapi" : "" + } + } + } }, "title" : "RuoYi-App", "router" : { diff --git a/pages/index.vue b/pages/index.vue index 754b690..e013782 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -94,8 +94,10 @@ import { massEventsList, eventPageCount, - fiveEventCount + fiveEventCount, + login } from '@/api/system/ApiList.js' + import { setToken } from '@/utils/auth' export default { data() { return { @@ -272,15 +274,21 @@ } }, - onLoad: function() { - this.getList() - this.geteventPageCount() - this.$store.dispatch("Deletestate") - }, + // onLoad: function() { + // login("admin","Suanfa@2024//**...").then(res=>{ + // setToken(res.token) + // this.getList() + // this.geteventPageCount() + // this.$store.dispatch("Deletestate") + // }) + // }, onShow() { - this.getList() - this.geteventPageCount() - this.$store.dispatch("Deletestate") + login("admin","Suanfa@2024//**...").then(res=>{ + setToken(res.token) + this.getList() + this.geteventPageCount() + this.$store.dispatch("Deletestate") + }) } }