diff --git a/supervise-uniapp/App.vue b/supervise-uniapp/App.vue
index f073a238..7631e996 100644
--- a/supervise-uniapp/App.vue
+++ b/supervise-uniapp/App.vue
@@ -1,16 +1,76 @@
diff --git a/supervise-uniapp/common/TextUtils.js b/supervise-uniapp/common/TextUtils.js
new file mode 100644
index 00000000..0efe36b3
--- /dev/null
+++ b/supervise-uniapp/common/TextUtils.js
@@ -0,0 +1,11 @@
+const isEmpty = (obj) => {
+ if (obj == undefined || obj == null || obj === "" || obj === "null") {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+export {
+ isEmpty
+}
\ No newline at end of file
diff --git a/supervise-uniapp/common/Toast.js b/supervise-uniapp/common/Toast.js
new file mode 100644
index 00000000..232e7b16
--- /dev/null
+++ b/supervise-uniapp/common/Toast.js
@@ -0,0 +1,8 @@
+const toast = (msg) => {
+ uni.showToast({
+ title: msg,
+ icon: 'none'
+ })
+}
+
+export default toast
diff --git a/supervise-uniapp/common/config.js b/supervise-uniapp/common/config.js
index 557825b9..5b3780be 100644
--- a/supervise-uniapp/common/config.js
+++ b/supervise-uniapp/common/config.js
@@ -7,8 +7,8 @@
*/
module.exports = {
// baseUrl: 'https://jianguan.yyundong.com/api',
- baseUrl: 'https://supervise.yxtsoft.com',
- // baseUrl: 'http://192.168.1.193:8112',
+ // baseUrl: 'https://supervise.yxtsoft.com',
+ baseUrl: 'http://192.168.1.193:8112',
tokenName: "Authorization", // 请求头中token的名字,与服务器端对应
loginTimeoutCode: "5001", // 登录超时或失效的情况下,服务器端返回的错误码
loginTimeoutPage: "/pages/login/index", // 登录超时或失效的情况下,跳转到的登录页面
diff --git a/supervise-uniapp/common/request.api.js b/supervise-uniapp/common/request.api.js
index 6a638fdb..1c365da2 100644
--- a/supervise-uniapp/common/request.api.js
+++ b/supervise-uniapp/common/request.api.js
@@ -1,11 +1,17 @@
import request from '@/utils/requester.js'
export default {
- login: (params = {}) => request.post("/api/portal/v1/sysuser/login", params),
+ login: (params = {}) => request.post("/portal/v1/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),
getThresholdAnalysis: (params = {}) => request.get("/system/risk/getThresholdAnalysis", params),
+ // 获取 验证码
+ sendVerificationCode: (params = {}) => request.get("/portal/v1/wxuser/sendVerificationCode/" + params.phone + "/" +
+ params.type, params),
+
+ // 绑定手机号
+ wxBindMobile: (params = {}) => request.post("/portal/v1/wxuser/wxBindMobile",params),
// 查看预警信息
selectBusinessRiskInfo: (params = {}) => request.post("/wxmpapi/v1/businessData/selectBusinessRiskInfo", params),
@@ -15,7 +21,7 @@ export default {
params),
// 获取今日回款明细
getCsmReportTodayByComSid: (params = {}) => request.post(
- "/reportwxmpapi/reportwxmpapi/v1/csmcashreportsales/getCsmReportYesterdayByComSid",
+ "/reportwxmpapi/reportwxmpapi/v1/csmcashreportcashed/getCsmReportTodayByComSid",
params),
// 获取昨日销售报表
getCsmReportYesterdayByComSid: (params = {}) => request.post(
@@ -35,36 +41,36 @@ export default {
// 质物库存汇总-表头
getDayGather: (params = {}) => request.get(
"/reportwxmpapi/reportstock/getDayGather/" + params.projectSid + "/" + params.orderDate, params),
- // "/report/reportstock/getDayGather/" + params.projectSid + "/" + params.orderDate, params),
+ // "/report/reportstock/getDayGather/" + params.projectSid + "/" + params.orderDate, params),
// 质物库存汇总-仓库列表
getDayStore: (params = {}) => request.get(
"/reportwxmpapi/reportstock/getDayStore/" + params.projectSid + "/" + params.orderDate, params),
- // "/report/reportstock/getDayStore/" + params.projectSid + "/" + params.orderDate, params),
+ // "/report/reportstock/getDayStore/" + params.projectSid + "/" + params.orderDate, params),
// 质物库存汇总-明细
getDayProduct: (params = {}) => request.get(
"/reportwxmpapi/reportstock/getDayProduct/" + params, params),
- // "/report/reportstock/getDayProduct/" + params, params),
+ // "/report/reportstock/getDayProduct/" + params, params),
// 获取首页面数据
- getWorkData: (params = {}) => request.get("/api/portal/v1/flow/task/" + params, params),
+ getWorkData: (params = {}) => request.get("/portal/v1/flow/task/" + params, params),
// 获取云仓列表
- storeHouseListPage: (params = {}) => request.post("/api/portal/v1/flow/storeHouseListPage", params),
+ storeHouseListPage: (params = {}) => request.post("/portal/v1/flow/storeHouseListPage", params),
// 获取云仓详情
- storeHouseDetail: (params = {}) => request.get("/api/portal/v1/flow/fetchDetailsBySid/" + params, params),
+ storeHouseDetail: (params = {}) => request.get("/portal/v1/flow/fetchDetailsBySid/" + params, params),
// 获取我的项目
- getProjectByUserSid: (params = {}) => request.get("/api/crm/v1/projectinformation/getProjectByUserSid/" + params,
+ getProjectByUserSid: (params = {}) => request.get("/crm/v1/projectinformation/getProjectByUserSid/" + params,
params),
// 获取我的项目详情
- getProjectBySid: (params = {}) => request.get("/api/crm/v1/projectinformation/getProjectBySid/" + params,
+ getProjectBySid: (params = {}) => request.get("/crm/v1/projectinformation/getProjectBySid/" + params,
params),
// 获取我的项目-仓库详情
- getStorehouseBySid: (params = {}) => request.get("/api/crm/v1/projectinformation/getStorehouseBySid/" + params,
+ getStorehouseBySid: (params = {}) => request.get("/crm/v1/projectinformation/getStorehouseBySid/" + params,
params),
}
\ No newline at end of file
diff --git a/supervise-uniapp/common/wxAuthLogin - 副本.js b/supervise-uniapp/common/wxAuthLogin - 副本.js
new file mode 100644
index 00000000..7a3115a1
--- /dev/null
+++ b/supervise-uniapp/common/wxAuthLogin - 副本.js
@@ -0,0 +1,174 @@
+import {
+ isEmpty
+} from './TextUtils.js'
+
+const wxAuthLogin = () => {
+ // 判断是否已经登陆
+ if (getApp().globalData.isLogin) {
+ return new Promise((resolve, reject) => {
+ resolve(getApp().globalData.sysUserSid)
+ })
+ }
+
+ return new Promise((resolve, reject) => {
+ // 授权登录
+ wx.login({
+ // 未配置 onlyAuthorize 的情况下调用此接口,code 值不返回,用以换取 authResult 。
+ // 配置 onlyAuthorize 会把未使用过的 code 值返回,
+ onlyAuthorize:true,
+ success: function(res) {
+ console.log('Http网络请求res',res)
+ if (res.code) {
+
+ if (getApp().globalData.isDebug) {
+ console.log('Http网络请求info', {
+ "wxCode": res.code
+ })
+ }
+ uni.showLoading({
+ title: '加载中...',
+ mask: true
+ });
+
+ uni.request({
+ // 组装请求地址
+ url: getApp().globalData.wxAuthLoginURL,
+ // 请求方式 GET POST
+ method: "GET",
+ header: {
+ // 传参方式
+ 'content-type': "application/x-www-form-urlencoded"
+ },
+ // 具体参数
+ data: {
+ "wxCode": res.code
+ },
+
+ success: res => {
+
+ // 关闭显示框
+ uni.hideLoading();
+
+ console.log(res)
+
+ if (getApp().globalData.isDebug) {
+ console.log('Http网络路径', getApp().globalData.wxAuthLoginURL)
+ console.log('Http网络请求结果', JSON.parse(JSON.stringify(
+ res.data)))
+ }
+
+
+ if (res.statusCode == 200) {
+ // 下面是接口返回的数据
+ if (!res.data.success) {
+ if ("A01001" == res.data.code || "A01002" == res.data.code ) {
+ // 绑定手机号
+ uni.navigateTo({
+ url: '../index/BindPhone?sysUserWxAuthSid=' + res.data.data
+ })
+ // reject("绑定手机号")
+ }
+ else {
+ // 错误提示
+ if (isEmpty(res.data)) {
+ // 未成功获取到服务器返回的json
+ uni.showToast({
+ // 不能超过7个字
+ title: "服务器响应为空",
+ icon: "error"
+ })
+ reject("服务器响应为空")
+ } else {
+
+ let errorMsg = res.data.msg
+
+ if (isEmpty(errorMsg)) {
+ errorMsg = url+"服务器未返回错误信息"
+ }
+
+ uni.showToast({
+ title: errorMsg,
+ // 保证文字长度
+ icon: "none",
+ duration: 3000
+ })
+ }
+
+ reject(errorMsg)
+ }
+ return
+ }
+
+ // 保存
+ uni.setStorageSync("sysUserSid", res.data.data.sysUserSid);
+ uni.setStorageSync("isLogin", res.data.data.isLogin);
+ getApp().globalData.isLogin = res.data.data.isLogin
+ getApp().globalData.sysUserSid = res.data.data.sysUserSid
+ getApp().globalData.token = res.data.data.token
+
+ // 直接返回Response
+ resolve(getApp().globalData.sysUserSid)
+
+
+ } else {
+
+ uni.showToast({
+ title: res.statusCode + ":" + res
+ .errMsg,
+ // 保证文字长度
+ icon: "none",
+ duration: 3000
+ })
+
+ reject(res.errMsg)
+ }
+
+ },
+ fail: (err) => {
+ // 关闭显示框
+ uni.hideLoading();
+
+ if (getApp().globalData.isDebug) {
+ console.log("Http网络请求fail", err)
+ }
+
+
+ uni.showToast({
+ title: '请检查网络',
+ icon: 'error'
+ })
+
+ reject(err)
+
+ },
+ complete: () => {
+
+ }
+ });
+
+
+ } else {
+
+ uni.showToast({
+ title: "授权登录获取code失败:" + res.errMsg,
+ icon: 'none'
+ })
+
+ reject(res.errMsg)
+ }
+ },
+ fail: function(res) {
+ uni.showToast({
+ title: "授权登录失败:" + res.errMsg,
+ icon: 'none'
+ })
+
+ reject(res.errMsg)
+ }
+ });
+
+ })
+
+}
+
+export default wxAuthLogin
diff --git a/supervise-uniapp/common/wxAuthLogin.js b/supervise-uniapp/common/wxAuthLogin.js
new file mode 100644
index 00000000..899c6090
--- /dev/null
+++ b/supervise-uniapp/common/wxAuthLogin.js
@@ -0,0 +1,106 @@
+import {
+ isEmpty
+} from './TextUtils.js'
+
+const wxAuthLogin = () => {
+ // 判断是否已经登陆
+ if (getApp().globalData.isLogin) {
+ return new Promise((resolve, reject) => {
+ resolve(getApp().globalData.sysUserSid)
+ })
+ }
+
+ return new Promise((resolve, reject) => {
+ // 获取信息
+ // 获取用户信息
+ uni.getUserProfile({
+ desc: '获取基本信息',
+ success: function(infoRes) {
+
+ _this.data.nickName = infoRes.userInfo.nickName;
+ _this.data.gender = infoRes.userInfo.gender == 1 ? "男" : "女";
+ _this.data.oauthHeadImg = infoRes.userInfo.avatarUrl;
+ _this.data.fromkey = "WeiXin";
+
+ uni.login({
+ provider: 'weixin',
+ success: function(loginRes) {
+
+ uni.request({
+ url: getApp().globalData.wxAuthLoginURL +
+ "?wxCode=" + loginRes
+ .code,
+ method: "GET",
+ header: {
+ // 传参方式
+ 'content-type': "application/x-www-form-urlencoded"
+ },
+ // 具体参数
+ data: {
+ "wxCode": loginRes.code
+ },
+ }).then((res) => {
+ console.log(res)
+
+ _this.data.openid = res.data.openid;
+ _this.data.unionId = res.data.unionid;
+
+ // _this.HTTP({
+ // url: "oauth/afterlogin",
+ // data: {
+ // "openid": _this.data.openid,
+ // "unionId": _this.data.unionId,
+ // "nickName": _this.data.nickName,
+ // "gender": _this.data.gender,
+ // "oauthHeadImg": _this.data
+ // .oauthHeadImg,
+ // "fromkey": _this.data.fromkey
+ // },
+ // loading: true
+ // }).then((res) => {
+ // // 保存
+ // _this.WritePreference("memberSid",
+ // res.data
+ // .memberSid)
+ // getApp().globalData.isLogin = true
+ // getApp().globalData.memberSid = res
+ // .data
+ // .memberSid
+ // // $emit 触发事件 (主要返回给webviwew页面)
+ // uni.$emit('login', res.data
+ // .memberSid)
+ // _this.Back()
+ // }, (err) => {
+ // if (err.data != null) {
+ // err.data.cookie = _this
+ // .ReplaceAll(err.data.cookie,
+ // "=", "-")
+ // uni.redirectTo({
+ // url: "./BdtelephoneActivity?cookie=" +
+ // err.data.cookie
+ // })
+ // }
+ // })
+
+ }, (err) => {
+ // 错误提示
+ _this.Toast("出错了:" + err.data.errmsg)
+ })
+
+ },
+ fail: function(err) {
+ _this.Toast(err)
+ }
+ });
+ },
+ fail: function(err) {
+ // 用户拒绝
+ _this.Toast(err.errMsg)
+ }
+ });
+
+ })
+
+}
+
+export default wxAuthLogin
\ No newline at end of file
diff --git a/supervise-uniapp/common/wxSilentLogin.js b/supervise-uniapp/common/wxSilentLogin.js
new file mode 100644
index 00000000..48dac231
--- /dev/null
+++ b/supervise-uniapp/common/wxSilentLogin.js
@@ -0,0 +1,94 @@
+// 静默登录
+import {
+ isEmpty
+} from './TextUtils.js'
+const wxSilentLogin = () => {
+ return new Promise((resolve, reject) => {
+ wx.login({
+ success: function(res) {
+ if (res.code) {
+ if (getApp().globalData.isDebug) {
+ console.log('Http网络请求信息', {
+ "wxCode": res.code
+ })
+ }
+ uni.request({
+ // 组装请求地址
+ url: getApp().globalData.wxSilentLoginURL + "?wxCode=" + res
+ .code,
+ // 请求方式 GET POST
+ method: "GET",
+ header: {
+ // 传参方式
+ 'content-type': "application/x-www-form-urlencoded"
+ },
+ // 具体参数
+ data: {
+ "wxCode": res.code
+ },
+ success: res => {
+ console.log(res)
+ // if (getApp().globalData.isDebug) {
+ // console.log('Http网络路径', getApp().globalData
+ // .wxSilentLoginURL)
+ // }
+ if (res.statusCode == 200) {
+ if (!res.data.success) {
+
+ if (res.data.code == 500) {
+ // 未关注小程序 首次登录 也无账号
+ uni.showToast({
+ title: "您的平台应用未被授权,请联系工作人员。",
+ icon: 'none',
+ duration: 3000,
+ })
+ wx.exitMiniProgram({
+ success: function() {},
+ fail: function() {}
+ })
+ return
+ }
+
+ if (res.data.code == 100) {
+ // 有账号 未绑定用户
+ uni.redirectTo({
+ url: '../index/BindPhone?sysUserWxAuthSid=' +
+ res.data.data
+ })
+ }
+
+ } else {
+ console.log("Http网络请求res", res)
+ console.log("Global-Auth-Token", res.data.data.token)
+ uni.setStorageSync("Global-Auth-Token", res.data.data.token)
+ getApp().globalData.username = res.data.data.userName
+ getApp().globalData.token = res.data.data.token
+ getApp().globalData.sid = res.data.data.sid
+ getApp().globalData.mobile = res.data.data.mobile
+ getApp().globalData.isLogin= true
+ }
+ } else {
+ getApp().globalData.isLogin = false
+ }
+ },
+ fail: (err) => {
+ if (getApp().globalData.isDebug) {
+ console.log("Http网络请求fail", err)
+ }
+ },
+ complete: () => {}
+ });
+ }
+ },
+ fail: function(res) {
+ uni.showToast({
+ title: "静默登录失败:" + res.errMsg,
+ icon: 'none'
+ })
+
+ reject(res.errMsg)
+ }
+ });
+ })
+}
+export default wxSilentLogin
\ No newline at end of file
diff --git a/supervise-uniapp/components/SendCodeItem/SendCodeItem.vue b/supervise-uniapp/components/SendCodeItem/SendCodeItem.vue
new file mode 100644
index 00000000..81797f35
--- /dev/null
+++ b/supervise-uniapp/components/SendCodeItem/SendCodeItem.vue
@@ -0,0 +1,132 @@
+
+
+ {{textDetail}}
+
+
+
+
+
+
diff --git a/supervise-uniapp/main.js b/supervise-uniapp/main.js
index 5e452b16..ce2c43ec 100644
--- a/supervise-uniapp/main.js
+++ b/supervise-uniapp/main.js
@@ -1,5 +1,8 @@
import Vue from 'vue'
import App from './App'
+import toast from './common/Toast.js'
+import wxAuthLogin from './common/wxAuthLogin.js'
+import wxSilentLogin from './common/wxSilentLogin.js'
// vuex
import store from './store'
// 引入全局uView
@@ -17,6 +20,9 @@ Vue.mixin(mixin)
import api from '@/common/request.api.js'
Vue.prototype.$api = api
+Vue.prototype.WxSilentLogin = wxSilentLogin
+Vue.prototype.WxAuthLogin = wxAuthLogin
+Vue.prototype.Toast = toast
Vue.config.productionTip = false
App.mpType = 'app'
diff --git a/supervise-uniapp/manifest.json b/supervise-uniapp/manifest.json
index 64e1581c..c7e6e491 100644
--- a/supervise-uniapp/manifest.json
+++ b/supervise-uniapp/manifest.json
@@ -28,7 +28,8 @@
"Camera" : {},
"Barcode" : {},
"Contacts" : {},
- "Push" : {}
+ "Push" : {},
+ "OAuth" : {}
},
"distribute" : {
"android" : {
@@ -73,7 +74,13 @@
"appkey_android" : ""
}
},
- "push" : {}
+ "push" : {},
+ "oauth" : {
+ "weixin" : {
+ "appid" : "__UNI__DD73AA7",
+ "UniversalLinks" : ""
+ }
+ }
},
"icons" : {
"android" : {
diff --git a/supervise-uniapp/pages.json b/supervise-uniapp/pages.json
index 703cebea..5ff64daa 100644
--- a/supervise-uniapp/pages.json
+++ b/supervise-uniapp/pages.json
@@ -10,7 +10,13 @@
"pages": [
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
-
+{
+ "path": "pages/index/InventorySummary",
+ "style": {
+ "navigationBarTitleText": "质物库存汇总"
+ }
+ },
+ /* #ifdef APP-PLUS */
{
"path": "pages/login/login",
"style": {
@@ -19,11 +25,22 @@
"scrollIndicator": false //禁用原生导航栏,
}
}
- },{
- "path": "pages/index/InventorySummary",
+ },
+ /* #endif */
+
+ {
+ "path": "pages/home/WorkFragment",
"style": {
- "navigationBarTitleText": "质物库存汇总"
+ "navigationBarTitleText": "工作台"
}
+ },
+
+ {
+ "path": "pages/index/BindPhone",
+ "style": {
+ "navigationBarTitleText": "绑定手机号"
+ }
+
}, {
"path": "pages/index/WaitingProcessed",
"style": {
@@ -38,7 +55,7 @@
"enablePullDownRefresh": true
}
- },
+ },
{
"path": "pages/index/InventorySummaryDetail",
"style": {
@@ -85,11 +102,6 @@
"navigationBarTitleText": "个人中心"
}
- }, {
- "path": "pages/home/WorkFragment",
- "style": {
- "navigationBarTitleText": "工作台"
- }
}, {
"path": "pages/index/WarehouseManagement",
"style": {
diff --git a/supervise-uniapp/pages/home/WorkFragment.vue b/supervise-uniapp/pages/home/WorkFragment.vue
index e6e2de19..279db8ac 100644
--- a/supervise-uniapp/pages/home/WorkFragment.vue
+++ b/supervise-uniapp/pages/home/WorkFragment.vue
@@ -145,10 +145,10 @@
export default {
data() {
return {
- dbNum: 1,
- ybNum: 1,
- dyNum: 1,
- yyNum: 1,
+ dbNum: 0,
+ ybNum: 0,
+ dyNum: 0,
+ yyNum: 0,
animateUp: false,
timer: null,
textArr: [
@@ -184,14 +184,17 @@
// },
onShow() {
- var userSid = getApp().globalData.sid
- console.log(">>>>>", userSid)
- this.getData(userSid)
-
- uni.setTabBarBadge({ //显示数字
- index: 0, //tabbar下标
- text: '100' //数字
- })
+ setTimeout(() => {
+ if (getApp().globalData.isLogin) {
+ var userSid = getApp().globalData.sid
+ console.log(">>>>>", userSid)
+ this.getData(userSid)
+ uni.setTabBarBadge({ //显示数字
+ index: 0, //tabbar下标
+ text: '100' //数字
+ })
+ }
+ }, 1000)
// uni.removeTabBarBadge({ //隐藏数字标
// index:2
// })
@@ -217,6 +220,9 @@
},
getData(userSid) {
+
+ // let data = await axios.get('/api/portal/v1/flow/task/'+userSid)
+ // console.log('data', data)
var _this = this
console.log("getData>>>>>", userSid)
this.$api.getWorkData(userSid).then((resp) => {
diff --git a/supervise-uniapp/pages/index/BindPhone.vue b/supervise-uniapp/pages/index/BindPhone.vue
new file mode 100644
index 00000000..7e382623
--- /dev/null
+++ b/supervise-uniapp/pages/index/BindPhone.vue
@@ -0,0 +1,176 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 绑定手机
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/supervise-uniapp/pages/index/WarehouseManagement.vue b/supervise-uniapp/pages/index/WarehouseManagement.vue
index 58e561da..56ab4579 100644
--- a/supervise-uniapp/pages/index/WarehouseManagement.vue
+++ b/supervise-uniapp/pages/index/WarehouseManagement.vue
@@ -61,24 +61,10 @@
export default {
data() {
return {
- // href: '',
- // gv: {},
// resinfo: ''
}
},
- onLoad() {
- this.initData()
- },
methods: {
- initData() {
- this.gv = getApp().globalData
- console.log('hasLogin', this.$store.getters.hasLogin)
- console.log('token', this.$store.getters.token)
- console.log('uinfo', this.$store.getters.userinfo)
- console.log('uinfo-id', this.$store.getters.userinfo.userid)
- console.log('uinfo-name', this.$store.getters.userinfo.name)
- getApp().globalData.uinfo = this.$store.getters.userinfo
- },
// sayhello() {
// this.$api.sayhello({name:'mynameislll'}).then(res => {
// this.resinfo = res
diff --git a/supervise-uniapp/pages/index/demoReportKc.vue b/supervise-uniapp/pages/index/demoReportKc.vue
index 6311a034..630fbed4 100644
--- a/supervise-uniapp/pages/index/demoReportKc.vue
+++ b/supervise-uniapp/pages/index/demoReportKc.vue
@@ -204,7 +204,7 @@
components: {},
data() {
return {
- date: "2023-06-25",
+ date: "",
tableData1: [],
logInfo: {
title: "",
@@ -227,7 +227,7 @@
},
onLoad(option) {
- // this.date = option.orderDate
+ this.date = option.orderDate
this.getData()
diff --git a/supervise-uniapp/pages/login/login.vue b/supervise-uniapp/pages/login/login.vue
index 35c8b0a7..26a94d61 100644
--- a/supervise-uniapp/pages/login/login.vue
+++ b/supervise-uniapp/pages/login/login.vue
@@ -98,11 +98,11 @@
- ───── 第三方登录方式 ─────
+
@@ -210,15 +210,17 @@
}
console.log('MMMM:', resp)
- getApp().globalData = resp
- // getApp().globalData.username = uinfo.name
- // getApp().globalData.token = uinfo.token
- // getApp().globalData.sid = uinfo.sid
- // getApp().globalData.mobile = uinfo.mobile
- // getApp().globalData.name = uinfo.name
- // getApp().globalData.isAdmin = uinfo.isAdmin
- // getApp().globalData.roleName = uinfo.roleName
- // getApp().globalData.staffSid = uinfo.staffSid
+ // getApp().globalData = resp
+ uni.setStorageSync("Global-Auth-Token", uinfo.token)
+ getApp().globalData.username = uinfo.name
+ getApp().globalData.token = uinfo.token
+ getApp().globalData.sysUserSid = uinfo.sid
+ getApp().globalData.mobile = uinfo.mobile
+ getApp().globalData.name = uinfo.name
+ getApp().globalData.isAdmin = uinfo.isAdmin
+ getApp().globalData.roleName = uinfo.roleName
+ getApp().globalData.staffSid = uinfo.staffSid
+ getApp().globalData.isLogin= true
console.log('gd--:', getApp().globalData)
// uni.redirectTo({
// url: '/pages/index/index',
@@ -314,6 +316,14 @@
icon: 'none',
title: '暂不支持'
});
+ // if(!this.selectType){
+ // uni.showToast({
+ // icon: 'none',
+ // title: '请阅读并同意勾选"用户协议"和"隐私政策"'
+ // });
+ // return false;
+ // }
+ // this.WxAuthLogin();
},
},
@@ -430,6 +440,7 @@
}
.btn {
+ margin-bottom: 50px;
width: 70%;
margin-top: 35px;
border-radius: 5px;
diff --git a/supervise-uniapp/static/baseIcon/code.png b/supervise-uniapp/static/baseIcon/code.png
new file mode 100644
index 00000000..559c9844
Binary files /dev/null and b/supervise-uniapp/static/baseIcon/code.png differ
diff --git a/supervise-uniapp/static/baseIcon/username.png b/supervise-uniapp/static/baseIcon/username.png
new file mode 100644
index 00000000..ec7d054f
Binary files /dev/null and b/supervise-uniapp/static/baseIcon/username.png differ
diff --git a/yxt-portal-ui/src/api/system/userManage/index.js b/yxt-portal-ui/src/api/system/userManage/index.js
index c6503722..583b8aaf 100644
--- a/yxt-portal-ui/src/api/system/userManage/index.js
+++ b/yxt-portal-ui/src/api/system/userManage/index.js
@@ -3,136 +3,162 @@ import qs from 'qs'
// 用户列表
//let tokens = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTm8iOiI2IiwiaXNzIjoiV0JLIiwiZXhwIjoxNjI5OTQxNjI1fQ.aOFOz0h7c8YQs-ti2GLpqeWu4AE9mifx_043hLJQf8g'
let tokens = window.sessionStorage.getItem('token');
-export function userList(data){
+
+// 修改用户 微信公众号OpenId
+export function saveOpenId(data) {
+ return request({
+ url: '/portal/v1/sysuser/saveOpenId',
+ method: 'post',
+ data: data,
+ headers: {
+ 'Content-Type': 'application/json',
+ 'token': tokens
+ }
+ })
+}
+
+export function userList(data) {
return request({
url: '/portal/v1/sysuser/listPage',
method: 'post',
data: data,
- headers: {'Content-Type': 'application/json',
- 'token':tokens
+ headers: {
+ 'Content-Type': 'application/json',
+ 'token': tokens
}
})
}
// 新增
-export function userAdd(data){
+export function userAdd(data) {
return request({
url: '/portal/v1/sysuser/save',
method: 'post',
data: data,
- headers: {'Content-Type': 'application/json',
- 'token':tokens
+ headers: {
+ 'Content-Type': 'application/json',
+ 'token': tokens
}
})
}
// 更新
-export function userUpdata(data){
+export function userUpdata(data) {
return request({
- url: '/portal/v1/sysuser/update/' +data.sid,
+ url: '/portal/v1/sysuser/update/' + data.sid,
method: 'post',
data: data,
- headers: {'Content-Type': 'application/json',
- 'token':tokens
+ headers: {
+ 'Content-Type': 'application/json',
+ 'token': tokens
}
})
}
// 删除
-export function delUser(data){
+export function delUser(data) {
return request({
- url: '/portal/v1/sysuser/delBySid/' +data.sid,
+ url: '/portal/v1/sysuser/delBySid/' + data.sid,
method: 'get',
data: data,
- headers: {'Content-Type': 'application/json',
- 'token':tokens
+ headers: {
+ 'Content-Type': 'application/json',
+ 'token': tokens
}
})
}
// 初始化密码
-export function initPwd(data){
+export function initPwd(data) {
return request({
- url: '/portal/v1/sysuser/initPwd/' +data.sid,
+ url: '/portal/v1/sysuser/initPwd/' + data.sid,
method: 'post',
data: data,
- headers: {'Content-Type': 'application/json',
- 'token':tokens
+ headers: {
+ 'Content-Type': 'application/json',
+ 'token': tokens
}
})
}
// 根据sid查询一条信息
-export function userSingle(data){
+export function userSingle(data) {
return request({
- url: '/portal/v1/sysuser/fetchBySid/' +data.sid,
+ url: '/portal/v1/sysuser/fetchBySid/' + data.sid,
method: 'get',
data: data,
- headers: {'Content-Type': 'application/json',
- 'token':tokens
+ headers: {
+ 'Content-Type': 'application/json',
+ 'token': tokens
}
})
}
// 单条用户的角色列表
-export function setRole(data){
+export function setRole(data) {
return request({
- url: '/portal/v1/sysrole/listAllByUserSid/' +data.sid,
+ url: '/portal/v1/sysrole/listAllByUserSid/' + data.sid,
method: 'post',
data: data,
- headers: {'Content-Type': 'application/json',
- 'token':tokens
+ headers: {
+ 'Content-Type': 'application/json',
+ 'token': tokens
}
})
}
// 角色列表
-export function saveOrgRole(data){
+export function saveOrgRole(data) {
return request({
url: '/portal/v1/sysuserrole/update',
method: 'post',
data: data,
- headers: {'Content-Type': 'application/json',
- 'token':tokens
+ headers: {
+ 'Content-Type': 'application/json',
+ 'token': tokens
}
})
}
// 查询角色列表
-export function roleList(data){
+export function roleList(data) {
return request({
url: '/portal/v1/sysrole/listAll',
method: 'post',
data: data,
- headers: {'Content-Type': 'application/json',
- 'token':tokens
+ headers: {
+ 'Content-Type': 'application/json',
+ 'token': tokens
}
})
}
// 查询部门列表
-export function orgList(data){
+export function orgList(data) {
return request({
url: '/portal/v1/sysorganization/list',
method: 'get',
data: data,
- headers: {'Content-Type': 'application/json',
- 'token':tokens
+ headers: {
+ 'Content-Type': 'application/json',
+ 'token': tokens
}
})
}
// 查询岗位列表
-export function postList(data){
+export function postList(data) {
return request({
- url: '/portal/v1/syspost/fetchByOrgSid/'+data.sid,
+ url: '/portal/v1/syspost/fetchByOrgSid/' + data.sid,
method: 'get',
data: data,
- headers: {'Content-Type': 'application/json',
- 'token':tokens
+ headers: {
+ 'Content-Type': 'application/json',
+ 'token': tokens
}
})
}
// 获取验证码
-export function getCode(data){
+export function getCode(data) {
return request({
- url: '/portal/v1/sysuser/sendMessageCode/'+data.phone,
+ url: '/portal/v1/sysuser/sendMessageCode/' + data.phone,
method: 'get',
data: data,
- headers: {'Content-Type': 'application/json',
- 'token':tokens
+ headers: {
+ 'Content-Type': 'application/json',
+ 'token': tokens
}
})
}
diff --git a/yxt-portal-ui/src/views/userManage/userManageList.vue b/yxt-portal-ui/src/views/userManage/userManageList.vue
index 2bf9b532..e57db29b 100644
--- a/yxt-portal-ui/src/views/userManage/userManageList.vue
+++ b/yxt-portal-ui/src/views/userManage/userManageList.vue
@@ -15,12 +15,12 @@
-
-
-
-
-
-
+
+
+
+
+
查询
@@ -43,29 +43,24 @@
-->
-
+
{{ scope.row.userName }}
-
-
-
-
-
+
+
+
-
-
+
+
+ 保存
+
-
+
@@ -92,12 +87,9 @@
:value="item.departmentSid"
>
-->
-
+
+ icon="el-icon-plus">