Browse Source

登录页面及接口

master
liupopo 2 years ago
parent
commit
b8e17f1593
  1. 2
      supervise-wx-mp/common/request.api.js
  2. 11
      supervise-wx-mp/pages/index/enterpriseRisk.vue
  3. 17
      supervise-wx-mp/pages/index/index.vue
  4. 64
      supervise-wx-mp/pages/login/index.vue
  5. 38
      yxt_supervise/supervise-rms/supervise-rms-biz/src/main/java/com/supervise/rms/biz/tmp/SysuserRest.java

2
supervise-wx-mp/common/request.api.js

@ -1,7 +1,7 @@
import request from '@/utils/requester.js'
export default {
login: (params = {}) => request.post("/portal/v1/sysuser/login", params),
login: (params = {}) => request.post("/sysuser/login", params),
sayhello: (params = {}) => request.get("/sayb", params),
getSalesReport: (params = {}) => request.get("/system/reportCenter/getSalesReport", params),
getGoodsOnWay: (params = {}) => request.get("/system/reportCenter/getGoodsOnWay", params),

11
supervise-wx-mp/pages/index/enterpriseRisk.vue

@ -78,10 +78,12 @@
},
onLoad(option) {
// this.queryParams = JSON.stringify(option)
this.queryParams = JSON.stringify(option)
console.log('1111',this.queryParams)
this.getData()
// console.log('App onLoad', JSON.stringify(option))
this.title = JSON.stringify(option)
// this.title = JSON.stringify(option)
// wx.showToast({
// title: 'onLoad>>>>>' + JSON.stringify(option),
// icon: 'none',
@ -89,11 +91,6 @@
// })
},
created() {
this.getData()
},
methods: {
getData() {
var _this = this

17
supervise-wx-mp/pages/index/index.vue

@ -2,12 +2,9 @@
<view class="charts-box">
<view style="display: flex;justify-content: center; width: 100%; ">
<text style="padding-top: 10px;padding-bottom: 10px;color: blue;margin-left: 20px;"
@click="jump(1)">1</text>
<text style="padding-top: 10px;padding-bottom: 10px;color: blue;margin-left: 20px;"
@click="jump(2)">2</text>
<text style="padding-top: 10px;padding-bottom: 10px;color: blue;margin-left: 20px;"
@click="jump(3)">3</text>
<text style="padding-top: 10px;padding-bottom: 10px;color: blue;margin-left: 20px;" @click="jump(1)">1</text>
<text style="padding-top: 10px;padding-bottom: 10px;color: blue;margin-left: 20px;" @click="jump(2)">2</text>
<text style="padding-top: 10px;padding-bottom: 10px;color: blue;margin-left: 20px;" @click="jump(3)">3</text>
</view>
<view style="margin-top: 20px;margin-left: 20px;">
@ -55,7 +52,9 @@
</view>
<navigator url="enterpriseRisk?businessName=aaaabbbb&executionTime=2023-03-15" hover-class="navigator-hover">
<button type="default" style="margin-top: 20px;">测试企业经营页面</button>
</navigator>
</view>
</template>
@ -121,7 +120,7 @@
},
onLoad() {
this.getServerData();
},
methods: {
getServerData() {
@ -143,7 +142,7 @@
}, 100);
},
jump(index) {
console.log("index>>",index)
console.log("index>>", index)
switch (index) {
case 1:

64
supervise-wx-mp/pages/login/index.vue

@ -14,20 +14,19 @@
<uni-forms-item label="密码:" name="password">
<uni-easyinput prefixIcon="locked" type="password" v-model="formData.password" placeholder="请输入密码" />
</uni-forms-item>
<uni-forms-item>
<checkbox-group @change="checkboxChange">
<label>
<checkbox value="ty" style="transform:scale(0.8)" />
<text>已阅读并同意</text>
<text @click="fwxy">服务协议</text>
<text @click="yszc">隐私政策</text>
</label>
</checkbox-group>
</uni-forms-item>
</uni-forms>
<button @click="dologin">登录</button>
<button @click="dologin" style="margin-top: 15px;">微信登录</button>
</uni-card>
<uni-card :is-shadow="false" :isFull="true" :border="false">
<checkbox-group @change="checkboxChange">
<label>
<checkbox value="ty" style="transform:scale(0.8)" />
<text>已阅读并同意</text>
<text @click="fwxy">服务协议</text>
<text @click="yszc">隐私政策</text>
</label>
</checkbox-group>
<!-- <button @click="dologin" style="margin-top: 15px;">微信登录</button> -->
</uni-card>
</uni-section>
</view>
@ -46,29 +45,46 @@
},
rules: {
// name
name: {
userName: {
rules: [{
required: true,
errorMessage: '账号不可以为空'
}]
},
// passwd
passwd: {
password: {
rules: [{
required: true,
errorMessage: '密码不可以为空'
}]
}
},
ty: 0
}
},
created() {},
methods: {
checkboxChange(e) {
let values = e.detail.value
console.log('KKK', values)
if (values && values.length > 0) {
this.ty = 1
} else {
this.ty = 0
}
},
dologin() {
let _this = this
this.$refs.form
.validate()
.then(r => {
if (this.ty == 0) {
uni.showToast({
title: '请选择同意服务协议与隐私政策',
icon: 'none'
})
return;
}
_this.$store
.dispatch('login', _this.formData)
.then(uinfo => {
@ -94,16 +110,16 @@
console.log('eeee:', err)
})
},
fwxy() {
uni.navigateTo({
url: '/pages/login/fwxy'
})
},
yszc() {
uni.navigateTo({
url: '/pages/login/yszc'
})
}
fwxy() {
uni.navigateTo({
url: '/pages/login/fwxy'
})
},
yszc() {
uni.navigateTo({
url: '/pages/login/yszc'
})
}
}
}
</script>

38
yxt_supervise/supervise-rms/supervise-rms-biz/src/main/java/com/supervise/rms/biz/tmp/SysuserRest.java

@ -0,0 +1,38 @@
package com.supervise.rms.biz.tmp;
import com.yxt.common.core.result.ResultBean;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("/sysuser")
public class SysuserRest {
@PostMapping("/login")
public ResultBean<Map<String, Object>> dologin(@RequestBody Map<String, String> param) {
ResultBean rb = ResultBean.fireFail();
String userName = param.get("userName");
String password = param.get("password");
if (StringUtils.isBlank(userName))
return rb.setMsg("账号不可为空!");
if (StringUtils.isBlank(password))
return rb.setMsg("密码不可为空!");
if ("13131100001".equals(userName) && "123456".equals(password)) {
Map<String, Object> map = new HashMap<>();
map.put("token", "abc987654321");
map.put("name", "测试账号");
return rb.success().setData(map);
} else {
return rb.setMsg("账号或密码错误");
}
}
}
Loading…
Cancel
Save