|
@@ -159,63 +159,64 @@
|
|
|
}
|
|
|
|
|
|
let that = this;
|
|
|
- console.log('------- photo -------');
|
|
|
- console.log(this.photo);
|
|
|
+ // console.log('------- photo -------');
|
|
|
+ // console.log(this.photo);
|
|
|
let formData = new FormData();
|
|
|
formData.append('file', this.photo);
|
|
|
BasicFunction.get_data("fileserver/upload?sign=abcdefg", function (res) {
|
|
|
- console.log('----- upload photo result -----');
|
|
|
- console.log(res);
|
|
|
+ // console.log('----- upload photo result -----');
|
|
|
+ // console.log(res);
|
|
|
if (res.ret === '10000') {
|
|
|
let imgURL = res.model; // TODO: 把imgurl也加入用户信息
|
|
|
let userId = localStorage.getItem('frontend-userid');
|
|
|
- let useridentity = {
|
|
|
- reviewId: "",
|
|
|
- userId: userId,
|
|
|
- userWxAccount: that.wechat,
|
|
|
- dormDistrict: that.dorId,
|
|
|
- userSex: parseInt(that.radio),
|
|
|
- userSchoolCard: 111111,
|
|
|
- userSchoolCardPic: imgURL,
|
|
|
- userReviewStatus: 100,
|
|
|
- reviewerId: 1,
|
|
|
- reviewerNote: "未审核",
|
|
|
- reviewerNoteToUser: "未审核"
|
|
|
- };
|
|
|
- console.log('----- User Identity -----');
|
|
|
- BasicFunction.get_data("smartIdentity/saveBatch", function (response) {
|
|
|
- console.log(useridentity);
|
|
|
- console.log(response);
|
|
|
- if (response.ret === "10000") {
|
|
|
- console.log('----- User Info -----');
|
|
|
- BasicFunction.get_data('smartUsers/list?uid=' + userId, function (res) {
|
|
|
- console.log(res);
|
|
|
- if (res.ret === '10000') {
|
|
|
- let user = res.model.list[0];
|
|
|
- user.name = that.username;
|
|
|
- user.phone = that.phone;
|
|
|
- console.log('----- Update User Info -----');
|
|
|
- console.log(user);
|
|
|
- BasicFunction.get_data('smartUsers/updateBatch', function (res) {
|
|
|
- console.log(res);
|
|
|
+ // console.log('----- User Identity -----');
|
|
|
+ BasicFunction.get_data("smartIdentity/list?userId=" + userId, function (res) {
|
|
|
+ if (res.ret === '10000') {
|
|
|
+ let useridentity = res.model.list[0];
|
|
|
+ useridentity.userWxAccount = that.wechat;
|
|
|
+ useridentity.dormDistrict = that.dorId;
|
|
|
+ useridentity.userSex = parseInt(that.radio);
|
|
|
+ useridentity.userSchoolCardPic = imgURL;
|
|
|
+ useridentity.userReviewStatus = 100;
|
|
|
+ useridentity.reviewerNote = "未审核";
|
|
|
+ useridentity.reviewerNoteToUser = "未审核";
|
|
|
+ BasicFunction.get_data("smartIdentity/updateBatch", function (response) {
|
|
|
+ // console.log(useridentity);
|
|
|
+ // console.log(response);
|
|
|
+ if (response.ret === "10000") {
|
|
|
+ // console.log('----- User Info -----');
|
|
|
+ BasicFunction.get_data('smartUsers/list?uid=' + userId, function (res) {
|
|
|
+ // console.log(res);
|
|
|
if (res.ret === '10000') {
|
|
|
- Toast.success("注册成功");
|
|
|
- that.$router.push('presentRegister');
|
|
|
+ let user = res.model.list[0];
|
|
|
+ user.name = that.username;
|
|
|
+ user.phone = that.phone;
|
|
|
+ // console.log('----- Update User Info -----');
|
|
|
+ // console.log(user);
|
|
|
+ BasicFunction.get_data('smartUsers/updateBatch', function (res) {
|
|
|
+ // console.log(res);
|
|
|
+ if (res.ret === '10000') {
|
|
|
+ Toast.success("注册成功");
|
|
|
+ that.$router.push('presentRegister');
|
|
|
+ } else {
|
|
|
+ Toast.fail('注册失败');
|
|
|
+ that.loading = false;
|
|
|
+ }
|
|
|
+ }, [user]);
|
|
|
} else {
|
|
|
- Toast.fail('注册失败');
|
|
|
+ Toast.fail('获取用户信息失败');
|
|
|
that.loading = false;
|
|
|
}
|
|
|
- }, [user]);
|
|
|
+ }, {});
|
|
|
} else {
|
|
|
- Toast.fail('获取用户信息失败');
|
|
|
+ Toast.fail("注册失败,请检查网络");
|
|
|
that.loading = false;
|
|
|
}
|
|
|
- }, {});
|
|
|
+ }, [useridentity]);
|
|
|
} else {
|
|
|
- Toast.fail("注册失败,请检查网络");
|
|
|
- that.loading = false;
|
|
|
+ Toast.fail('获取信息失败');
|
|
|
}
|
|
|
- }, [useridentity]);
|
|
|
+ }, {});
|
|
|
} else {
|
|
|
Toast.fail('上传图片失败,请检查网络');
|
|
|
that.loading = false;
|
|
@@ -236,8 +237,8 @@
|
|
|
let userid = localStorage.getItem('frontend-userid');
|
|
|
let that = this;
|
|
|
BasicFunction.get_data('smartUsers/list?uid=' + userid, function (res) {
|
|
|
- console.log('----- User Info ----- ' + userid);
|
|
|
- console.log(res);
|
|
|
+ // console.log('----- User Info ----- ' + userid);
|
|
|
+ // console.log(res);
|
|
|
if (res.ret === '10000') {
|
|
|
if (res.model.list[0].phone.length !== 0) that.$router.push('presentRegister');
|
|
|
}
|