为了账号安全,请及时绑定邮箱和手机立即绑定

errcode: 40125, errmsg: 'invalid appsecret, view more at http://t.cn/RAEkdVq hint: [FVinTA09721501]

errcode: 40125, errmsg: 'invalid appsecret, view more at http://t.cn/RAEkdVq hint: [FVinTA09721501]

慕仙3125880 2018-04-17 10:07:56
const mongoose = require('mongoose')const Schema = mongoose.Schemaconst TokenSchema = new mongoose.Schema({     name: String,     token:String,     expires_in: Number,     meta: {      createdAt: {      type: Date,      default: Date.now()      },      updatedAt: {      type: Date,      default: Date.now()      }     }})//mongoose保存之前对中间键进行处理TokenSchema.pre('save', function (next){ if(this.isNew){      this.meta.createdAt = this.meta.updatedAt = Date.now() } else{      this.meta.updatedAt = Date.now() } next()})//设置静态方法TokenSchema.statics = { async getAccessToken() { const token = await this.findOne({ name: 'access_token' }).exec() if (token && token.token) {            token.access_token = token.token } return token },  async saveAccessToken(data){ let token = await this.findOne({ name: 'access_token' }).exec() if(token) { token.token = data.access_token, token.expires_in = data.expires_in }else{ token = new Token({ name: 'access_token', token: data.access_token, expires_in: data.expires_in }) } await token.save() return data}} const Token = mongoose.model('Token', TokenSchema)
查看完整描述

1 回答

已采纳
?
pardon110

TA贡献1038条经验 获得超227个赞

appsecret错误


查看完整回答
反对 回复 2018-04-17
  • 1 回答
  • 0 关注
  • 4345 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信