单页面无感刷新

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

@ -69,4 +69,29 @@ export function massEventsId(params) {
// 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 = { module.exports = {
// baseUrl: 'https://vue.ruoyi.vip/prod-api', // baseUrl: 'https://vue.ruoyi.vip/prod-api',
baseUrl: 'http://192.168.0.107:9102', baseUrl: 'http://localhost:9002/api',
// 应用信息 // 应用信息
appInfo: { appInfo: {
// 应用名称 // 应用名称

@ -5,6 +5,9 @@ import plugins from './plugins' // plugins
// import './permission' // permission // import './permission' // permission
Vue.use(plugins) Vue.use(plugins)
// main.js // main.js
/**
* 首页面的onShow去除login接口调用即可
*/
import uView from '@/uni_modules/uview-ui' import uView from '@/uni_modules/uview-ui'
Vue.use(uView) Vue.use(uView)
Vue.config.productionTip = false Vue.config.productionTip = false

@ -1,6 +1,6 @@
{ {
"name" : "若依移动端", "name" : "若依移动端",
"appid" : "__UNI__25A9D80", "appid" : "__UNI__23373BF",
"description" : "", "description" : "",
"versionName" : "1.1.0", "versionName" : "1.1.0",
"versionCode" : "100", "versionCode" : "100",

@ -94,8 +94,10 @@
import { import {
massEventsList, massEventsList,
eventPageCount, eventPageCount,
fiveEventCount fiveEventCount,
login
} from '@/api/system/ApiList.js' } from '@/api/system/ApiList.js'
import { setToken } from '@/utils/auth'
export default { export default {
data() { data() {
return { return {
@ -272,15 +274,21 @@
} }
}, },
onLoad: function() { // onLoad: function() {
this.getList() // login("admin","Suanfa@2024//**...").then(res=>{
this.geteventPageCount() // setToken(res.token)
this.$store.dispatch("Deletestate") // this.getList()
}, // this.geteventPageCount()
// this.$store.dispatch("Deletestate")
// })
// },
onShow() { onShow() {
login("admin","Suanfa@2024//**...").then(res=>{
setToken(res.token)
this.getList() this.getList()
this.geteventPageCount() this.geteventPageCount()
this.$store.dispatch("Deletestate") this.$store.dispatch("Deletestate")
})
} }
} }
</script> </script>

Loading…
Cancel
Save