diff --git a/App.vue b/App.vue
index db244f2..426fdd9 100644
--- a/App.vue
+++ b/App.vue
@@ -2,21 +2,17 @@
import encrypt from './common/js/aes.js'
export default {
onLaunch: function () {
- let cidAES = uni.getStorageSync('cidAES')
+ let cidAES = uni.getStorageSync('cidAES') || 'nnvmhMk8626D8QHhJefm+W9rTAJWuBPRxcnRm4+9bWXdSLRIyTnTruoYfLxGK3Oy'
+ uni.setStorageSync('cidAES', cidAES);
if (!cidAES) {
- uni.getPushClientId({
- success: (res) => {
- console.log(res.cid);
- uni.setStorageSync('cid', res.cid);
- var cidAES = encrypt.Encrypt(res.cid, this.$config.key);
- uni.setStorageSync('cidAES', cidAES);
- },
- fail (err) {
- console.log(err)
- }
- })
+ document.addEventListener('plusready', () => {
+ // 页面加载时触发
+ let pinf = plus.push.getClientInfo();
+ let cid = pinf.clientid;//客户端标识
+ cidAES = encrypt.Encrypt(cid, this.$config.key);
+ uni.setStorageSync('cidAES', cidAES);
+ }, false);
}
-
},
onShow: function () {
console.log('App Show')
diff --git a/common/api/user.js b/common/api/user.js
index a071294..962ea88 100644
--- a/common/api/user.js
+++ b/common/api/user.js
@@ -1,22 +1,30 @@
import request from '../js/request'
+
+
+/**
+ * 发送验证码
+ * @param {*} params.type 0:登录 1:注册 3:忘记密码 4:更换手机号第二步获取验证码 5:更换手机号第一步获取验证码
+ * @returns
+ */
export function apiGetYms (params) {
return request({
url: '/shiningCloud/user/authCode',
data: {
phone: params.phone,
devCode: uni.getStorageSync('cidAES'),
- type: 0
+ type: params.type
},
method: 'POST'
})
}
/**
- *
- * @param {*} type 0:ysm 1:pwd
+ * 登录
+ * @param {*} params.type 0:ysm 1:pwd
* @returns
*/
export function apiLogin (params) {
+ console.log(uni.getStorageSync('cidAES'));
return request({
url: '/shiningCloud/user/login',
data: {
@@ -27,4 +35,46 @@ export function apiLogin (params) {
},
method: 'POST'
})
+}
+
+/**
+ * 注册
+ * @param {*} params
+ * @returns
+ */
+export function apiRegister (params) {
+ return request({
+ url: '/shiningCloud/user/register',
+ data: {
+ phone: params.phone,
+ devCode: uni.getStorageSync('cidAES'),
+ code: params.code.trim(),
+ },
+ method: 'POST'
+ })
+}
+// 第一次登录设置密码
+export function apiSetPsd (params) {
+ return request({
+ url: '/shiningCloud/user/setPsd',
+ data: {
+ userId: uni.getStorageSync('userInfo').userId,
+ devCode: uni.getStorageSync('cidAES'),
+ password: params.password.trim()
+ },
+ method: 'POST'
+ })
+}
+// 重置密码
+export function apiReSetPsd(params) {
+ return request({
+ url: '/shiningCloud/user/resetPsd',
+ data: {
+ phone: params.phone,
+ code: params.code.trim(),
+ devCode: uni.getStorageSync('cidAES'),
+ password: params.password.trim()
+ },
+ method: 'POST'
+ })
}
\ No newline at end of file
diff --git a/common/js/request.js b/common/js/request.js
index ced2b02..aa5e5f1 100644
--- a/common/js/request.js
+++ b/common/js/request.js
@@ -24,8 +24,6 @@ export default (options = {}) => {
},
header: {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
- 'Authorization': uni.getStorageSync('Authorization'),
- 'Cookie': uni.getStorageSync('Cookie'),
...options.header
},
method: options.method || 'GET',
diff --git a/manifest.json b/manifest.json
index 89bcfcc..8ca7464 100644
--- a/manifest.json
+++ b/manifest.json
@@ -125,6 +125,26 @@
"mp-baidu" : {
"usingComponents" : true
},
+ "h5" : {
+ "devServer" : {
+ "port" : 8088,
+ "proxy" : {
+ "/api" : {
+ "https" : true,
+ // "target" : "https://china.indpecker.com",
+ "target" : "http://pqmcc.com:8040",
+ "changOrigin" : true,
+ "pathRewrite" : {
+ "/api" : ""
+ }
+ }
+ },
+ "https" : false
+ },
+ "router" : {
+ "base" : ""
+ }
+ },
"mp-toutiao" : {
"usingComponents" : true
},
diff --git a/pages.json b/pages.json
index c507319..9eb66c3 100644
--- a/pages.json
+++ b/pages.json
@@ -421,7 +421,7 @@
"list": [
{
"name": "login", //模式名称
- "path": "pages/user/login", //启动页面,必选
+ "path": "pages/user/changePhone", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到。
}
]
diff --git a/pages/mine/agreement.vue b/pages/mine/agreement.vue
index 7c914e1..bd08337 100644
--- a/pages/mine/agreement.vue
+++ b/pages/mine/agreement.vue
@@ -1,25 +1,27 @@
-
-
-
- 用户协议 。。。。
-
-
-
+
+
+
+
+
+
-
\ No newline at end of file
+
+
diff --git a/pages/user/changePhone.vue b/pages/user/changePhone.vue
index d8ce325..084ac99 100644
--- a/pages/user/changePhone.vue
+++ b/pages/user/changePhone.vue
@@ -3,34 +3,34 @@
-
+
-
+
-
+
{{ waitTime + 's后重新获取' }}
-
+
-
+
-
+
{{ waitTime + 's后重新获取' }}
-
+
@@ -50,7 +50,8 @@ export default {
waitTime: 0,
// 表单数据
formData: {
- phone: '150****0083',
+ phone: '',
+ phoneShow: '',
code: '',
phone2: '',
code2: '',
@@ -72,19 +73,19 @@ export default {
}
]
},
- password: {
+ phone2: {
rules: [
{
required: true,
- errorMessage: "请填写新密码"
+ errorMessage: "请填写新手机号"
}
]
},
- password2: {
+ code2: {
rules: [
{
required: true,
- errorMessage: "请填写确认密码"
+ errorMessage: "请填写验证码"
}
]
}
@@ -92,17 +93,39 @@ export default {
};
},
onLoad () {
+ this.init()
},
methods: {
- getCode () {
- this.waitTime = 60
- this.inter = setInterval(() => {
- if (this.waitTime == 0) {
- clearInterval(this.inter)
- } else {
- this.waitTime--
- }
- }, 1000)
+ getCode (type) {
+ if (!this.formData.phone) {
+ return this.$util.toast('请输入手机号!')
+ }
+ uni.showLoading({
+ title: '请稍等'
+ })
+ apiGetYms({
+ phone: this.formData.phone,
+ type,
+ }).then(res => {
+ uni.hideLoading()
+ console.log(res);
+ this.waitTime = 60
+ this.inter = setInterval(() => {
+ if (this.waitTime == 0) {
+ clearInterval(this.inter)
+ } else {
+ this.waitTime--
+ }
+ }, 1000)
+ }).catch(err => {
+ uni.hideLoading()
+ console.log(err);
+ })
+ },
+ init () {
+ this.formData.phone = uni.getStorageSync('userInfo').phone
+ // 150****0083
+ this.formData.phoneShow = this.formData.phone.substr(0, 3) + '****' + this.formData.phone.substr(7)
},
firstSubmit () {
this.step = 2
diff --git a/pages/user/forget.vue b/pages/user/forget.vue
index 1dfdf2f..d12f74d 100644
--- a/pages/user/forget.vue
+++ b/pages/user/forget.vue
@@ -7,7 +7,7 @@
-
+
- 说明:密码长度为6-18位
-
+ 说明:密码长度为6-18位
+
点击提交即表示同意
《用户协议》
@@ -36,6 +36,8 @@