单页面无感刷新

main
吕天方 2 months ago
parent 9c03095016
commit 94f65e35a0

@ -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
})
}

@ -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: {
// 应用名称

@ -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

@ -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" : {

@ -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")
})
}
}
</script>

Loading…
Cancel
Save