diff --git a/api/mine.js b/api/mine.js new file mode 100644 index 0000000..7a536f3 --- /dev/null +++ b/api/mine.js @@ -0,0 +1,20 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; + +const USER_REGISTER = BASE_URL + '/webserver/userInfo/saveUserRegInfo.do' +const USER_LOGIN = BASE_URL + '/webserver/userInfo/verifyUserLoginInfo.do' +const USER_UPDATE = BASE_URL + '/webserver/userInfo/modifyPersonPassword.do' +// 用户注册 +export function registerUser(data) { + return fetch.post(USER_REGISTER, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 用户登录 +export function loginUser(data) { + return fetch.post(USER_LOGIN, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 用户修改密码 +export function updateUser(data) { + return fetch.post(USER_UPDATE, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} + + diff --git a/api/mine.js b/api/mine.js new file mode 100644 index 0000000..7a536f3 --- /dev/null +++ b/api/mine.js @@ -0,0 +1,20 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; + +const USER_REGISTER = BASE_URL + '/webserver/userInfo/saveUserRegInfo.do' +const USER_LOGIN = BASE_URL + '/webserver/userInfo/verifyUserLoginInfo.do' +const USER_UPDATE = BASE_URL + '/webserver/userInfo/modifyPersonPassword.do' +// 用户注册 +export function registerUser(data) { + return fetch.post(USER_REGISTER, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 用户登录 +export function loginUser(data) { + return fetch.post(USER_LOGIN, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 用户修改密码 +export function updateUser(data) { + return fetch.post(USER_UPDATE, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} + + diff --git a/api/tort.js b/api/tort.js index 934496e..60a4e54 100644 --- a/api/tort.js +++ b/api/tort.js @@ -8,6 +8,8 @@ // const OTHER_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' // const SPECIAL_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' const GET_CODE_URL = BASE_URL + '/webserver/captchaController/generateVerifyCodeOfReport.do' +const REPORT_LIST = BASE_URL + '/webserver/reportInfo/queryPersonReportedInfo.do' +const REPORT_DETAIL = BASE_URL + '/webserver/reportInfos/shortcutQueryReportInfo.do' /** * 生成网址、网址转换 * @param {*} // url: '' @@ -40,5 +42,13 @@ } return fetch.get(GET_CODE_URL, data).then(res => res); } +// 举报列表 +export function getReportList(data) { + return fetch.post(REPORT_LIST, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 举报详情 +export function getReportDetail(data) { + return fetch.post(REPORT_DETAIL, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} diff --git a/api/mine.js b/api/mine.js new file mode 100644 index 0000000..7a536f3 --- /dev/null +++ b/api/mine.js @@ -0,0 +1,20 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; + +const USER_REGISTER = BASE_URL + '/webserver/userInfo/saveUserRegInfo.do' +const USER_LOGIN = BASE_URL + '/webserver/userInfo/verifyUserLoginInfo.do' +const USER_UPDATE = BASE_URL + '/webserver/userInfo/modifyPersonPassword.do' +// 用户注册 +export function registerUser(data) { + return fetch.post(USER_REGISTER, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 用户登录 +export function loginUser(data) { + return fetch.post(USER_LOGIN, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 用户修改密码 +export function updateUser(data) { + return fetch.post(USER_UPDATE, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} + + diff --git a/api/tort.js b/api/tort.js index 934496e..60a4e54 100644 --- a/api/tort.js +++ b/api/tort.js @@ -8,6 +8,8 @@ // const OTHER_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' // const SPECIAL_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' const GET_CODE_URL = BASE_URL + '/webserver/captchaController/generateVerifyCodeOfReport.do' +const REPORT_LIST = BASE_URL + '/webserver/reportInfo/queryPersonReportedInfo.do' +const REPORT_DETAIL = BASE_URL + '/webserver/reportInfos/shortcutQueryReportInfo.do' /** * 生成网址、网址转换 * @param {*} // url: '' @@ -40,5 +42,13 @@ } return fetch.get(GET_CODE_URL, data).then(res => res); } +// 举报列表 +export function getReportList(data) { + return fetch.post(REPORT_LIST, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 举报详情 +export function getReportDetail(data) { + return fetch.post(REPORT_DETAIL, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} diff --git a/common/fetch.js b/common/fetch.js index 0747653..ba307c4 100644 --- a/common/fetch.js +++ b/common/fetch.js @@ -16,7 +16,7 @@ '103':'验证码超时', } function fetch(method) { - return function (url, data, otherParams = {}) { + return function (url, data, otherParams = {}, headers = {}) { // if (method === 'POST' || method === 'PUT') { // data = { // param: data, @@ -31,14 +31,19 @@ data, header: { token: sessionId, + ...headers, }, success(data) { if (data.statusCode === 200) { - if (data.data.status === 1 || data.data.code === 200) { + if (data.data.status === 1 || data.data.code === 200 || data.data.status ==='1') { if(data.data.message === '网址未重复') { wx.setStorageSync('isRepeat', 'false') } - resolve(data.data.data); + if (data.data.status === 1) { + resolve(data.data.data ? data.data.data : data.data); + } else { + resolve(data.data.data); + } } else if( data.data.status === 103 || data.data.status === 3 || data.data.status === 2 ||data.data.status === 4 || diff --git a/api/mine.js b/api/mine.js new file mode 100644 index 0000000..7a536f3 --- /dev/null +++ b/api/mine.js @@ -0,0 +1,20 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; + +const USER_REGISTER = BASE_URL + '/webserver/userInfo/saveUserRegInfo.do' +const USER_LOGIN = BASE_URL + '/webserver/userInfo/verifyUserLoginInfo.do' +const USER_UPDATE = BASE_URL + '/webserver/userInfo/modifyPersonPassword.do' +// 用户注册 +export function registerUser(data) { + return fetch.post(USER_REGISTER, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 用户登录 +export function loginUser(data) { + return fetch.post(USER_LOGIN, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 用户修改密码 +export function updateUser(data) { + return fetch.post(USER_UPDATE, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} + + diff --git a/api/tort.js b/api/tort.js index 934496e..60a4e54 100644 --- a/api/tort.js +++ b/api/tort.js @@ -8,6 +8,8 @@ // const OTHER_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' // const SPECIAL_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' const GET_CODE_URL = BASE_URL + '/webserver/captchaController/generateVerifyCodeOfReport.do' +const REPORT_LIST = BASE_URL + '/webserver/reportInfo/queryPersonReportedInfo.do' +const REPORT_DETAIL = BASE_URL + '/webserver/reportInfos/shortcutQueryReportInfo.do' /** * 生成网址、网址转换 * @param {*} // url: '' @@ -40,5 +42,13 @@ } return fetch.get(GET_CODE_URL, data).then(res => res); } +// 举报列表 +export function getReportList(data) { + return fetch.post(REPORT_LIST, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 举报详情 +export function getReportDetail(data) { + return fetch.post(REPORT_DETAIL, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} diff --git a/common/fetch.js b/common/fetch.js index 0747653..ba307c4 100644 --- a/common/fetch.js +++ b/common/fetch.js @@ -16,7 +16,7 @@ '103':'验证码超时', } function fetch(method) { - return function (url, data, otherParams = {}) { + return function (url, data, otherParams = {}, headers = {}) { // if (method === 'POST' || method === 'PUT') { // data = { // param: data, @@ -31,14 +31,19 @@ data, header: { token: sessionId, + ...headers, }, success(data) { if (data.statusCode === 200) { - if (data.data.status === 1 || data.data.code === 200) { + if (data.data.status === 1 || data.data.code === 200 || data.data.status ==='1') { if(data.data.message === '网址未重复') { wx.setStorageSync('isRepeat', 'false') } - resolve(data.data.data); + if (data.data.status === 1) { + resolve(data.data.data ? data.data.data : data.data); + } else { + resolve(data.data.data); + } } else if( data.data.status === 103 || data.data.status === 3 || data.data.status === 2 ||data.data.status === 4 || diff --git a/components/card.vue b/components/card.vue index 6b118d5..b284762 100644 --- a/components/card.vue +++ b/components/card.vue @@ -120,10 +120,11 @@ deep:true, handler(newVal){ if (this.currentShow) { + const userinfo = wx.getStorageSync('userInfoxj') // this.isVoteFlag = false const params = { rumorId:this.currentShow.id, // id - votePerson:localStorage.getItem('userIdentifying') // 用户唯一标识 + votePerson:userinfo.phone ?userinfo.phone : '123' // 用户唯一标识 } // 查询用户是否投票 isVote(params).then(res => { @@ -138,9 +139,10 @@ methods: { // 点击真假进行投票 vote(flag) { + const userinfo = wx.getStorageSync('userInfoxj') const params = { rumorId:this.currentShow.id, - votePerson:localStorage.getItem('userIdentifying'), // 用户唯一标识 + votePerson:userinfo.phone ?userinfo.phone : '123', // 用户唯一标识 status: flag ? '1' : '0' } addVote(params).then(res => { diff --git a/api/mine.js b/api/mine.js new file mode 100644 index 0000000..7a536f3 --- /dev/null +++ b/api/mine.js @@ -0,0 +1,20 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; + +const USER_REGISTER = BASE_URL + '/webserver/userInfo/saveUserRegInfo.do' +const USER_LOGIN = BASE_URL + '/webserver/userInfo/verifyUserLoginInfo.do' +const USER_UPDATE = BASE_URL + '/webserver/userInfo/modifyPersonPassword.do' +// 用户注册 +export function registerUser(data) { + return fetch.post(USER_REGISTER, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 用户登录 +export function loginUser(data) { + return fetch.post(USER_LOGIN, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 用户修改密码 +export function updateUser(data) { + return fetch.post(USER_UPDATE, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} + + diff --git a/api/tort.js b/api/tort.js index 934496e..60a4e54 100644 --- a/api/tort.js +++ b/api/tort.js @@ -8,6 +8,8 @@ // const OTHER_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' // const SPECIAL_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' const GET_CODE_URL = BASE_URL + '/webserver/captchaController/generateVerifyCodeOfReport.do' +const REPORT_LIST = BASE_URL + '/webserver/reportInfo/queryPersonReportedInfo.do' +const REPORT_DETAIL = BASE_URL + '/webserver/reportInfos/shortcutQueryReportInfo.do' /** * 生成网址、网址转换 * @param {*} // url: '' @@ -40,5 +42,13 @@ } return fetch.get(GET_CODE_URL, data).then(res => res); } +// 举报列表 +export function getReportList(data) { + return fetch.post(REPORT_LIST, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 举报详情 +export function getReportDetail(data) { + return fetch.post(REPORT_DETAIL, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} diff --git a/common/fetch.js b/common/fetch.js index 0747653..ba307c4 100644 --- a/common/fetch.js +++ b/common/fetch.js @@ -16,7 +16,7 @@ '103':'验证码超时', } function fetch(method) { - return function (url, data, otherParams = {}) { + return function (url, data, otherParams = {}, headers = {}) { // if (method === 'POST' || method === 'PUT') { // data = { // param: data, @@ -31,14 +31,19 @@ data, header: { token: sessionId, + ...headers, }, success(data) { if (data.statusCode === 200) { - if (data.data.status === 1 || data.data.code === 200) { + if (data.data.status === 1 || data.data.code === 200 || data.data.status ==='1') { if(data.data.message === '网址未重复') { wx.setStorageSync('isRepeat', 'false') } - resolve(data.data.data); + if (data.data.status === 1) { + resolve(data.data.data ? data.data.data : data.data); + } else { + resolve(data.data.data); + } } else if( data.data.status === 103 || data.data.status === 3 || data.data.status === 2 ||data.data.status === 4 || diff --git a/components/card.vue b/components/card.vue index 6b118d5..b284762 100644 --- a/components/card.vue +++ b/components/card.vue @@ -120,10 +120,11 @@ deep:true, handler(newVal){ if (this.currentShow) { + const userinfo = wx.getStorageSync('userInfoxj') // this.isVoteFlag = false const params = { rumorId:this.currentShow.id, // id - votePerson:localStorage.getItem('userIdentifying') // 用户唯一标识 + votePerson:userinfo.phone ?userinfo.phone : '123' // 用户唯一标识 } // 查询用户是否投票 isVote(params).then(res => { @@ -138,9 +139,10 @@ methods: { // 点击真假进行投票 vote(flag) { + const userinfo = wx.getStorageSync('userInfoxj') const params = { rumorId:this.currentShow.id, - votePerson:localStorage.getItem('userIdentifying'), // 用户唯一标识 + votePerson:userinfo.phone ?userinfo.phone : '123', // 用户唯一标识 status: flag ? '1' : '0' } addVote(params).then(res => { diff --git a/packageA/accountBound/accountBound.vue b/packageA/accountBound/accountBound.vue index 0c822b3..c856add 100644 --- a/packageA/accountBound/accountBound.vue +++ b/packageA/accountBound/accountBound.vue @@ -33,20 +33,30 @@ border="none" > - + + 确定 + + + + 还没账号?去注册 + +