From ac8d7378aed1faaeea5d7d9efc9a496cf1337574 Mon Sep 17 00:00:00 2001 From: congzc Date: Tue, 12 Sep 2023 15:06:49 +0800 Subject: [PATCH 1/7] 1 --- README.md | 2 +- src/api/closeStyle.js | 2 +- src/api/coin.js | 2 +- src/api/createing.js | 2 +- src/api/home.js | 2 +- src/api/login.js | 24 ++- src/api/lookPhoto.js | 2 +- src/api/uploadphoto.js | 2 +- src/manifest.json | 3 +- src/pages/closeStyle/multiplayer.vue | 7 +- src/pages/login/index.vue | 226 +++++++++++++++++++++++++- src/pages/lookPhoto/index.vue | 2 +- src/pages/uploadPhoto/uploadPhoto.vue | 89 ++++++++-- src/store/modules/userInfo.js | 11 +- src/utils/request.js | 2 +- 15 files changed, 344 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 1e3a9ca..b9c19e8 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ -"appid": "wx75cf14e3a0d45821", +wx-"appid": "wx75cf14e3a0d45821", git commit -m "feat: " git commit --no-verify -m "提交时的注释" 跳过检验 diff --git a/src/api/closeStyle.js b/src/api/closeStyle.js index 5bad618..c2101ea 100644 --- a/src/api/closeStyle.js +++ b/src/api/closeStyle.js @@ -1,4 +1,4 @@ -import request from "../utils/request" +import { request } from "../utils/request" // 获取风格列表 export function getListApi(pageNum, pageSize) { diff --git a/src/api/coin.js b/src/api/coin.js index 2cec1eb..ebe9d6b 100644 --- a/src/api/coin.js +++ b/src/api/coin.js @@ -1,4 +1,4 @@ -import request from "../utils/request" +import { request } from "../utils/request" /** * @description:获取金币价格列表 diff --git a/src/api/createing.js b/src/api/createing.js index dd736c8..e706c3d 100644 --- a/src/api/createing.js +++ b/src/api/createing.js @@ -1,4 +1,4 @@ -import request from "../utils/request" +import { request } from "../utils/request" // 获取风格列表 export function findWorkByIdApi(id) { diff --git a/src/api/home.js b/src/api/home.js index bef45f6..db87b83 100644 --- a/src/api/home.js +++ b/src/api/home.js @@ -1,4 +1,4 @@ -import request from "../utils/request" +import { request } from "../utils/request" /** * @description:获取用户头像 diff --git a/src/api/login.js b/src/api/login.js index 9e241ca..d8acf3f 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -1,4 +1,4 @@ -import request from "../utils/request" +import { request } from "../utils/request" export function voiceTotalApi() { return request({ @@ -22,4 +22,26 @@ export function loginPhoneApi(data) { method: 'POST', data }) +} + +// 获取短信验证码 +export function getCodeApi(phone) { + return request({ + url: `api/user/sendLoginPhoneCode?phone=${phone}`, + method: 'get', + }) +} + + +/** +* @description:短信登录 +* @param {*} (appId, openId,phone,code) +* @return: list +*/ +export function loginByCodeApi(data) { + return request({ + url: `api/miniApp/loginPhoneCode`, + method: 'POST', + data + }) } \ No newline at end of file diff --git a/src/api/lookPhoto.js b/src/api/lookPhoto.js index a41a8ac..7a07bdc 100644 --- a/src/api/lookPhoto.js +++ b/src/api/lookPhoto.js @@ -1,4 +1,4 @@ -import request from "../utils/request" +import { request } from "../utils/request" /** diff --git a/src/api/uploadphoto.js b/src/api/uploadphoto.js index c0ada9f..7006a54 100644 --- a/src/api/uploadphoto.js +++ b/src/api/uploadphoto.js @@ -1,4 +1,4 @@ -import request from "../utils/request" +import { request } from "../utils/request" // /api/baidu/checkPhoto // /api/userDigital/checkPhoto diff --git a/src/manifest.json b/src/manifest.json index d3d1d0c..d8babf8 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -80,7 +80,8 @@ "usingComponents": true }, "mp-toutiao": { - "usingComponents": true + "usingComponents": true, + "appid": "tt2eba5807b1883f9f01" }, "uniStatistics": { "enable": false diff --git a/src/pages/closeStyle/multiplayer.vue b/src/pages/closeStyle/multiplayer.vue index 207cbd3..bf54483 100644 --- a/src/pages/closeStyle/multiplayer.vue +++ b/src/pages/closeStyle/multiplayer.vue @@ -106,6 +106,7 @@ //#region 导入 import { ref, reactive } from "vue"; import { onLoad } from "@dcloudio/uni-app"; +import { BASE_URL } from "@/utils/request"; import { findByIdApi, findImageApi, @@ -194,7 +195,7 @@ function chooseImg(index) { }); // 百度敏感信息检测 uni.uploadFile({ - url: "https://test.metavatar.cc/C/api/baidu/checkPhoto", //上传图片api + url: BASE_URL + "api/baidu/checkPhoto", //上传图片api filePath: res.tempFilePaths[0], name: "file", formData: { @@ -215,7 +216,7 @@ function chooseImg(index) { } else { // 人脸识别接口 uni.uploadFile({ - url: "https://test.metavatar.cc/C/api/userDigital/checkPhoto", //上传图片api + url: BASE_URL + "api/userDigital/checkPhoto", //上传图片api filePath: res.tempFilePaths[0], name: "file", formData: { @@ -236,7 +237,7 @@ function chooseImg(index) { } else { // 上传接口 uni.uploadFile({ - url: "https://test.metavatar.cc/C/api/upload/awsImgUpload", //上传图片api + url: BASE_URL + "api/upload/awsImgUpload", //上传图片api filePath: res.tempFilePaths[0], name: "file", formData: { diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue index b734ffa..18b950c 100644 --- a/src/pages/login/index.vue +++ b/src/pages/login/index.vue @@ -20,7 +20,7 @@ + + + + + + + + + + + + + + + {{ backwardsNum < 60 ? backwardsNum : "发送验证码" }} + + + + + + + 登录 + @@ -66,7 +128,12 @@ //#region 导入 import { ref, reactive, computed } from "vue"; import { onLoad } from "@dcloudio/uni-app"; -import { voiceTotalApi, loginPhoneApi } from "../../api/login.js"; +import { + voiceTotalApi, + loginPhoneApi, + getCodeApi, + loginByCodeApi, +} from "../../api/login.js"; import { userInfoModules } from "@/store/modules/userInfo"; //#endregion const userInfoModulesPinia = userInfoModules(); @@ -89,12 +156,13 @@ function changedCheckbox(e) { console.log(e); } -async function getphonenumber(e) { - console.log(e); +async function dogetphonenumber(e) { + console.log(e, "e"); if (e.detail.errMsg.includes("ok")) { + // if (e.detail.errMsg.includes("fail")) { //用户授权了手机号 const data = { - appId: "wx75cf14e3a0d45821", + appId: userInfoModulesPinia.getAppId(), openId: userInfoModulesPinia.openId, encryptedData: e.detail.encryptedData, iv: e.detail.iv, @@ -112,7 +180,7 @@ async function getphonenumber(e) { } catch (error) { uni.showToast({ icon: "none", - title: "获取失败", + title: "获取手机号失败", }); } } else { @@ -128,7 +196,7 @@ async function toCreate(e) { console.log(); if (checkboxValue.value[0]) { // await handleLogin(); - await getphonenumber(e); + await dogetphonenumber(e); } else { uni.showModal({ title: "提示", @@ -137,7 +205,7 @@ async function toCreate(e) { if (res.confirm) { checkboxValue.value = ["同意智像相机用户使用协议"]; // handleLogin(); - getphonenumber(e); + dogetphonenumber(e); } else if (res.cancel) { } }, @@ -194,6 +262,120 @@ const goPro = () => { }; //#endregion --------------------- +//#region 手机号登录 +const formData = ref({ + phoneNum: null, + codeNum: null, +}); +const rules = { + phoneNum: [ + { + required: true, + message: "请填写手机号", + trigger: ["blur"], + }, + { + // 自定义验证函数,见上说明 + validator: (rule, value, callback) => { + // 上面有说,返回true表示校验通过,返回false表示不通过 + // uni.$u.test.mobile()就是返回true或者false的 + return uni.$u.test.mobile(value); + }, + message: "手机号码不正确", + // 触发器可以同时用blur和change + trigger: ["blur"], + }, + ], +}; +const formRef = ref(null); +const form1 = ref(null); +const backwardsNum = ref(60); +const countdownTimer = ref(null); // 倒计时的计时器 +const timerFlag = ref(false); +function getCode() { + if (timerFlag.value) { + return; // 如果倒计时尚未结束,不执行倒计时操作 + } + timerFlag.value = true; + formRef.value + .validate() + .then(async (res) => { + try { + uni.showLoading({ + title: "请稍后", + mask: true, + }); + const res = await getCodeApi(formData.value.phoneNum); + uni.hideLoading(); + if (res.code != 200) { + uni.showToast({ + title: res.message, + icon: "none", + }); + } + console.log(res); + // 表单验证通过后开始倒计时 + countdownTimer.value = setInterval(() => { + if (backwardsNum.value > 0) { + backwardsNum.value--; + console.log(backwardsNum.value); + } else { + clearInterval(countdownTimer.value); + countdownTimer.value = null; + backwardsNum.value = 60; + timerFlag.value = false; + } + }, 1000); + } catch (error) { + uni.hideLoading(); + uni.$u.toast("短信验证码获取失败"); + clearInterval(countdownTimer.value); + countdownTimer.value = null; + backwardsNum.value = 5; + timerFlag.value = false; + } + }) + .catch((errors) => { + console.log(errors); + }); +} + +async function loginByCode() { + uni.showLoading({ + title: "请稍后", + mask: true, + }); + const data = { + appId: userInfoModulesPinia.getAppId(), + openId: userInfoModulesPinia.openId, + phone: formData.value.phoneNum, + code: formData.value.codeNum, + }; + try { + const res = await loginByCodeApi(data); + console.log(res); + uni.hideLoading(); + userInfoModulesPinia.token = res.data.token; + if (res.code != 200) { + uni.showToast({ + title: res.message, + icon: "none", + }); + } else { + uni.redirectTo({ + url: "/pages/uploadPhoto/uploadPhoto", + }); + } + } catch (error) { + uni.hideLoading(); + uni.showToast({ + title: "登录失败,请重试", + icon: "none", + }); + } +} +//#endregion --------------------- + //#region onLoad((options) => { uni.hideHomeButton(); @@ -265,4 +447,30 @@ onLoad((options) => { } } } + +.phoneLoginForm { + position: absolute; + top: 20%; + left: 30rpx; + width: 690rpx; + z-index: 9; + background-color: #fff; + padding: 30rpx; + .u-code { + width: 100%; + height: 50rpx; + background-color: green; + color: #ff4f00; + } + .getCodeBtn { + background-color: green; + text-align: center; + line-height: 50rpx; + } + .loginBtn { + background-color: #ff4f00; + text-align: center; + line-height: 50rpx; + } +} diff --git a/src/pages/lookPhoto/index.vue b/src/pages/lookPhoto/index.vue index 5c03082..fecb9ac 100644 --- a/src/pages/lookPhoto/index.vue +++ b/src/pages/lookPhoto/index.vue @@ -255,7 +255,7 @@ async function photoSupper() { console.log(res); uni.hideLoading(); uni.showToast({ - title: "高清处理请求成功,请重稍后", + title: "高清处理请求成功,请稍后", icon: "none", }); diff --git a/src/pages/uploadPhoto/uploadPhoto.vue b/src/pages/uploadPhoto/uploadPhoto.vue index 1cb6590..ee9c1e4 100644 --- a/src/pages/uploadPhoto/uploadPhoto.vue +++ b/src/pages/uploadPhoto/uploadPhoto.vue @@ -87,6 +87,7 @@ //#region 导入 import { ref, reactive, nextTick } from "vue"; import { onLoad, onShow } from "@dcloudio/uni-app"; +import { BASE_URL } from "@/utils/request"; import { loginApi } from "../../api/login"; import { addImageApi } from "../../api/uploadphoto.js"; import { userInfoModules } from "@/store/modules/userInfo"; @@ -103,7 +104,6 @@ const showImgData = ref(null); //上传数据 // 点击上传图片 function chooseImage() { - console.log("chooseImage"); // 检查token if (!userInfoModulesPinia.token) { uni.showModal({ @@ -201,7 +201,7 @@ async function toCloseStyle() { console.log(showImgUrl2.value.path); // 百度敏感信息检测 uni.uploadFile({ - url: "https://test.metavatar.cc/C/api/baidu/checkPhoto", //上传图片api + url: BASE_URL + "api/baidu/checkPhoto", //上传图片api filePath: showImgUrl2.value.path, name: "file", formData: { @@ -219,7 +219,7 @@ async function toCloseStyle() { } // 人脸识别接口 uni.uploadFile({ - url: "https://test.metavatar.cc/C/api/userDigital/checkPhoto", //上传图片api + url: BASE_URL + "api/userDigital/checkPhoto", //上传图片api filePath: showImgUrl2.value.path, name: "file", formData: { @@ -237,7 +237,7 @@ async function toCloseStyle() { } // 上传接口 uni.uploadFile({ - url: "https://test.metavatar.cc/C/api/upload/awsImgUpload", //上传图片api + url: BASE_URL + "api/upload/awsImgUpload", //上传图片api filePath: showImgUrl2.value.path, name: "file", formData: { @@ -321,22 +321,21 @@ async function toCloseStyle() { //#region 页面初始化 onLoad((options) => { - // showImgUrl.value = userInfoModulesPinia.myAvatar; + // 获取微信小程序的 AppID + // const appid = uni.getAccountInfoSync().miniProgram.appId; // 微信登录授权 - if (userInfoModulesPinia.platForm != 1) { + if (userInfoModulesPinia.platForm == 2) { uni.login({ provider: "weixin", // 使用微信登录授权 success: async (res) => { - console.log(res); if (res.code) { - console.log(res.code); try { uni.showLoading({ title: "加载中...", mask: true, }); const data = { - appId: "wx75cf14e3a0d45821", + appId: userInfoModulesPinia.getAppId(), code: res.code, }; const res2 = await loginApi(data); @@ -407,7 +406,77 @@ onLoad((options) => { }, }); } - console.log(options); + // 抖音头条授权 + else if (userInfoModulesPinia.platForm == 3) { + uni.login({ + provider: "toutiao", // 使用微信登录授权 + success: async (res) => { + if (res.code) { + try { + uni.showLoading({ + title: "加载中...", + mask: true, + }); + const data = { + appId: userInfoModulesPinia.getAppId(), + code: res.code, + }; + const res2 = await loginApi(data); + userInfoModulesPinia.openId = res2.data.openId; + if (res2.data.token) { + userInfoModulesPinia.token = res2.data.token; + // uni.setStorageSync("token", userInfoModulesPinia.token); + console.log(userInfoModulesPinia.openId, "获取openid"); + // 获取头像和金币 + const res3 = await findImageApi(); + userInfoModulesPinia.myAvatar = + res3.data && res3.data.image ? res3.data.image : ""; + const res4 = await findGlodApi(); + if (!res4.data) { + userInfoModulesPinia.myGlod = 0; + } else { + userInfoModulesPinia.myGlod = res4.data.digitalAvatarResidueGlod + ? res4.data.digitalAvatarResidueGlod + : 0; + } + uni.hideLoading(); + } else { + uni.hideLoading(); + uni.redirectTo({ + url: "/pages/login/index", + }); + console.log("error1"); + uni.showToast({ + title: "登录失败,请重试", + icon: "none", + }); + } + uni.hideLoading(); + } catch (error) { + uni.hideLoading(); + console.log(error, "error2"); + uni.showToast({ + title: "登录失败,请重试", + icon: "none", + }); + } + } else { + console.log("error3"); + uni.showToast({ + title: "登录失败,请重试", + icon: "none", + }); + } + }, + fail: (err) => { + console.log("error4"); + uni.showToast({ + title: "登录失败,请重试", + icon: "none", + }); + }, + }); + } }); onShow(() => { // 若来自我的页面的更换头像按钮,直接触发以下操作 diff --git a/src/store/modules/userInfo.js b/src/store/modules/userInfo.js index ebc18bc..28fa216 100644 --- a/src/store/modules/userInfo.js +++ b/src/store/modules/userInfo.js @@ -14,6 +14,8 @@ export const userInfoModules = defineStore("userInfoStore", () => { const token = ref(null) const myAvatar = ref('') const myGlod = ref(0) + const wxappid = "wx75cf14e3a0d45821" + const dyappid = "tt2eba5807b1883f9f01" /** * @description:依托平台:(web、mp-weixin、mp-toutiao) * @example 平台名:"web-H5",枚举值:1 @@ -40,7 +42,14 @@ export const userInfoModules = defineStore("userInfoStore", () => { // async function getMyGlod(params) { // } - return { userInfo, openId, token, myAvatar, myGlod, platForm, hostSystem }; + function getAppId() { + if (platForm.value == 2) { + return wxappid + } else if (platForm.value == 3) { + return dyappid + } + } + return { userInfo, openId, token, myAvatar, myGlod, platForm, hostSystem, wxappid, dyappid, getAppId }; }, { diff --git a/src/utils/request.js b/src/utils/request.js index 4549b7e..f2c923b 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -45,4 +45,4 @@ const request = (requestObj) => { }) }) }; -export default request \ No newline at end of file +export { BASE_URL, request } \ No newline at end of file From ac5d8b0d61d33eb9b9456b56f0fe76e3c1c6784f Mon Sep 17 00:00:00 2001 From: congzc Date: Tue, 12 Sep 2023 15:32:15 +0800 Subject: [PATCH 2/7] 2 --- src/api/login.js | 7 +- src/pages/generateVideo/index.vue | 9 +- src/pages/index/index.vue | 74 +++++---------- src/pages/login/index.vue | 148 +++++++++++++++++++++++++++++- src/pages/lookPhoto/index.vue | 9 +- src/pages/recorded/index.vue | 9 +- 6 files changed, 191 insertions(+), 65 deletions(-) diff --git a/src/api/login.js b/src/api/login.js index d8acf3f..8eb58b1 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -1,11 +1,6 @@ import { request } from "../utils/request" -export function voiceTotalApi() { - return request({ - url: `api/voiceMould/voiceTotal`, - method: 'GET', - }) -} + // 微信登录 export function loginApi(data) { return request({ diff --git a/src/pages/generateVideo/index.vue b/src/pages/generateVideo/index.vue index e7e4536..7b4a375 100644 --- a/src/pages/generateVideo/index.vue +++ b/src/pages/generateVideo/index.vue @@ -129,9 +129,14 @@ function inviteFriend() { //#region 页面跳转 function bueCoin() { - uni.navigateTo({ - url: "/pages/home/buyCoin", + uni.showToast({ + title: "暂未开放", + icon: "none", + mask: true, }); + // uni.navigateTo({ + // url: "/pages/home/buyCoin", + // }); } //#endregion --------------------- diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 4f2fb42..978823b 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -30,9 +30,7 @@ 我的金币:   {{ userInfoModulesPinia.myGlod }} - 购买金币购买金币 登录即可体验更多功能哦! @@ -70,9 +68,7 @@ v-for="item in PhotoList" :key="item.id" class="showListItem" - @click=" - goOtherPage(`/pages/lookPhoto/index?id=${item.id}`, item.status) - " + @click="goLookPhoto(item.id, item.status)" > {{ item.title }} @@ -116,11 +112,7 @@ 暂无数据 , - 去生成! + 去生成! @@ -246,47 +238,22 @@ function chooseAvatar() { url: "/pages/uploadPhoto/uploadPhoto", }); return; - uni.chooseImage({ - count: 1, // 最多可以选择的图片张数,这里设置为1,只选择一张图片 - success: async (res) => { - // avatarUrl.value = res.tempFilePaths[0]; - // TODO: 在这里处理图片上传逻辑,你可以调用上传接口将图片上传到服务器 - // 示例代码: - // uploadImageToServer(tempFilePaths[0]); - // 图片压缩 - console.log(res.tempFiles[0].size); - if (userInfoModulesPinia.platForm != 1) { - uni.compressImage({ - src: res.tempFilePaths[0], - quality: 20, - success: (res2) => { - avatarUrl.value = res2.tempFilePath; - console.log(res2.tempFilePath); - }, - }); - } else { - const options = { - maxSizeMB: 2, // 最大压缩大小为 4MB - useWebWorker: true, // 使用 Web Worker 进行压缩,提高性能 - }; - const compressedFile = await imageCompression( - res.tempFiles[0], - options - ); - //compressedFile是一个blob对象 - avatarUrl.value = URL.createObjectURL(compressedFile); - console.log(compressedFile); - // avatarUrl.value = compressedFile; - console.log("压缩图片h5"); - } - }, - fail: (err) => { - console.error("选择图片失败", err); - }, +} +//#endregion + +//#region 路由跳转 +function goBuyCoin() { + uni.showToast({ + title: "暂未开放", + icon: "none", + mask: true, }); + // uni.navigateTo({ + // url: "/pages/home/buyCoin", + // }); } -function goOtherPage(url, status) { +function goLookPhoto(id, status) { if (status != 2) { uni.showToast({ title: "正在生成,请稍后", @@ -295,9 +262,16 @@ function goOtherPage(url, status) { return; } uni.navigateTo({ - url: url, + url: `/pages/lookPhoto/index?id=${id}`, }); } + +function goCloseStyle() { + uni.navigateTo({ + url: `/pages/closeStyle/closeStyle`, + }); +} + //#endregion //#region tab diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue index 18b950c..8b12618 100644 --- a/src/pages/login/index.vue +++ b/src/pages/login/index.vue @@ -129,7 +129,7 @@ import { ref, reactive, computed } from "vue"; import { onLoad } from "@dcloudio/uni-app"; import { - voiceTotalApi, + loginApi, loginPhoneApi, getCodeApi, loginByCodeApi, @@ -137,7 +137,7 @@ import { import { userInfoModules } from "@/store/modules/userInfo"; //#endregion const userInfoModulesPinia = userInfoModules(); - +console.log(userInfoModulesPinia.platForm); const pageClass = computed(() => { if (userInfoModulesPinia.platForm == 1) { return "page pageH5"; @@ -380,19 +380,161 @@ async function loginByCode() { onLoad((options) => { uni.hideHomeButton(); // workId.value = options.id; + if (options.type == "tokenFfalse") { uni.showToast({ title: "登录失效,请重新登录", icon: "none", }); } + + if (userInfoModulesPinia.platForm == 2) { + uni.login({ + provider: "weixin", // 使用微信登录授权 + success: async (res) => { + if (res.code) { + try { + uni.showLoading({ + title: "加载中...", + mask: true, + }); + const data = { + appId: userInfoModulesPinia.getAppId(), + code: res.code, + }; + const res2 = await loginApi(data); + userInfoModulesPinia.openId = res2.data.openId; + if (res2.data.token) { + userInfoModulesPinia.token = res2.data.token; + // uni.setStorageSync("token", userInfoModulesPinia.token); + console.log(userInfoModulesPinia.openId, "获取openid"); + // 获取头像和金币 + const res3 = await findImageApi(); + userInfoModulesPinia.myAvatar = + res3.data && res3.data.image ? res3.data.image : ""; + const res4 = await findGlodApi(); + if (!res4.data) { + userInfoModulesPinia.myGlod = 0; + } else { + userInfoModulesPinia.myGlod = res4.data.digitalAvatarResidueGlod + ? res4.data.digitalAvatarResidueGlod + : 0; + } + uni.hideLoading(); + if (res2.data.token) { + // uni.redirectTo({ + // url: "/pages/index/index", + // }); + } else { + uni.redirectTo({ + url: "/pages/login/index", + }); + console.log("error1"); + uni.showToast({ + title: "登录失败,请重试", + icon: "none", + }); + } + } + uni.hideLoading(); + } catch (error) { + // uni.redirectTo({ + // url: "pages/index/index", + // }); + console.log(error, "error2"); + uni.showToast({ + title: "登录失败,请重试", + icon: "none", + }); + } + } else { + // uni.redirectTo({ + // url: "pages/index/index", + // }); + console.log("error3"); + uni.showToast({ + title: "登录失败,请重试", + icon: "none", + }); + } + }, + fail: (err) => { + // uni.redirectTo({ + // url: "pages/index/index", + // }); + console.log("error4"); + uni.showToast({ + title: "登录失败,请重试", + icon: "none", + }); + }, + }); + } + // 抖音头条授权 + else if (userInfoModulesPinia.platForm == 3) { + uni.login({ + provider: "toutiao", // 使用微信登录授权 + success: async (res) => { + if (res.code) { + try { + uni.showLoading({ + title: "加载中...", + mask: true, + }); + const data = { + appId: userInfoModulesPinia.getAppId(), + code: res.code, + }; + const res2 = await loginApi(data); + userInfoModulesPinia.openId = res2.data.openId; + if (res2.data.token) { + userInfoModulesPinia.token = res2.data.token; + // uni.setStorageSync("token", userInfoModulesPinia.token); + console.log(userInfoModulesPinia.openId, "获取openid"); + uni.hideLoading(); + } else { + uni.hideLoading(); + // uni.redirectTo({ + // url: "/pages/login/index", + // }); + console.log("error1"); + uni.showToast({ + title: "登录失败,请重试", + icon: "none", + }); + } + uni.hideLoading(); + } catch (error) { + uni.hideLoading(); + console.log(error, "error2"); + uni.showToast({ + title: "登录失败,请重试", + icon: "none", + }); + } + } else { + console.log("error3"); + uni.showToast({ + title: "登录失败,请重试", + icon: "none", + }); + } + }, + fail: (err) => { + console.log("error4"); + uni.showToast({ + title: "登录失败,请重试", + icon: "none", + }); + }, + }); + } }); //#endregion --------------------------------- //#region //#endregion --------------------------------- -// voiceTotalApi(); diff --git a/src/pages/lookPhoto/index.vue b/src/pages/lookPhoto/index.vue index 5866ff5..c00ef6e 100644 --- a/src/pages/lookPhoto/index.vue +++ b/src/pages/lookPhoto/index.vue @@ -33,7 +33,7 @@ 邀请好友可获得2枚金币 - + @@ -159,33 +159,40 @@ function previewImage(index) { //#endregion --------------------- //#region 分享 +// onShareAppMessage((res) => { +// return { +// title: "页面分享的标题", +// path: "pages/uploadPhoto/uploadPhoto", +// // imageUrl: "", +// }; +// }); + function share() { - uni.showToast({ - title: "敬请期待!", - icon: "none", - }); - return; - uni.share({ - provider: "weixin", //分享服务提供商(即weixin|qq|sinaweibo) - scene: "WXSenceTimeline", //WXSceneSession(分享到聊天界面)、WXSenceTimeline(分享到朋友圈)、WXSceneFavorite(分享到微信收藏) - type: 5, - title: "分享到朋友圈", - summary: "分享描述", - href: "www.baidu.com", //分享跳转地址 - imageUrl: "../static/lovehot.png", //分享图片路径(必须是线上可访问图片) - miniProgram: { - id: "wx75cf14e3a0d45821", - path: "pages/index/index", - type: 0, - webUrl: "", - }, - success: function (res) { - // console.log("success:" + JSON.stringify(res)); - }, - fail: function (err) { - // console.log("fail:" + JSON.stringify(err)); - }, - }); + // -------------------------------------------------- + // uni.showToast({ + // title: "敬请期待!", + // icon: "none", + // }); + // return; + // uni.onShareAppMessage({ + // provider: "weixin", //分享服务提供商(即weixin|qq|sinaweibo) + // scene: "WXSenceTimeline", //WXSceneSession(分享到聊天界面)、WXSenceTimeline(分享到朋友圈)、WXSceneFavorite(分享到微信收藏) + // type: 5, + // title: "分享到朋友圈", + // summary: "分享描述", + // href: "www.baidu.com", //分享跳转地址 + // imageUrl: "../static/lovehot.png", //分享图片路径(必须是线上可访问图片) + // miniProgram: { + // id: "wx75cf14e3a0d45821", + // path: "pages/index/index", + // type: 0, + // webUrl: "", + // }, + // success: function (res) { + // }, + // fail: function (err) { + // }, + // }); } function inviteFriend() { uni.showToast({ diff --git a/src/pages/protocol/coin.vue b/src/pages/protocol/coin.vue index 12d53c8..5149060 100644 --- a/src/pages/protocol/coin.vue +++ b/src/pages/protocol/coin.vue @@ -1,24 +1,24 @@ diff --git a/src/pages/protocol/user.vue b/src/pages/protocol/user.vue index 1bd4bef..1e2bd87 100644 --- a/src/pages/protocol/user.vue +++ b/src/pages/protocol/user.vue @@ -4,7 +4,7 @@
生效日期:2023年8月2日
版本号:2023V1
- 欢迎您使用慧拍!为使用未序网络科技(上海)有限公司(以下简称“我方”)运营的慧拍客户端软件提供的相关服务(以下简称“我方平台服务”),您应当阅读并遵守《用户服务协议》(以下简称“本协议”)。建议您仔细阅读本协议的全部内容,尤其是以加粗形式展示的与您的权益(可能)存在重大关系的条款(包括相关约定免除或者限制责任的条款、法律适用和争议解决等条款),请您务必审慎阅读、充分理解个条款内容。各条款标题仅为帮助您理解该条款表达的主旨之用,不影响或限制本协议条款的含义或解释。 + 欢迎您使用智像!为使用未序网络科技(上海)有限公司(以下简称“我方”)运营的智像客户端软件提供的相关服务(以下简称“我方平台服务”),您应当阅读并遵守《用户服务协议》(以下简称“本协议”)。建议您仔细阅读本协议的全部内容,尤其是以加粗形式展示的与您的权益(可能)存在重大关系的条款(包括相关约定免除或者限制责任的条款、法律适用和争议解决等条款),请您务必审慎阅读、充分理解个条款内容。各条款标题仅为帮助您理解该条款表达的主旨之用,不影响或限制本协议条款的含义或解释。
您点击同意或您使用我方平台服务(使用”行为指包括但不限于下载安装、启动、浏览、注册、登录等行为中的一种或多种,下同),即表示您已阅读并同意签署本协议所有内容,本协议即在您与我方之间产生法律效力,成为对双方均具有约束力的法律文件。如您不同意我方不时对本协议的修改或补充内容,您应放弃注册、停止使用或主动取消本服务。 @@ -21,7 +21,7 @@
1.2 - 我方平台:慧拍(www.metavatar.cc)向您提供的各项产品及/或服务的网站、客户端、小程序以及随技术发展出现的新形态。 + 我方平台:智像(www.metavatar.cc)向您提供的各项产品及/或服务的网站、客户端、小程序以及随技术发展出现的新形态。
1.3 @@ -56,7 +56,7 @@ 3.2 账户说明
3.2.1 - [账户获得]当您按照注册页面提示填写信息、阅读并同意本协议目完成全部注册程序后,您可获得我方平台账户(“慧拍账户”)并成为我方平台用户。 + [账户获得]当您按照注册页面提示填写信息、阅读并同意本协议目完成全部注册程序后,您可获得我方平台账户(“智像账户”)并成为我方平台用户。
3.2.2 @@ -69,7 +69,7 @@
4.1 我方平台服务
4.1.1 - 服务范围:我方平台服务是指由我们提供的名称为慧拍的服务。根据您选择的功能不同,您可能将上传您的照片用于AI生成,系统将通过后期技术生成新的内容。“您的上传内容”与“AI生成内容”,统称为“您的内容”。 + 服务范围:我方平台服务是指由我们提供的名称为智像的服务。根据您选择的功能不同,您可能将上传您的照片用于AI生成,系统将通过后期技术生成新的内容。“您的上传内容”与“AI生成内容”,统称为“您的内容”。
4.1.2 @@ -79,7 +79,7 @@ 4.1.3 知识产权:
(1) - 我方知识产权:除非另有约定或我方另行声明,本服务所使用的我方平台内的所有内容及我方平台的Logo、“慧拍”等文字、图形及其组合,以及我方平台的其他标识、徽记、产品和服务名称均归我方或我方关联公司所有或控制。未经我方书面授权,任何人不得以任何方式展示、使用或作其他处理,也不得向他人表明您有权展示、使用或作其他处理。 + 我方知识产权:除非另有约定或我方另行声明,本服务所使用的我方平台内的所有内容及我方平台的Logo、“智像”等文字、图形及其组合,以及我方平台的其他标识、徽记、产品和服务名称均归我方或我方关联公司所有或控制。未经我方书面授权,任何人不得以任何方式展示、使用或作其他处理,也不得向他人表明您有权展示、使用或作其他处理。
(2) diff --git a/src/pages/uploadPhoto/success.vue b/src/pages/uploadPhoto/success.vue index d7d9ab4..85bdf8f 100644 --- a/src/pages/uploadPhoto/success.vue +++ b/src/pages/uploadPhoto/success.vue @@ -61,7 +61,7 @@ function router2(url) { } function getRandomRange() { - randomNum.value = Math.floor(Math.random() * (100 - 81)) + 80; + randomNum.value = Math.floor(Math.random() * (99 - 95 + 1)) + 95; } //#endregion ---------------------